kolla-ansible/ansible/roles/prechecks/tasks/port_checks.yml
Jeffrey Zhang 47762d4850 Fix the failure when running precheck after deploy
* Move the tasks to the role
* Skip the task when container is already running

Change-Id: I1990d4dd2a02efa2b3766329000aa23419e0ff17
Closes-Bug: #1670286
2017-03-07 06:57:16 +00:00

17 lines
942 B
YAML

---
- name: Checking the api_interface is present
fail: "msg='Please check the api_interface property - interface {{ api_interface }} not found'"
when: api_interface not in ansible_interfaces
- name: Checking the api_interface is active
fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'"
when: hostvars[inventory_hostname]['ansible_' + api_interface]['active'] != True
- name: Checking the api_interface configuration
fail: "msg='Please check the api_interface settings - interface {{ api_interface }} configuration missing'"
when: hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4'] is not defined
- name: Checking the api_interface ip address configuration
fail: "msg='Please check the api_interface settings - interface {{ api_interface }} ip address problem'"
when: hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] is not defined