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
This commit is contained in:
Alessandro Fael Garcia 2018-04-05 14:32:37 -07:00
parent fb36b5b643
commit 8bf17d77c0
3 changed files with 18 additions and 6 deletions

View File

@ -6,19 +6,31 @@
notify: "(Handler: All OSs) Reload NGINX" notify: "(Handler: All OSs) Reload NGINX"
when: main_upload_enable 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" - name: "(Setup: All NGINX) Upload NGINX HTTP Configuration Files"
copy: copy:
src: "{{ item }}" src: "{{ item }}"
dest: /etc/nginx/conf.d/ dest: /etc/nginx/conf.d/http
with_fileglob: with_fileglob:
- "{{ http_upload_location }}" - "{{ http_upload_location }}"
notify: "(Handler: All OSs) Reload NGINX" notify: "(Handler: All OSs) Reload NGINX"
when: http_upload_enable 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" - name: "(Setup: All NGINX) Upload NGINX Stream Configuration Files"
copy: copy:
src: "{{ item }}" src: "{{ item }}"
dest: /etc/nginx/conf.d/ dest: /etc/nginx/conf.d/stream
with_fileglob: with_fileglob:
- "{{ stream_upload_location }}" - "{{ stream_upload_location }}"
notify: "(Handler: All OSs) Reload NGINX" notify: "(Handler: All OSs) Reload NGINX"

View File

@ -1,7 +1,7 @@
--- ---
- name: "(Setup: Open Source NGINX) Enable Open Source NGINX Status" - name: "(Setup: Open Source NGINX) Enable Open Source NGINX Status"
blockinfile: 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 create: yes
block: | block: |
server { server {
@ -17,7 +17,7 @@
- name: "(Setup: NGINX Plus) Enable NGINX Plus Status" - name: "(Setup: NGINX Plus) Enable NGINX Plus Status"
blockinfile: 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 create: yes
block: | block: |
server { server {

View File

@ -5,7 +5,7 @@
dest: /etc/nginx/nginx.conf dest: /etc/nginx/nginx.conf
notify: "(Handler: All OSs) Reload NGINX" 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: file:
path: /etc/nginx/conf.d/http path: /etc/nginx/conf.d/http
state: directory state: directory
@ -20,7 +20,7 @@
when: http_template_enable when: http_template_enable
notify: "(Handler: All OSs) Reload NGINX" 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: file:
path: /etc/nginx/conf.d/stream path: /etc/nginx/conf.d/stream
state: directory state: directory