diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index d1041ba6f..b332c0f21 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -15,9 +15,13 @@ # has no "when: XXXXX_install" flag tags: base, mysql +- name: Install nginx + include_tasks: roles/nginx/tasks/install.yml + when: nginx_install + - name: Install dnsmasq include_tasks: roles/network/tasks/dnsmasq.yml - when: dnsmasq_install | bool + when: dnsmasq_install tags: base, domain, dnsmasq, network - name: Recording STAGE 3 HAS COMPLETED ===================== diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index ff691076c..e0740cf93 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -70,11 +70,6 @@ command: /usr/bin/iiab-refresh-wiki-docs when: internet_available and not nodocs -- name: Configure Apache systemd service ({{ apache_service }}) - include_role: - name: httpd-enable - tags: base, httpd - - name: Recording STAGE 4 HAS COMPLETED ================== lineinfile: dest: "{{ iiab_env_file }}" diff --git a/roles/9-local-addons/tasks/main.yml b/roles/9-local-addons/tasks/main.yml index 63e587c6c..2c5e66f39 100644 --- a/roles/9-local-addons/tasks/main.yml +++ b/roles/9-local-addons/tasks/main.yml @@ -43,12 +43,19 @@ name: calibre-web tags: calibre-web -- name: NGINX +# could split this two below to stage 10? +- name: Configure NGINX include_role: name: nginx when: nginx_install tags: base, nginx +- name: Configure Apache systemd service ({{ apache_service }}) + include_role: + name: httpd-enable + when: apache_install + tags: base, httpd + - name: Recording STAGE 9 HAS COMPLETED ==================== lineinfile: dest: "{{ iiab_env_file }}" diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml new file mode 100644 index 000000000..486a36506 --- /dev/null +++ b/roles/nginx/tasks/install.yml @@ -0,0 +1,18 @@ +- name: Install nginx required and helper packages + package: name={{ item }} state=present + with_items: + - nginx-extras + - uwsgi + - uwsgi-plugin-python3 + - php-fpm + - libnginx-mod-http-subs-filter + +- name: Add http server user to shadow group, so it can authenticate Admin Console + user: + name: "{{ apache_user }}" + groups: shadow + +- name: Remove the nginx default config + file: + path: /etc/nginx/sites-enabled/default + state: absent diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 8617613a5..1fcecb189 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -1,13 +1,3 @@ -- name: Install nginx required and helper packages - package: name={{ item }} state=present - with_items: - - nginx-extras - - uwsgi - - uwsgi-plugin-python3 - - php-fpm - - libnginx-mod-http-subs-filter - when: nginx_install | bool - - name: Put the config file in place template: src: '{{ item.src}}' @@ -22,18 +12,6 @@ - { src: 'ports.conf' , dest: '/etc/{{ apache_service }}/' , mode: '0644' } when: nginx_enabled | bool -- name: Add http server user to shadow group, so it can authenticate Admin Console - user: - name: "{{ apache_user }}" - groups: shadow - when: nginx_install | bool - -- name: Remove the nginx default config - file: - path: /etc/nginx/sites-enabled/default - state: absent - when: nginx_install | bool - - name: Insure that apache2 is not running -- we may need port swap systemd: name: apache2