Skip to content

Commit df08c84

Browse files
committed
formatting
1 parent 4e720b1 commit df08c84

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

automation/roles/consul/tasks/config.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
3434
dest: "{{ config_item.dest }}"
3535
owner: "{{ consul_user }}"
3636
group: "{{ consul_group }}"
37-
content: "{{ _consul_json_config | to_nice_json }}"
37+
content: "{{ lookup('template', consul_config_template_path, convert_data=False) | from_json | to_nice_json }}"
3838
mode: "0600"
39-
vars:
40-
_consul_json_config: "{{ lookup('template', consul_config_template_path, convert_data=False) | from_json }}"
4139
loop:
4240
- dest: "{{ consul_config_path }}/config.json"
4341
config_version: "{{ consul_node_role }}"
@@ -64,10 +62,8 @@
6462
dest: "{{ consul_configd_path }}/50custom.json"
6563
owner: "{{ consul_user }}"
6664
group: "{{ consul_group }}"
67-
content: "{{ _consul_custom_config | to_nice_json }}"
65+
content: "{{ lookup('template', 'templates/configd_50custom.json.j2', convert_data=False) | from_json | to_nice_json }}"
6866
mode: "0600"
69-
vars:
70-
_consul_custom_config: "{{ lookup('template', 'templates/configd_50custom.json.j2', convert_data=False) | from_json }}"
7167
when:
7268
- consul_config_custom is defined
7369
notify:

automation/roles/consul/tasks/config_windows.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
- name: Create configuration
55
ansible.windows.win_copy:
66
dest: "{{ config_item.dest }}"
7-
content: "{{ _consul_json_config | to_nice_json }}"
8-
vars:
9-
_consul_json_config: "{{ lookup('template', consul_config_template_path, convert_data=False) | from_json }}"
7+
content: "{{ lookup('template', consul_config_template_path, convert_data=False) | from_json | to_nice_json }}"
108
loop:
119
- dest: "{{ consul_config_path }}/config.json"
1210
config_version: "{{ consul_node_role }}"
@@ -30,9 +28,7 @@
3028
- name: Create custom configuration
3129
ansible.windows.win_copy:
3230
dest: "{{ consul_configd_path }}/50custom.json"
33-
content: "{{ _consul_custom_config | to_nice_json }}"
34-
vars:
35-
_consul_custom_config: "{{ lookup('template', 'templates/configd_50custom.json.j2', convert_data=False) | from_json }}"
31+
content: "{{ lookup('template', 'templates/configd_50custom.json.j2', convert_data=False) | from_json | to_nice_json }}"
3632
when:
3733
- consul_config_custom is defined
3834
notify:

0 commit comments

Comments
 (0)