summaryrefslogtreecommitdiffstats
path: root/xci
diff options
context:
space:
mode:
Diffstat (limited to 'xci')
-rw-r--r--xci/playbooks/bootstrap-bifrost.yml (renamed from xci/playbooks/provision-vm-nodes.yml)0
-rw-r--r--xci/playbooks/roles/configure-network/tasks/main.yml41
-rwxr-xr-xxci/xci-deploy.sh2
3 files changed, 36 insertions, 7 deletions
diff --git a/xci/playbooks/provision-vm-nodes.yml b/xci/playbooks/bootstrap-bifrost.yml
index 8b8bb30d..8b8bb30d 100644
--- a/xci/playbooks/provision-vm-nodes.yml
+++ b/xci/playbooks/bootstrap-bifrost.yml
diff --git a/xci/playbooks/roles/configure-network/tasks/main.yml b/xci/playbooks/roles/configure-network/tasks/main.yml
index adcb8669..21f213cb 100644
--- a/xci/playbooks/roles/configure-network/tasks/main.yml
+++ b/xci/playbooks/roles/configure-network/tasks/main.yml
@@ -12,6 +12,19 @@
path: "/etc/udev/rules.d/99-glean.rules"
state: absent
+- name: Determine required packages
+ set_fact:
+ network_packages:
+ - bridge-utils
+ - "{{ (ansible_pkg_mgr in ['zypper', 'apt']) | ternary('iproute2', 'iproute') }}"
+ - "{{ (ansible_pkg_mgr == 'apt') | ternary('vlan', '') }}"
+ - iptables
+
+- name: Ensure networking packages are present
+ package:
+ name: "{{ network_packages }}"
+ state: present
+
- block:
- name: configure modules
lineinfile:
@@ -31,6 +44,8 @@
dest: "/etc/network/interfaces"
- name: restart network service
shell: "/sbin/ifconfig {{ ansible_default_ipv4.interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a"
+ async: 15
+ poll: 0
when: ansible_os_family | lower == "debian"
- block:
@@ -68,9 +83,12 @@
dest: "/etc/sysconfig/network/ifroute-{{ item.name }}"
with_items:
- { name: "br-vlan", gateway: "192.168.122.1", route: "default" }
-
- name: restart network service
- shell: "/usr/sbin/wicked ifreload all"
+ service:
+ name: network
+ state: restarted
+ async: 15
+ poll: 0
when: ansible_os_family | lower == "suse"
- block:
@@ -96,8 +114,19 @@
lineinfile:
path: "/etc/sysconfig/network-scripts/ifcfg-br-vlan"
line: "GATEWAY=192.168.122.1"
- - name: Restart networking
- command: "systemctl restart network"
- - name: wait for the server to come back
- wait_for_connection:
+ - name: restart network service
+ service:
+ name: network
+ state: restarted
+ async: 15
+ poll: 0
when: ansible_os_family | lower == "redhat"
+
+- local_action:
+ module: wait_for
+ host: "{{ ansible_host }}"
+ delay: 15
+ state: started
+ port: 22
+ connect_timeout: 10
+ timeout: 180
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index c336be15..85a04fc4 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -137,7 +137,7 @@ sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
cd $XCI_PATH/bifrost/
sudo -E bash ./scripts/destroy-env.sh
cd $XCI_PLAYBOOKS
-ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory provision-vm-nodes.yml
+ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory bootstrap-bifrost.yml
cd ${XCI_CACHE}/repos/bifrost
bash ./scripts/bifrost-provision.sh
echo "-----------------------------------------------------------------------"