1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Update wordpress/tasks/enable.yml

This commit is contained in:
A Holt 2020-01-11 14:00:13 -05:00 committed by GitHub
parent 2a11796af0
commit 80f9e202ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,39 +1,38 @@
- name: Create symlink wordpress.conf from sites-enabled to sites-available, if wordpress_enabled (debuntu)
file:
src: /etc/apache2/sites-available/wordpress.conf
path: /etc/apache2/sites-enabled/wordpress.conf
state: link
when: wordpress_enabled and not nginx_enabled
# Apache
- name: Remove /etc/apache2/sites-enabled/wordpress.conf if not wordpress_enabled (debuntu)
file:
path: /etc/apache2/sites-enabled/wordpress.conf
state: absent
when: not wordpress_enabled and is_debuntu
- name: "Enable http://box{{ wp_url }} via Apache"
command: a2ensite wordpress.conf
when: apache_install and wordpress_enabled
- name: Install {{ nginx_config_dir }}/wordpress-nginx.conf from template, for http://box{{ wp_url }}
template:
src: wordpress-nginx.conf.j2
dest: "{{ nginx_config_dir }}/wordpress-nginx.conf"
when: wordpress_enabled and nginx_enabled
- name: "Disable http://box{{ wp_url }} via Apache"
command: a2dissite wordpress.conf
when: apache_install and not wordpress_enabled
- name: Remove {{ nginx_config_dir }}/wordpress-nginx.conf if not wordpress_enabled (debuntu)
file:
path: "{{ nginx_config_dir }}/wordpress-nginx.conf"
state: absent
when: not wordpress_enabled and nginx_enabled
- name: Restart Apache service ({{ apache_service }}) to enable/disable http://box{{ wp_url }}
- name: Restart Apache systems service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
state: restarted
when: not nginx_enabled
when: apache_enabled | bool
- name: Restart nginx service to enable/disable http://box{{ wp_url }}
# NGINX
- name: "Enable http://box{{ wp_url }} via NGINX, by installing {{ nginx_config_dir }}/wordpress-nginx.conf from template"
template:
src: wordpress-nginx.conf.j2
dest: "{{ nginx_config_dir }}/wordpress-nginx.conf"
when: nginx_install and wordpress_enabled
- name: "Disable http://box{{ wp_url }} via NGINX, by removing {{ nginx_config_dir }}/wordpress-nginx.conf"
file:
path: "{{ nginx_config_dir }}/wordpress-nginx.conf"
state: absent
when: nginx_install and not wordpress_enabled
- name: Restart nginx systemd service
systemd:
name: nginx
state: restarted
when: nginx_enabled
when: nginx_enabled | bool
- name: Add 'wordpress' variable values to {{ iiab_ini_file }}
ini_file: