mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
sugarizer - softcode nginx_config_dir, add disable logic
This commit is contained in:
parent
07996d87b9
commit
3d9bf9c83a
1 changed files with 12 additions and 6 deletions
|
@ -3,13 +3,13 @@
|
||||||
src: /etc/apache2/sites-available/sugarizer.conf
|
src: /etc/apache2/sites-available/sugarizer.conf
|
||||||
path: /etc/apache2/sites-enabled/sugarizer.conf
|
path: /etc/apache2/sites-enabled/sugarizer.conf
|
||||||
state: link
|
state: link
|
||||||
when: sugarizer_enabled | bool and not nginx_enabled | bool
|
when: sugarizer_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf (if not sugarizer_enabled)
|
- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf (if not sugarizer_enabled)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/sugarizer.conf
|
path: /etc/apache2/sites-enabled/sugarizer.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not sugarizer_enabled | bool or nginx_enabled | bool
|
when: not sugarizer_enabled or nginx_enabled
|
||||||
|
|
||||||
- name: "Install sugarizer-nginx.conf (nginx)"
|
- name: "Install sugarizer-nginx.conf (nginx)"
|
||||||
template:
|
template:
|
||||||
|
@ -19,8 +19,14 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'sugarizer-nginx.conf', dest: '/etc/nginx/conf.d/sugarizer-nginx.conf' , mode: '0644' }
|
- { src: 'sugarizer-nginx.conf', dest: '{{ nginx_config_dir }}/sugarizer-nginx.conf', mode: '0644' }
|
||||||
when: sugarizer_enabled | bool and nginx_enabled | bool
|
when: sugarizer_enabled and nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/sugarizer-nginx.conf (if not sugarizer_enabled)
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/sugarizer-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not sugarizer_enabled and nginx_enabled
|
||||||
|
|
||||||
# 6. RESTART/STOP SYSTEMD SERVICE
|
# 6. RESTART/STOP SYSTEMD SERVICE
|
||||||
|
|
||||||
|
@ -31,7 +37,7 @@
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: sugarizer_enabled | bool
|
when: sugarizer_enabled
|
||||||
|
|
||||||
- name: Disable & Stop 'sugarizer' systemd service (if not sugarizer_enabled)
|
- name: Disable & Stop 'sugarizer' systemd service (if not sugarizer_enabled)
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -62,7 +68,7 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # httpd or apache2
|
name: "{{ apache_service }}" # httpd or apache2
|
||||||
state: restarted
|
state: restarted
|
||||||
when: sugarizer_enabled | bool and not nginx_enabled | bool
|
when: sugarizer_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Restart nginx when enabled
|
- name: Restart nginx when enabled
|
||||||
systemd:
|
systemd:
|
||||||
|
|
Loading…
Reference in a new issue