/
configuration.yml
60 lines (54 loc) · 1.69 KB
/
configuration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Copy the nginx configuration file
template:
src: nginx.conf.j2
dest: "{{ nginx_conf_dir }}/nginx.conf"
notify:
- restart nginx
- name: Ensure auth_basic files created
template:
src: auth_basic.j2
dest: "{{ nginx_conf_dir }}/auth_basic/{{ item.key }}"
owner: root
group: "{{ nginx_group }}"
mode: 0750
with_dict: "{{ nginx_auth_basic_files }}"
- name: Create the configurations for sites
template:
src: "{{ item.value.template | default('site.conf.j2') }}"
dest: "{{ nginx_conf_dir }}/sites-available/{{ item.key }}.conf"
with_dict: "{{ nginx_sites }}"
when: item.key not in nginx_remove_sites
notify:
- reload nginx
- name: Create links for sites-enabled
file:
state: link
src: "{{ nginx_conf_dir }}/sites-available/{{ item.key }}.conf"
dest: "{{ nginx_conf_dir }}/sites-enabled/{{ item.key }}.conf"
with_dict: "{{ nginx_sites }}"
when: item.key not in nginx_remove_sites
notify:
- reload nginx
- name: Create the configurations for independent config file
template:
src: config.conf.j2
dest: "{{ nginx_conf_dir }}/conf.d/{{ item.key }}.conf"
with_dict: "{{ nginx_configs }}"
notify:
- reload nginx
- name: Create configuration snippets
template:
src: config.conf.j2
dest: "{{ nginx_conf_dir }}/snippets/{{ item.key }}.conf"
with_dict: "{{ nginx_snippets }}"
notify:
- reload nginx
- name: Create the configurations for independent config file for streams
template:
src: config_stream.conf.j2
dest: "{{ nginx_conf_dir }}/conf.d/stream/{{ item.key }}.conf"
with_dict: "{{ nginx_stream_configs }}"
notify:
- reload nginx
when: nginx_stream_params or nginx_stream_configs