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]>
  • Loading branch information
guits committed Jul 5, 2022
1 parent e223630 commit f6b49f7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions roles/ceph-facts/tasks/set_radosgw_address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,26 @@
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[inventory_hostname]['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[inventory_hostname]['ansible_facts'][_interface][ip_version][0]['address'] | ansible.utils.ipwrap }}"
_radosgw_address: "{{ hostvars[item]['ansible_facts'][hostvars[item]['_interface']][ip_version][0]['address'] | ipwrap }}"
loop: "{{ groups.get(rgw_group_name, []) }}"
delegate_to: "{{ item }}"
delegate_facts: true
when: ip_version == 'ipv6'

- name: set_fact rgw_instances without rgw multisite
Expand Down

0 comments on commit f6b49f7

Please sign in to comment.