File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
environments/common/inventory/group_vars/all Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 11cloud_init_output_path : " {{ lookup('env', 'APPLIANCES_ENVIRONMENT_ROOT') }}/cloud_init"
22
3+ etc_hosts_template : |
4+ 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
5+ ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
6+
7+ {% for hostname in groups['etc_hosts'] | sort -%}
8+ {{ hostvars[hostname]['ansible_host'] }} {{ hostname }}
9+ {% endfor -%}
10+
311cloud_init_userdata_etchosts :
412 module : write_files
513 group : etc_hosts
@@ -10,12 +18,7 @@ cloud_init_userdata_etchosts:
1018 permissions: "0644"
1119 owner: root:root
1220 content: |
13- 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
14- ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
15-
16- {% for hostname in groups['etc_hosts'] | sort -%}
17- {{ hostvars[hostname]['ansible_host'] }} {{ hostname }}
18- {% endfor -%}
21+ {{ etc_hosts_template | indent(width=6, first=false) }}
1922
2023cloud_init_userdata_templates_default : # provides indirection so environments could copy parts of default without having to rewrite the entire thing
2124 - " {{ cloud_init_userdata_etchosts }}"
You can’t perform that action at this time.
0 commit comments