Skip to content

Commit

Permalink
facts: fix deployments with different net interface names
Browse files Browse the repository at this point in the history
Deployments when radosgws don't have the same names for
network interface.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2095605

Signed-off-by: Guillaume Abrioux <[email protected]>
(cherry picked from commit f6b49f7)
  • Loading branch information
guits committed Jul 6, 2022
1 parent f5020f6 commit ab9e8ae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions roles/ceph-facts/tasks/set_radosgw_address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,24 @@
block:
- name: set_fact _interface
set_fact:
_interface: "{{ (radosgw_interface | replace('-', '_')) }}"
_interface: "{{ (hostvars[item]['radosgw_interface'] | replace('-', '_')) }}"
loop: "{{ groups.get(rgw_group_name, []) }}"
delegate_to: "{{ item }}"
delegate_facts: true
run_once: true

- name: set_fact _radosgw_address to radosgw_interface - ipv4
set_fact:
_radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version]['address'] }}"
_radosgw_address: "{{ hostvars[item]['ansible_facts'][hostvars[item]['_interface']][ip_version]['address'] }}"
loop: "{{ groups.get(rgw_group_name, []) }}"
delegate_to: "{{ item }}"
delegate_facts: true
when: ip_version == 'ipv4'


- name: set_fact _radosgw_address to radosgw_interface - ipv6
set_fact:
_radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version][0]['address'] | ansible.utils.ipwrap }}"
_radosgw_address: "{{ hostvars[item]['ansible_facts'][hostvars[item]['_interface']][ip_version][0]['address'] | ansible.utils.ipwrap }}"
loop: "{{ groups.get(rgw_group_name, []) }}"
delegate_to: "{{ item }}"
delegate_facts: true
Expand Down

0 comments on commit ab9e8ae

Please sign in to comment.