summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/bootstrap-host
diff options
context:
space:
mode:
Diffstat (limited to 'xci/playbooks/roles/bootstrap-host')
-rw-r--r--xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml5
-rw-r--r--xci/playbooks/roles/bootstrap-host/tasks/network_suse.yml8
-rw-r--r--xci/playbooks/roles/bootstrap-host/templates/osa/debian.interface.j23
-rw-r--r--xci/playbooks/roles/bootstrap-host/templates/osa/redhat.interface.j27
4 files changed, 18 insertions, 5 deletions
diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml b/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
index b06a8695..c360f15d 100644
--- a/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
+++ b/xci/playbooks/roles/bootstrap-host/tasks/network_redhat.yml
@@ -24,11 +24,6 @@
loop_control:
label: "{{ item.name }}"
-- name: Add default route through br-vlan
- lineinfile:
- path: "/etc/sysconfig/network-scripts/ifcfg-br-vlan"
- line: "GATEWAY={{ host_info[inventory_hostname]['public']['gateway'] | ipaddr('address') }}"
-
- name: restart network service
service:
name: network
diff --git a/xci/playbooks/roles/bootstrap-host/tasks/network_suse.yml b/xci/playbooks/roles/bootstrap-host/tasks/network_suse.yml
index c9c9d83c..e2b5aa4a 100644
--- a/xci/playbooks/roles/bootstrap-host/tasks/network_suse.yml
+++ b/xci/playbooks/roles/bootstrap-host/tasks/network_suse.yml
@@ -30,6 +30,14 @@
dest: "/etc/sysconfig/network/scripts/network-config-suse"
mode: 0755
+- name: Configure static DNS on SUSE
+ lineinfile:
+ regexp: '^NETCONFIG_DNS_STATIC_SERVERS=.*'
+ line: "NETCONFIG_DNS_STATIC_SERVERS={{ host_info[inventory_hostname]['public']['dns'] }}"
+ path: "/etc/sysconfig/network/config"
+ state: present
+ when: host_info[inventory_hostname]['public']['dns'] is defined
+
- name: Configure routes on SUSE
template:
src: "{{ installer_type }}/{{ ansible_os_family | lower }}.routes.j2"
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 %}