Merge "Refactor NSS database var"

This commit is contained in:
Zuul 2019-10-18 03:38:34 +00:00 committed by Gerrit Code Review
commit bcbcee90d0
2 changed files with 6 additions and 24 deletions

View File

@ -17,19 +17,9 @@
- container_facts['qdrouterd'] is not defined
- inventory_hostname in groups['qdrouterd']
- name: Set NSS database for IPv4
set_fact:
nss_database: 'ahostsv4'
when:
- api_address_family == 'ipv4'
- name: Set NSS database for IPv6
set_fact:
nss_database: 'ahostsv6'
when:
- api_address_family == 'ipv6'
- name: Check if all qdrouterd hostnames are resolvable
vars:
nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}"
command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: qdrouterd_hostnames

View File

@ -51,19 +51,9 @@
- container_facts['rabbitmq'] is not defined
- inventory_hostname in groups['rabbitmq']
- name: Set NSS database for IPv4
set_fact:
nss_database: 'ahostsv4'
when:
- api_address_family == 'ipv4'
- name: Set NSS database for IPv6
set_fact:
nss_database: 'ahostsv6'
when:
- api_address_family == 'ipv6'
- name: Check if all rabbit hostnames are resolvable
vars:
nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}"
command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: rabbitmq_hostnames
@ -119,6 +109,8 @@
- container_facts['outward_rabbitmq'] is not defined
- name: Check if all outward rabbit hostnames are resolvable
vars:
nss_database: "{{ 'ahostsv4' if api_address_family == 'ipv4' else 'ahostsv6' }}"
command: "getent {{ nss_database }} {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: outward_rabbitmq_hostnames