Remove defaults for required vars
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
if '.' in hostname
|
||||
else (
|
||||
hostname + '.' + vm_dns_search
|
||||
if vm_dns_search | length
|
||||
if vm_dns_search is defined and vm_dns_search | length
|
||||
else hostname
|
||||
)
|
||||
}}
|
||||
@@ -49,7 +49,7 @@
|
||||
if '.' in hostname
|
||||
else (
|
||||
hostname + '.' + vm_dns_search
|
||||
if vm_dns_search | length
|
||||
if vm_dns_search is defined and vm_dns_search | length
|
||||
else hostname
|
||||
)
|
||||
}}
|
||||
@@ -57,7 +57,7 @@
|
||||
configuration_hostname_entries: >-
|
||||
{{ [configuration_hostname_fqdn, configuration_hostname_short] | unique | join(' ') }}
|
||||
configuration_hosts_line: >-
|
||||
{{ (vm_ip if vm_ip | length > 0 else inventory_hostname) }} {{ configuration_hostname_entries }}
|
||||
{{ (vm_ip if vm_ip is defined and vm_ip | length > 0 else inventory_hostname) }} {{ configuration_hostname_entries }}
|
||||
ansible.builtin.lineinfile:
|
||||
path: /mnt/etc/hosts
|
||||
line: "{{ configuration_hosts_line }}"
|
||||
|
||||
Reference in New Issue
Block a user