1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00
iiab/roles/wordpress/tasks/enable.yml

63 lines
1.9 KiB
YAML
Raw Normal View History

2020-01-11 19:00:13 +00:00
# Apache
- name: Enable http://box{{ wp_url }} via Apache
2020-01-11 19:00:13 +00:00
command: a2ensite wordpress.conf
when: apache_install and wordpress_enabled
- name: Disable http://box{{ wp_url }} via Apache
2020-01-11 19:00:13 +00:00
command: a2dissite wordpress.conf
when: apache_install and not wordpress_enabled
2020-01-11 19:11:22 +00:00
- name: Restart Apache systemd service ({{ apache_service }})
2020-01-11 19:00:13 +00:00
systemd:
2020-01-12 00:28:57 +00:00
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
2020-01-11 19:00:13 +00:00
state: restarted
when: apache_enabled | bool
# 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"
2020-01-11 19:00:13 +00:00
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
2020-01-11 19:00:13 +00:00
when: nginx_install and not wordpress_enabled
2020-01-12 00:28:57 +00:00
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted
2020-01-11 19:00:13 +00:00
when: nginx_enabled | bool
2020-01-12 00:28:57 +00:00
- name: Add 'wordpress' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: wordpress
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: name
value: WordPress
- option: description
value: '"WordPress is a blog and web site management application."'
- option: wordpress_src
value: "{{ wordpress_src }}"
- option: wp_abs_path
value: "{{ wp_abs_path }}"
- option: wp_db_name
value: "{{ wp_db_name }}"
- option: wp_db_user
value: "{{ wp_db_user }}"
- option: wp_url
value: "{{ wp_url }}"
- option: wp_full_url
value: "{{ wp_full_url }}"
- option: wordpress_enabled
value: "{{ wordpress_enabled }}"