From 07e59583dd438adbee1c7d5e03a664f143f99c20 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 12 Jan 2020 08:27:33 -0500 Subject: [PATCH 1/3] Fix nginx/tasks/uses_apache.yml, Clean Stage 9 --- roles/9-local-addons/tasks/main.yml | 7 ++++--- roles/httpd/tasks/enable.yml | 14 +++++++------- roles/nginx/tasks/uses_apache.yml | 12 ++++++------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/roles/9-local-addons/tasks/main.yml b/roles/9-local-addons/tasks/main.yml index 9f2c3b40f..954b72366 100644 --- a/roles/9-local-addons/tasks/main.yml +++ b/roles/9-local-addons/tasks/main.yml @@ -38,17 +38,18 @@ name: calibre-web tags: calibre-web -# could split this two below to stage 10? +# Could split these two below to Stage 10? + - name: Configure NGINX include_role: name: nginx - when: nginx_install + when: nginx_install | bool tags: base, nginx - name: Configure Apache systemd service ({{ apache_service }}) include_role: name: httpd-enable - when: apache_install + when: apache_install | bool tags: base, httpd - name: Recording STAGE 9 HAS COMPLETED ==================== diff --git a/roles/httpd/tasks/enable.yml b/roles/httpd/tasks/enable.yml index 787fca097..5bb9733a3 100644 --- a/roles/httpd/tasks/enable.yml +++ b/roles/httpd/tasks/enable.yml @@ -17,9 +17,9 @@ template: src: "{{ item.src }}" dest: "{{ item.dest }}" - owner: root - group: root - mode: 0644 + # owner: root + # group: root + # mode: 0644 with_items: - { src: 'roles/httpd/templates/010-iiab.conf.j2', dest: '/etc/{{ apache_config_dir }}/010-iiab.conf' } - { src: 'roles/httpd/templates/proxy_ajp.conf.j2', dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf' } @@ -36,12 +36,12 @@ copy: src: roles/httpd/files/osm.conf dest: "/etc/{{ apache_config_dir }}" - owner: root - group: root - mode: 0644 + # owner: root + # group: root + # mode: 0644 when: osm_vector_maps_install | bool -- name: Symlink /etc/apache2/sites-enabled/osm.conf to /etc/{{ apache_config_dir }}/osm.conf (debuntu) +- name: Symlink /etc/apache2/sites-enabled/osm.conf -> /etc/{{ apache_config_dir }}/osm.conf (debuntu) file: src: "/etc/{{ apache_config_dir }}/osm.conf" path: /etc/apache2/sites-enabled/osm.conf diff --git a/roles/nginx/tasks/uses_apache.yml b/roles/nginx/tasks/uses_apache.yml index 4818626f8..8c679b5e2 100644 --- a/roles/nginx/tasks/uses_apache.yml +++ b/roles/nginx/tasks/uses_apache.yml @@ -5,37 +5,37 @@ - name: Install {{ nginx_config_dir }}/dokuwiki-nginx.conf from template, if dokuwiki_enabled template: src: dokuwiki-nginx.conf - dest: {{ nginx_config_dir }}/dokuwiki-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/dokuwiki-nginx.conf" # /etc/nginx/conf.d when: dokuwiki_enabled | bool - name: Install {{ nginx_config_dir }}/elgg-nginx.conf from template, if elgg_enabled template: src: elgg-nginx.conf - dest: {{ nginx_config_dir }}/elgg-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/elgg-nginx.conf" # /etc/nginx/conf.d when: elgg_enabled | bool - name: Install {{ nginx_config_dir }}/lokole-nginx.conf from template, if lokole_enabled template: src: lokole-nginx.conf.j2 - dest: {{ nginx_config_dir }}/lokole-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/lokole-nginx.conf" # /etc/nginx/conf.d when: lokole_enabled | bool - name: Install {{ nginx_config_dir }}/moodle-nginx.conf from template, if moodle_enabled template: src: moodle-nginx.conf.j2 - dest: {{ nginx_config_dir }}/moodle-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/moodle-nginx.conf" # /etc/nginx/conf.d when: moodle_enabled | bool - name: Install {{ nginx_config_dir }}/nextcloud-nginx.conf from template, if nextcloud_enabled template: src: nextcloud-nginx.conf - dest: {{ nginx_config_dir }}/nextcloud-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/nextcloud-nginx.conf" # /etc/nginx/conf.d when: nextcloud_enabled | bool - name: Install {{ nginx_config_dir }}/nodered-nginx.conf from template, if nodered_enabled template: src: nodered-nginx.conf.j2 - dest: {{ nginx_config_dir }}/nodered-nginx.conf # /etc/nginx/conf.d + dest: "{{ nginx_config_dir }}/nodered-nginx.conf" # /etc/nginx/conf.d # mode: '0666' when: nodered_enabled | bool From 85e60bae0d3a1abedc4b6018945a0823c2f50b1e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 12 Jan 2020 08:34:09 -0500 Subject: [PATCH 2/3] Excess '| bool' clauses in httpd/tasks/enable.yml --- roles/httpd/tasks/enable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/httpd/tasks/enable.yml b/roles/httpd/tasks/enable.yml index 5bb9733a3..394629f04 100644 --- a/roles/httpd/tasks/enable.yml +++ b/roles/httpd/tasks/enable.yml @@ -46,7 +46,7 @@ src: "/etc/{{ apache_config_dir }}/osm.conf" path: /etc/apache2/sites-enabled/osm.conf state: link - when: is_debuntu | bool and osm_vector_maps_enabled | bool + when: is_debuntu and osm_vector_maps_enabled - name: Give {{ apache_user }} (per variable apache_user) permission to poweroff, installing /etc/sudoers.d/020_apache_poweroff from template template: From c83414feace0a1e4a9f7eebed43810cc4caf6231 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 12 Jan 2020 08:41:30 -0500 Subject: [PATCH 3/3] 'when: var | bool' per Ansible rec off of #1632 (for bare vars) --- roles/3-base-server/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index b332c0f21..162dbd60d 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -6,7 +6,7 @@ - name: HTTPD (APACHE) include_role: name: httpd - when: apache_install + when: apache_install | bool tags: base, httpd - name: MYSQL @@ -17,11 +17,11 @@ - name: Install nginx include_tasks: roles/nginx/tasks/install.yml - when: nginx_install + when: nginx_install | bool - name: Install dnsmasq include_tasks: roles/network/tasks/dnsmasq.yml - when: dnsmasq_install + when: dnsmasq_install | bool tags: base, domain, dnsmasq, network - name: Recording STAGE 3 HAS COMPLETED =====================