Skip to content

Commit 8094c64

Browse files
authored
Change HTML template parameters in line with similar parameters (#222)
1 parent 05cc4cf commit 8094c64

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ BREAKING CHANGES:
2323
* Check [`defaults/main/template.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/defaults/main/template.yml) and [`molecule/default/converge.yml`](https://github.com/nginxinc/ansible-role-nginx-config/blob/main/molecule/default/converge.yml) for examples!
2424
* These changes follow in the footsteps of the `http` Jinja2 refactor introduced in the `0.4.0` release. If you want more information on how to port your `stream` configurations, the release notes/changelog for `0.4.0` are a good place to start.
2525
* Replace `conf_file_name` and `conf_file_location` with `deployment_location` inside `nginx_config_stream_template`.
26+
* Replace `html_file_name` and `html_file_location` with `deployment_location` inside `nginx_config_html_demo_template`.
2627

2728
FEATURES:
2829

defaults/main/template.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
nginx_config_html_demo_template_enable: false
44
nginx_config_html_demo_template:
55
- template_file: www/index.html.j2
6-
html_file_name: index.html
7-
html_file_location: /usr/share/nginx/html
6+
deployment_location: /usr/share/nginx/html/index.html
87
web_server_name: Default
98
backup: true
109

molecule/default/converge.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,11 @@
668668
nginx_config_html_demo_template_enable: true
669669
nginx_config_html_demo_template:
670670
- template_file: www/index.html.j2
671-
html_file_name: frontend_index.html
672-
html_file_location: /usr/share/nginx/html
671+
deployment_location: /usr/share/nginx/html/frontend_index.html
673672
backup: true
674673
web_server_name: Frontend
675674
- template_file: www/index.html.j2
676-
html_file_name: backend_index.html
677-
html_file_location: /usr/share/nginx/html
675+
deployment_location: /usr/share/nginx/html/backend_index.html
678676
backup: true
679677
web_server_name: Backend
680678

molecule/plus/converge.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,10 @@
588588
nginx_config_html_demo_template_enable: true
589589
nginx_config_html_demo_template:
590590
- template_file: www/index.html.j2
591-
html_file_name: frontend_index.html
592-
html_file_location: /usr/share/nginx/html
591+
deployment_location: /usr/share/nginx/html/frontend_index.html
593592
web_server_name: Frontend
594593
- template_file: www/index.html.j2
595-
html_file_name: backend_index.html
596-
html_file_location: /usr/share/nginx/html
594+
deployment_location: /usr/share/nginx/html/backend_index.html
597595
web_server_name: Backend
598596

599597
nginx_config_stream_template_enable: true

tasks/config/template-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Ensure HTML directory exists
33
file:
4-
path: "{{ item.html_file_location | default('/usr/share/nginx/html') }}"
4+
path: "{{ item.deployment_location | default('/usr/share/nginx/html') | dirname }}"
55
state: directory
66
mode: 0755
77
loop: "{{ nginx_config_html_demo_template }}"
@@ -10,7 +10,7 @@
1010
- name: Dynamically generate HTML files
1111
template:
1212
src: "{{ item.template_file | default('www/index.html.j2') }}"
13-
dest: "{{ item.html_file_location | default('/usr/share/nginx/html') }}/{{ item.html_file_name | default('index.html') }}"
13+
dest: "{{ item.deployment_location | default('/usr/share/nginx/html/index.html') }}"
1414
backup: "{{ item.backup | default(true) }}"
1515
mode: 0644
1616
loop: "{{ nginx_config_html_demo_template }}"

0 commit comments

Comments
 (0)