mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Update wordpress/tasks/enable.yml
This commit is contained in:
parent
2a11796af0
commit
80f9e202ee
1 changed files with 25 additions and 26 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue