ansible-roles/webapps/evoadmin-web/tasks/web.yml
Patrick Marchand 67664ec0e2 Pass evoadmin-web role through yamllint and ansible-lint
Recommends using true or false values directly instead of the truthy
and falsie yes True and etc. This also means that we can get rid
of the cast to booleans in some of the checks.

The other fixes are mostly in the realm of indentation and whitespace.
2019-08-27 09:58:08 -04:00

62 lines
2 KiB
YAML

---
- name: "Set custom values for PHP config (jessie)"
ini_file:
dest: /etc/php5/apache2/conf.d/zzz-evolinux-custom.ini
section: PHP
option: "disable_functions"
value: "shell-exec,system,passthru,putenv,popen"
notify: reload apache2
when: ansible_distribution_release == "jessie"
- name: "Set custom values for PHP config (Debian 9 or later)"
ini_file:
dest: /etc/php/7.0/apache2/conf.d/zzz-evolinux-custom.ini
section: PHP
option: "disable_functions"
value: "shell-exec,system,passthru,putenv,popen"
notify: reload apache2
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: Install evoadmin VHost
template:
src: "{{ item }}"
dest: /etc/apache2/sites-available/evoadmin.conf
force: "{{ evoadmin_force_vhost }}"
with_first_found:
- "templates/evoadmin-web/evoadmin.{{ inventory_hostname }}.conf.j2"
- "templates/evoadmin-web/evoadmin.{{ host_group }}.conf.j2"
- "templates/evoadmin-web/evoadmin.conf.j2"
- "evoadmin.conf.j2"
register: evoadmin_vhost_template
notify: reload apache2
- name: Enable evoadmin vhost
command: "a2ensite evoadmin.conf"
register: cmd_a2ensite
changed_when: "'Enabling site' in cmd_a2ensite.stdout"
notify: reload apache2
when: evoadmin_enable_vhost
- name: Disable evoadmin vhost
command: "a2dissite evoadmin.conf"
register: cmd_a2dissite
changed_when: "'Disabling site' in cmd_a2dissite.stdout"
notify: reload apache2
when: not evoadmin_enable_vhost
- name: Copy config file for evoadmin
template:
src: "{{ item }}"
dest: "{{ evoadmin_document_root }}/conf/config.local.php"
mode: "0640"
owner: evoadmin
group: evoadmin
force: "{{ evoadmin_config_local_php_force }}"
with_first_found:
- "templates/evoadmin-web/config.local.{{ inventory_hostname }}.php.j2"
- "templates/evoadmin-web/config.local.{{ host_group }}.php.j2"
- "templates/evoadmin-web/config.local.php.j2"
- "config.local.conf.j2"
register: evoadmin_config_local_php_template