Skip to content

Commit

Permalink
specify group and mode for nginx files
Browse files Browse the repository at this point in the history
Ansible changed the default mode to 0600, which breaks nginx.

Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Oct 7, 2020
1 parent 1e9bf6f commit 3043c99
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tasks/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
template:
src: "{{ item.value.template | default(nginx_default_site_template) }}"
dest: "{{ nginx_conf_dir }}/sites-available/{{ item.key }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_dict: "{{ nginx_sites }}"
when: item.key not in nginx_remove_sites
notify:
Expand All @@ -54,6 +56,8 @@
template:
src: "{{ item.value.template | default('config.conf.j2') }}"
dest: "{{ nginx_conf_dir }}/conf.d/{{ item.key }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_dict: "{{ nginx_configs }}"
notify:
- reload nginx
Expand All @@ -62,6 +66,8 @@
template:
src: config.conf.j2
dest: "{{ nginx_conf_dir }}/snippets/{{ item.key }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_dict: "{{ nginx_snippets }}"
notify:
- reload nginx
Expand All @@ -70,6 +76,8 @@
template:
src: "{{ item.value.template | default('config_stream.conf.j2') }}"
dest: "{{ nginx_conf_dir }}/conf.d/stream/{{ item.key }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_dict: "{{ nginx_stream_configs }}"
notify:
- reload nginx
Expand All @@ -82,6 +90,8 @@
template:
src: module.conf.j2
dest: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_items: "{{ nginx_module_configs }}"
ignore_errors: "{{ ansible_check_mode }}"
notify:
Expand All @@ -95,6 +105,8 @@
state: link
src: "/usr/share/nginx/modules/{{ item }}.conf"
dest: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_items: "{{ nginx_module_configs }}"
ignore_errors: "{{ ansible_check_mode }}"
notify:
Expand All @@ -109,6 +121,8 @@
state: link
src: "/usr/share/nginx/modules-available/{{ item }}.conf"
dest: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_items: "{{ nginx_module_configs }}"
ignore_errors: "{{ ansible_check_mode }}"
notify:
Expand Down Expand Up @@ -136,6 +150,8 @@
state: link
src: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf"
dest: "{{ nginx_conf_dir }}/modules-enabled/{{ item }}.conf"
mode: 0640
group: "{{ nginx_group }}"
with_items: "{{ nginx_module_configs }}"
when: (item not in nginx_remove_modules) and (item not in nginx_disabled_modules)
ignore_errors: "{{ ansible_check_mode }}"
Expand Down

0 comments on commit 3043c99

Please sign in to comment.