From 8bf17d77c0ef9bced28168cb9b985177c3689497 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Thu, 5 Apr 2018 14:32:37 -0700 Subject: [PATCH] Fix path for all HTTP/Stream *.conf files Change path in all relevant tasks to ensure that HTTP and Stream NGINX *.conf files get uploaded/created in the right directory --- tasks/conf/push-config.yml | 16 ++++++++++++++-- tasks/conf/setup-status.yml | 4 ++-- tasks/conf/template-config.yml | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tasks/conf/push-config.yml b/tasks/conf/push-config.yml index 6dd21b6..254f9b9 100644 --- a/tasks/conf/push-config.yml +++ b/tasks/conf/push-config.yml @@ -6,19 +6,31 @@ notify: "(Handler: All OSs) Reload NGINX" when: main_upload_enable +- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists" + file: + path: /etc/nginx/conf.d/http + state: directory + when: http_template_enable + - name: "(Setup: All NGINX) Upload NGINX HTTP Configuration Files" copy: src: "{{ item }}" - dest: /etc/nginx/conf.d/ + dest: /etc/nginx/conf.d/http with_fileglob: - "{{ http_upload_location }}" notify: "(Handler: All OSs) Reload NGINX" when: http_upload_enable +- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists" + file: + path: /etc/nginx/conf.d/stream + state: directory + when: stream_template_enable + - name: "(Setup: All NGINX) Upload NGINX Stream Configuration Files" copy: src: "{{ item }}" - dest: /etc/nginx/conf.d/ + dest: /etc/nginx/conf.d/stream with_fileglob: - "{{ stream_upload_location }}" notify: "(Handler: All OSs) Reload NGINX" diff --git a/tasks/conf/setup-status.yml b/tasks/conf/setup-status.yml index c8258e9..1b1a4a9 100644 --- a/tasks/conf/setup-status.yml +++ b/tasks/conf/setup-status.yml @@ -1,7 +1,7 @@ --- - name: "(Setup: Open Source NGINX) Enable Open Source NGINX Status" blockinfile: - path: /etc/nginx/conf.d/stub_status.conf + path: "{{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/stub_status.conf','/etc/nginx/conf.d/stub_status.conf') }}" create: yes block: | server { @@ -17,7 +17,7 @@ - name: "(Setup: NGINX Plus) Enable NGINX Plus Status" blockinfile: - path: /etc/nginx/conf.d/status.conf + path: "{{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/status.conf','/etc/nginx/conf.d/status.conf') }}" create: yes block: | server { diff --git a/tasks/conf/template-config.yml b/tasks/conf/template-config.yml index e34ae53..1c51b52 100644 --- a/tasks/conf/template-config.yml +++ b/tasks/conf/template-config.yml @@ -5,7 +5,7 @@ dest: /etc/nginx/nginx.conf notify: "(Handler: All OSs) Reload NGINX" -- name: "(Setup: All NGINX) Ensures /etc/nginx/conf.d/http dir exists" +- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists" file: path: /etc/nginx/conf.d/http state: directory @@ -20,7 +20,7 @@ when: http_template_enable notify: "(Handler: All OSs) Reload NGINX" -- name: "(Setup: All NGINX) Ensures /etc/nginx/conf.d/stream dir exists" +- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists" file: path: /etc/nginx/conf.d/stream state: directory