-
Notifications
You must be signed in to change notification settings - Fork 310
/
config.yml
37 lines (35 loc) · 1.12 KB
/
config.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
---
# File: config.yml - Consul configuration tasks
- name: Create configuration
copy:
dest: "{{ item.dest }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
content: "{{ lookup('template', 'templates/config.json.j2') | to_nice_json }}"
with_items:
- dest: "{{ consul_config_path }}/config.json"
config_version: "{{ consul_node_role }}"
when: true
- dest: "{{ consul_config_path }}/bootstrap.json"
config_version: bootstrap
when: "{{ consul_debug | bool }}"
- dest: "{{ consul_config_path }}/server.json"
config_version: server
when: "{{ consul_debug | bool }}"
- dest: "{{ consul_config_path }}/client.json"
config_version: client
when: "{{ consul_debug | bool }}"
when:
- item.when
notify:
- restart consul
- name: Create custom configuration
copy:
dest: "{{ consul_configd_path }}/50custom.json"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
content: "{{ lookup('template', 'templates/configd_50custom.json.j2') | to_nice_json }}"
when:
- consul_config_custom is defined
notify:
- restart consul