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.

main.yml 2.6KB

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