diff options
author | Markos Chandras <mchandras@suse.de> | 2018-06-04 20:59:38 +0100 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-06-06 15:17:05 +0100 |
commit | a82590eb643383127abea5dc7320445e03d7a9c2 (patch) | |
tree | 68e7a521e90d0f3466ed34a48666fa4d256a9a17 /xci/playbooks/roles/bootstrap-host/templates/osa | |
parent | 246029cfa3b70cb3e5678a41187b214620f6d507 (diff) |
roles: bootstrap-host: Ensure DNS info from IDF is respected
We are configuring static IPs in the various nodes but we don't do
anything for DNS assuming that DNS is being configured by another
entity. However, the IDF file already contains DNS information for us
so we should use that instead. Moreover, we update the IDF file to use
the gateway as DNS instead of the Google one in order to make it more
usable on restricted networks.
Change-Id: Ieba58ec9558080a1296e204c4f99bae859e9daef
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host/templates/osa')
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 | 3 | ||||
-rw-r--r-- | xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 index 3eddce45..f9e4d8df 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j2 @@ -32,5 +32,8 @@ iface {{ item.name }} inet static {% if item.network is defined and item.network.gateway is defined %} gateway {{ item.network.gateway | ipaddr('address') }} {% endif %} +{% if item.network is defined and item.network.dns is defined %} + dns-nameservers {{ item.network.dns }} +{% endif %} {% endif %} diff --git a/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 b/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 index fa957764..3a51eb86 100644 --- a/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 +++ b/xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j2 @@ -17,3 +17,10 @@ STP=off {% if item.network is defined %} IPADDR={{ item.network.address }} {% endif %} +{% if item.network is defined and item.network.gateway is defined %} +GATEWAY="{{ host_info[inventory_hostname]['public']['gateway'] | ipaddr('address') }}" +{% endif %} +{% if item.network is defined and item.network.dns is defined %} +DNS="{{ host_info[inventory_hostname]['public']['dns'] }}" +{% endif %} +{% endif %} |