Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Remove parameters deprecated in release `0.4.0`. To recap, these are `nginx_conf

FEATURES:

Add `backup` variable to template and upload parameters. Set to `false` if you don't want to keep backups of your previous NGINX config files.
* Add `backup` variable to template and upload parameters. Set to `false` if you don't want to keep backups of your previous NGINX config files.
* Automatically create a NGINX `client_body_temp_path` directory if your NGINX config uses the directive.

BUG FIXES:

Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
client_body_in_file_only: false
client_body_in_single_buffer: false
client_body_temp_path:
path: /var/cache/nginx
path: /var/cache/nginx/client
level: 2
client_body_timeout: 60s
client_header_buffer_size: 1k
Expand Down
14 changes: 14 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
register: this
failed_when: "'Hello World' not in this.content"

- name: Check client body cache directory exists
stat:
path: /var/cache/nginx/client
check_mode: true
register: stat_result
failed_when: not stat_result.stat.exists

- name: Check proxy cache directory exists
stat:
path: /var/cache/nginx/proxy
check_mode: true
register: stat_result
failed_when: not stat_result.stat.exists

- name: Check default.conf exists
stat:
path: /etc/nginx/conf.d/default.conf
Expand Down
14 changes: 13 additions & 1 deletion tasks/config/template-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
when: nginx_config_main_template_enable | bool
notify: (Handler - NGINX Config) Run NGINX

- name: Ensure NGINX client body cache directories exist
file:
path: "{{ item.config.core.client_body_temp_path.path }}"
state: directory
owner: "{{ nginx_config_main_template.user | default('nginx') }}"
mode: 0755
loop:
"{{ nginx_config_http_template }}"
when:
- nginx_config_http_template_enable | bool
- item.config.core.client_body_temp_path.path is defined

- name: Ensure NGINX proxy cache directories exist
file:
path: "{{ item.1.path }}"
Expand All @@ -53,7 +65,7 @@
- "{{ nginx_config_http_template }}"
- config.proxy.cache_path
- skip_missing: true
when: nginx_config_main_template_enable | bool
when: nginx_config_http_template_enable | bool

- name: Ensure NGINX HTTP directory exists
file:
Expand Down