Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

98 wiersze
2.3KB

  1. ---
  2. - name: mysql database
  3. mysql_db:
  4. name: "{{postfixadmin_mysql_database}}"
  5. state: present
  6. delegate_to: "{{(postfixadmin_mysql_host=='localhost')|ternary(inventory_hostname,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: "{{postfixadmin_mysql_host}}"
  13. state: present
  14. delegate_to: "{{(postfixadmin_mysql_host=='localhost')|ternary(inventory_hostname,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. - name: make postfixadmin-cli executable
  45. file:
  46. path: /usr/share/postfixadmin/scripts/postfixadmin-cli
  47. mode: "u=rwx,g=rx,o=rx"
  48. - name: symlink for postfixadmin-cli
  49. file:
  50. src: /usr/share/postfixadmin/scripts/postfixadmin-cli
  51. dest: /usr/local/bin/postfixadmin-cli
  52. state: link
  53. #- name: setup postfixadmin
  54. # get_url:
  55. # url: http://localhost/postfixadmin/setup.php
  56. # dest: /var/www/html/postfixadmin-setup-report.html
  57. - name: apache2 default vhost config
  58. template:
  59. src: apache2_default_vhost.conf.j2
  60. dest: /etc/apache2/sites-available/000-default.conf
  61. notify:
  62. - apache2 reload
  63. - name: apache2 default-ssl vhost config
  64. template:
  65. src: apache2_default-ssl_vhost.conf.j2
  66. dest: /etc/apache2/sites-available/default-ssl.conf
  67. notify:
  68. - apache2 reload
  69. - name: apache2 default-ssl vhost enable
  70. file:
  71. src: ../sites-available/default-ssl.conf
  72. dest: /etc/apache2/sites-enabled/default-ssl.conf
  73. state: link
  74. notify:
  75. - apache2 reload
  76. - name: apache2 ssl module enable
  77. apache2_module:
  78. name: ssl
  79. state: present
  80. notify:
  81. - apache2 reload
  82. - name: flush handlers
  83. meta: flush_handlers