|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- ---
-
- - name: mysql database
- mysql_db:
- name: "{{postfixadmin_mysql_database}}"
- state: present
- delegate_to: "{{postfixadmin_mysql_host}}"
-
- - name: mysql user
- mysql_user:
- name: "{{postfixadmin_mysql_username}}"
- password: "{{postfixadmin_mysql_password}}"
- priv: "{{postfixadmin_mysql_database}}.*:ALL,GRANT"
- host: "{{inventory_hostname}}"
- state: present
- delegate_to: "{{postfixadmin_mysql_host}}"
-
- - name: disable dbconfig
- debconf:
- name: postfixadmin
- question: postfixadmin/dbconfig-{{item}}
- answer: false
- vtype: boolean
- with_items:
- - install
- - reinstall
- - remove
- - upgrade
-
- - name: install packages
- apt:
- pkg: "{{item}}"
- install_recommends: no
- with_items:
- - postfixadmin
- - ca-certificates
- - ssl-cert
-
- - name: dbconfig
- template:
- src: dbconfig.inc.php.j2
- dest: /etc/postfixadmin/dbconfig.inc.php
-
- - name: ensure template_c folder is writable by webserver
- file:
- path: /usr/share/postfixadmin/templates_c
- owner: www-data
- group: www-data
- state: directory
-
- # fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858005
- - name: fix postfixadmin setup bug (debian bug \#858005)
- get_url:
- url: https://raw.githubusercontent.com/postfixadmin/postfixadmin/ba94c3a75ea025762ad732b1a4c735251add8b0f/upgrade.php
- dest: /usr/share/postfixadmin/upgrade.php
- checksum: sha256:f2a87ded979be06250ab59f9cb4a26e70323b9f1aa962e5efe206b81ebb48d51
-
- - name: make postfixadmin-cli executable
- file:
- path: /usr/share/postfixadmin/scripts/postfixadmin-cli
- mode: "u=rwx,g=rx,o=rx"
-
- - name: symlink for postfixadmin-cli
- file:
- src: /usr/share/postfixadmin/scripts/postfixadmin-cli
- dest: /usr/local/bin/postfixadmin-cli
- state: link
-
- #- name: setup postfixadmin
- # get_url:
- # url: http://localhost/postfixadmin/setup.php
- # dest: /var/www/html/postfixadmin-setup-report.html
-
- - name: apache2 default vhost config
- template:
- src: apache2_default_vhost.conf.j2
- dest: /etc/apache2/sites-available/000-default.conf
- notify:
- - apache2 reload
-
- - name: apache2 default-ssl vhost config
- template:
- src: apache2_default-ssl_vhost.conf.j2
- dest: /etc/apache2/sites-available/default-ssl.conf
- notify:
- - apache2 reload
-
- - name: apache2 default-ssl vhost enable
- file:
- src: ../sites-available/default-ssl.conf
- dest: /etc/apache2/sites-enabled/default-ssl.conf
- state: link
- notify:
- - apache2 reload
-
- - name: apache2 ssl module enable
- apache2_module:
- name: ssl
- state: present
- notify:
- - apache2 reload
-
- - name: flush handlers
- meta: flush_handlers
|