aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bourke <paul.bourke@oracle.com>2016-08-15 14:59:58 +0000
committerPaul Bourke <paul.bourke@oracle.com>2016-08-19 09:39:50 +0000
commita01b803b53bd77dcbae57e9f7647442a3e6e3f0f (patch)
tree7034dfc0fca33704a411f1739ec563195a830a8e
parent6ea99983fcaf13f90efff1c20a3aa20db0af92ba (diff)
downloadkolla-a01b803b53bd77dcbae57e9f7647442a3e6e3f0f.tar.gz
kolla-a01b803b53bd77dcbae57e9f7647442a3e6e3f0f.zip
Add basic checking for network_interface to prechecks
Add the following prechecks for network_interface: * Check it exists on the node * Check its up * Check it has an IP associated TrivialFix Change-Id: I86f1d79d8592a3b108822e7d19541f91a1c0d716 Co-Authored-By: James McCarthy <james.m.mccarthy@oracle.com>
-rw-r--r--ansible/roles/prechecks/tasks/port_checks.yml16
-rw-r--r--releasenotes/notes/add-network-interface-checks-0e789f3f93cbdb09.yaml3
2 files changed, 19 insertions, 0 deletions
diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml
index 401cd2368..7f8724aae 100644
--- a/ansible/roles/prechecks/tasks/port_checks.yml
+++ b/ansible/roles/prechecks/tasks/port_checks.yml
@@ -448,3 +448,19 @@
failed_when: "'169.254.' not in kolla_internal_vip_address and \
kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none"
when: enable_haproxy | bool
+
+- name: Checking the network_interface is present
+ fail: "msg='Please check the network_interface property - interface {{ network_interface }} not found'"
+ when: network_interface not in ansible_interfaces
+
+- name: Checking the network_interface is active
+ fail: "msg='Please check the network_interface settings - interface {{ network_interface }} is not active'"
+ when: hostvars[inventory_hostname]['ansible_' + network_interface]['active'] != True
+
+- name: Checking the network_interface configuration
+ fail: "msg='Please check the network_interface settings - interface {{ network_interface }} configuration missing'"
+ when: hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4'] is not defined
+
+- name: Checking the network_interface ip address configuration
+ fail: "msg='Please check the network_interface settings - interface {{ network_interface }} ip address problem'"
+ when: hostvars[inventory_hostname]['ansible_' + network_interface]['ipv4']['address'] is not defined
diff --git a/releasenotes/notes/add-network-interface-checks-0e789f3f93cbdb09.yaml b/releasenotes/notes/add-network-interface-checks-0e789f3f93cbdb09.yaml
new file mode 100644
index 000000000..3232fb518
--- /dev/null
+++ b/releasenotes/notes/add-network-interface-checks-0e789f3f93cbdb09.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Add some extra prechecks to ensure a sane NIC config.