Skip to content

Commit

Permalink
Check if ansible_all_ipv4_addresses exist before using it
Browse files Browse the repository at this point in the history
For Windows host ansible doesn't gather fact ansible_all_ipv4_addresses,
it just gathers ansible_all_addresses.
While setting configdbnode fq name for rabbitmq, we just ommit hosts,
that doesn't have ansible_all_ipv4_addresses, because they cannot be
deployed on Windows nodes.

Change-Id: I4fad441ddcb52ca993cb8af1dd8f65f0725c2011
Closes-Bug: #1800448
  • Loading branch information
jacekchalupka committed Oct 29, 2018
1 parent 1314bf4 commit 8eb7fda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion playbooks/roles/instance/tasks/install_software_Linux.yml
Expand Up @@ -68,6 +68,7 @@
when:
- contrail_configuration.CONTROLLER_NODES is defined
- provider_data.domainsuffix is defined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file for rabbitmq with domain suffix when provided"
Expand All @@ -78,6 +79,7 @@
when:
- contrail_configuration.CONFIGDB_NODES is defined
- provider_data.domainsuffix is defined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file for rabbitmq with domain suffix"
Expand All @@ -89,6 +91,7 @@
- contrail_configuration.CONTROLLER_NODES is defined
- provider_data.domainsuffix is undefined
- hostvars[item.1]['ansible_fqdn'] is defined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file for rabbitmq with domain suffix"
Expand All @@ -100,6 +103,7 @@
- contrail_configuration.CONFIGDB_NODES is defined
- provider_data.domainsuffix is undefined
- hostvars[item.1]['ansible_fqdn'] is defined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file for rabbitmq without domain suffix"
Expand All @@ -111,6 +115,7 @@
- contrail_configuration.CONTROLLER_NODES is defined
- provider_data.domainsuffix is undefined
- hostvars[item.1]['ansible_fqdn'] is undefined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file for rabbitmq without domain suffix"
Expand All @@ -122,6 +127,7 @@
- contrail_configuration.CONFIGDB_NODES is defined
- provider_data.domainsuffix is undefined
- hostvars[item.1]['ansible_fqdn'] is undefined
- hostvars[item.1].ansible_all_ipv4_addresses is defined
- item.0 in hostvars[item.1].ansible_all_ipv4_addresses

- name: "Build hosts file with domain suffix when provided"
Expand Down Expand Up @@ -227,4 +233,3 @@
- name: accept forward
shell: iptables -P FORWARD ACCEPT
ignore_errors: yes

0 comments on commit 8eb7fda

Please sign in to comment.