mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update and rename wordpress/enable-or-disable.yml to nginx.yml
This commit is contained in:
parent
395ff1b3a5
commit
b23f1f1638
2 changed files with 16 additions and 35 deletions
|
@ -1,35 +0,0 @@
|
|||
# Apache
|
||||
|
||||
- name: Enable http://box{{ wp_url }} via Apache
|
||||
command: a2ensite wordpress.conf
|
||||
when: apache_install and wordpress_enabled
|
||||
|
||||
- name: Disable http://box{{ wp_url }} via Apache
|
||||
command: a2dissite wordpress.conf
|
||||
when: apache_install and not wordpress_enabled
|
||||
|
||||
- name: Restart Apache systemd service ({{ apache_service }})
|
||||
systemd:
|
||||
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
||||
state: restarted
|
||||
when: apache_install and apache_enabled
|
||||
|
||||
# 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" # /etc/nginx/conf.d
|
||||
when: wordpress_enabled # and nginx_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" # /etc/nginx/conf.d
|
||||
state: absent
|
||||
when: not wordpress_enabled
|
||||
|
||||
- name: Restart 'nginx' systemd service
|
||||
systemd:
|
||||
name: nginx
|
||||
state: restarted
|
||||
#when: nginx_enabled | bool
|
16
roles/wordpress/tasks/nginx.yml
Normal file
16
roles/wordpress/tasks/nginx.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
- 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" # /etc/nginx/conf.d
|
||||
when: 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" # /etc/nginx/conf.d
|
||||
state: absent
|
||||
when: not wordpress_enabled
|
||||
|
||||
- name: Restart 'nginx' systemd service
|
||||
systemd:
|
||||
name: nginx
|
||||
state: restarted
|
Loading…
Add table
Add a link
Reference in a new issue