Skip to content

Commit

Permalink
#49: Ensure conflicting web server is not running on remote
Browse files Browse the repository at this point in the history
  • Loading branch information
BR0kEN- committed Jan 25, 2018
1 parent 7b8bd0c commit 5889725
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions scripts/roles/cikit-php/tasks/nginx/local.yml
@@ -1 +1,6 @@
---
- name: Start FPM and add it to boot
service:
name: "php{{ php_version }}-fpm"
state: started
enabled: yes
11 changes: 0 additions & 11 deletions scripts/roles/cikit-webserver/tasks/local.yml
@@ -1,14 +1,3 @@
---
- name: Eliminate web servers conflicts
service:
name: "{{ item }}"
# Stop conflicting web server.
state: stopped
# Prevent conflicting web server to be started on boot.
enabled: no
# Apply the rule for any web server, except currently selected.
when: web_server != item
with_items: "{{ cikit_webserver.servers }}"

- include_role:
name: "cikit-{{ web_server }}"
11 changes: 11 additions & 0 deletions scripts/roles/cikit-webserver/tasks/main.yml
Expand Up @@ -3,4 +3,15 @@
set_fact:
web_server_operation_place: "{{ 'local' if localhost else 'remote' }}"

- name: Eliminate web servers conflicts
service:
name: "{{ item }}"
# Stop conflicting web server.
state: stopped
# Prevent conflicting web server to be started on boot.
enabled: no
# Apply the rule for any web server, except currently selected.
when: web_server != item
with_items: "{{ cikit_webserver.servers }}"

- include_tasks: "{{ web_server_operation_place }}.yml"
1 change: 1 addition & 0 deletions scripts/roles/cikit-webserver/tasks/remote.yml
Expand Up @@ -6,3 +6,4 @@

- include_role:
name: cikit-apache2
when: "'apache2' == web_server"

0 comments on commit 5889725

Please sign in to comment.