Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

104 lignes
2.5KB

  1. ---
  2. - name: mysql database
  3. mysql_db:
  4. name: "{{postfixadmin_mysql_database}}"
  5. state: present
  6. delegate_to: "{{postfixadmin_mysql_host}}"
  7. - name: mysql user
  8. mysql_user:
  9. name: "{{postfixadmin_mysql_username}}"
  10. password: "{{postfixadmin_mysql_password}}"
  11. priv: "{{postfixadmin_mysql_database}}.*:ALL,GRANT"
  12. state: present
  13. delegate_to: "{{postfixadmin_mysql_host}}"
  14. - name: disable dbconfig
  15. debconf:
  16. name: postfixadmin
  17. question: postfixadmin/dbconfig-{{item}}
  18. answer: false
  19. vtype: boolean
  20. with_items:
  21. - install
  22. - reinstall
  23. - remove
  24. - upgrade
  25. - name: install packages
  26. apt:
  27. pkg: "{{item}}"
  28. install_recommends: no
  29. with_items:
  30. - postfixadmin
  31. - ca-certificates
  32. - ssl-cert
  33. - name: dbconfig
  34. template:
  35. src: dbconfig.inc.php.j2
  36. dest: /etc/postfixadmin/dbconfig.inc.php
  37. - name: ensure template_c folder is writable by webserver
  38. file:
  39. path: /usr/share/postfixadmin/templates_c
  40. owner: www-data
  41. group: www-data
  42. state: directory
  43. # fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858005
  44. - name: fix postfixadmin setup bug (debian bug \#858005)
  45. get_url:
  46. url: https://raw.githubusercontent.com/postfixadmin/postfixadmin/ba94c3a75ea025762ad732b1a4c735251add8b0f/upgrade.php
  47. dest: /usr/share/postfixadmin/upgrade.php
  48. checksum: sha256:f2a87ded979be06250ab59f9cb4a26e70323b9f1aa962e5efe206b81ebb48d51
  49. - name: make postfixadmin-cli executable
  50. file:
  51. path: /usr/share/postfixadmin/scripts/postfixadmin-cli
  52. mode: "u=rwx,g=rx,o=rx"
  53. - name: symlink for postfixadmin-cli
  54. file:
  55. src: /usr/share/postfixadmin/scripts/postfixadmin-cli
  56. dest: /usr/local/bin/postfixadmin-cli
  57. state: link
  58. #- name: setup postfixadmin
  59. # get_url:
  60. # url: http://localhost/postfixadmin/setup.php
  61. # dest: /var/www/html/postfixadmin-setup-report.html
  62. - name: apache2 default vhost config
  63. template:
  64. src: apache2_default_vhost.conf.j2
  65. dest: /etc/apache2/sites-available/000-default.conf
  66. notify:
  67. - apache2 reload
  68. - name: apache2 default-ssl vhost config
  69. template:
  70. src: apache2_default-ssl_vhost.conf.j2
  71. dest: /etc/apache2/sites-available/default-ssl.conf
  72. notify:
  73. - apache2 reload
  74. - name: apache2 default-ssl vhost enable
  75. file:
  76. src: ../sites-available/default-ssl.conf
  77. dest: /etc/apache2/sites-enabled/default-ssl.conf
  78. state: link
  79. notify:
  80. - apache2 reload
  81. - name: apache2 ssl module enable
  82. apache2_module:
  83. name: ssl
  84. state: present
  85. notify:
  86. - apache2 reload
  87. - name: flush handlers
  88. meta: flush_handlers