Skip to content

Commit 01d045b

Browse files
authored
Fix deployment_location directory not being created (#187)
1 parent b921b40 commit 01d045b

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ Thumbs.db
2121
# Python specific #
2222
###################
2323
__pycache__
24+
25+
# Logs #
26+
########
27+
*.log

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.4.1 (Unreleased)
4+
5+
BUG FIXES:
6+
7+
Fix issue where your `deployment_location` directory would not be properly created due to an outdated variable.
8+
39
## 0.4.0 (October 19, 2021)
410

511
This is a very **big** release which fundamentally refactors the whole NGINX configuration templating engine. Almost all of the templates have undergone some breaking changes. Please take extra caution when upgrading your environment to this release and make sure you test any required changes before using the role in any potential production environments.

molecule/default/converge.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
http:
7171
include:
7272
- /etc/nginx/conf.d/*.conf
73+
- /etc/nginx/conf.d/backend/*.conf
7374
stream:
7475
include:
7576
- /etc/nginx/conf.d/stream/*.conf
@@ -82,9 +83,7 @@
8283

8384
nginx_config_http_template_enable: true
8485
nginx_config_http_template:
85-
- template_file: http/default.conf.j2
86-
deployment_location: /etc/nginx/conf.d/default.conf
87-
config:
86+
- config:
8887
upstreams:
8988
- name: frontend_servers
9089
zone:
@@ -584,7 +583,7 @@
584583
code: 200
585584
text: molecule
586585
- template_file: http/default.conf.j2
587-
deployment_location: /etc/nginx/conf.d/backend_default.conf
586+
deployment_location: /etc/nginx/conf.d/backend/backend_default.conf
588587
config:
589588
servers:
590589
- core:

molecule/default/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
- name: Check backend_default.conf exists
4444
stat:
45-
path: /etc/nginx/conf.d/backend_default.conf
45+
path: /etc/nginx/conf.d/backend/backend_default.conf
4646
check_mode: true
4747
register: stat_result
4848
failed_when: not stat_result.stat.exists

tasks/config/template-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
- name: Ensure NGINX main directory exists
3131
file:
32-
path: "{{ nginx_config_main_template.conf_file_location | default('/etc/nginx') }}"
32+
path: "{{ nginx_config_main_template.deployment_location | default('/etc/nginx') | dirname }}"
3333
state: directory
3434
mode: 0755
3535
when: nginx_config_main_template_enable | bool
@@ -57,7 +57,7 @@
5757

5858
- name: Ensure NGINX HTTP directory exists
5959
file:
60-
path: "{{ item.conf_file_location | default('/etc/nginx/conf.d/') }}"
60+
path: "{{ item.deployment_location | default('/etc/nginx/conf.d/') | dirname }}"
6161
state: directory
6262
mode: 0755
6363
loop: "{{ nginx_config_http_template }}"

0 commit comments

Comments
 (0)