Skip to content

Commit 8bf17d7

Browse files
committed
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
1 parent fb36b5b commit 8bf17d7

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

tasks/conf/push-config.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,31 @@
66
notify: "(Handler: All OSs) Reload NGINX"
77
when: main_upload_enable
88

9+
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
10+
file:
11+
path: /etc/nginx/conf.d/http
12+
state: directory
13+
when: http_template_enable
14+
915
- name: "(Setup: All NGINX) Upload NGINX HTTP Configuration Files"
1016
copy:
1117
src: "{{ item }}"
12-
dest: /etc/nginx/conf.d/
18+
dest: /etc/nginx/conf.d/http
1319
with_fileglob:
1420
- "{{ http_upload_location }}"
1521
notify: "(Handler: All OSs) Reload NGINX"
1622
when: http_upload_enable
1723

24+
- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists"
25+
file:
26+
path: /etc/nginx/conf.d/stream
27+
state: directory
28+
when: stream_template_enable
29+
1830
- name: "(Setup: All NGINX) Upload NGINX Stream Configuration Files"
1931
copy:
2032
src: "{{ item }}"
21-
dest: /etc/nginx/conf.d/
33+
dest: /etc/nginx/conf.d/stream
2234
with_fileglob:
2335
- "{{ stream_upload_location }}"
2436
notify: "(Handler: All OSs) Reload NGINX"

tasks/conf/setup-status.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: "(Setup: Open Source NGINX) Enable Open Source NGINX Status"
33
blockinfile:
4-
path: /etc/nginx/conf.d/stub_status.conf
4+
path: "{{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/stub_status.conf','/etc/nginx/conf.d/stub_status.conf') }}"
55
create: yes
66
block: |
77
server {
@@ -17,7 +17,7 @@
1717

1818
- name: "(Setup: NGINX Plus) Enable NGINX Plus Status"
1919
blockinfile:
20-
path: /etc/nginx/conf.d/status.conf
20+
path: "{{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/status.conf','/etc/nginx/conf.d/status.conf') }}"
2121
create: yes
2222
block: |
2323
server {

tasks/conf/template-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
dest: /etc/nginx/nginx.conf
66
notify: "(Handler: All OSs) Reload NGINX"
77

8-
- name: "(Setup: All NGINX) Ensures /etc/nginx/conf.d/http dir exists"
8+
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
99
file:
1010
path: /etc/nginx/conf.d/http
1111
state: directory
@@ -20,7 +20,7 @@
2020
when: http_template_enable
2121
notify: "(Handler: All OSs) Reload NGINX"
2222

23-
- name: "(Setup: All NGINX) Ensures /etc/nginx/conf.d/stream dir exists"
23+
- name: "(Setup: All NGINX) Ensure NGINX Stream Directory Exists"
2424
file:
2525
path: /etc/nginx/conf.d/stream
2626
state: directory

0 commit comments

Comments
 (0)