Skip to content

Commit c9dd9a0

Browse files
committed
switch to ansible.netcommon.ipwrap
As of 2.10, Ansible moved ipwrap to netcommon collection. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
1 parent 62af15c commit c9dd9a0

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

group_vars/all.yml.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ dummy:
752752
# For example:
753753
# If the ceph public network is 2a00:8a60:1:c301::/64 and the iSCSI Gateway resides
754754
# at a dedicated gateway network (2a00:8a60:1:c300::/64) (With routing between those networks).
755-
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" will be empty.
755+
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ansible.netcommon.ipwrap }}" will be empty.
756756
# As a consequence, this prevent from deploying dashboard with iSCSI node when it reside in a subnet different than `public_network`.
757757
# Using `igw_network` make it possible, set it with the subnet used by your iSCSI node.
758758
#igw_network: "{{ public_network }}"

group_vars/rhcs.yml.sample

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ alertmanager_container_image: registry.redhat.io/openshift4/ose-prometheus-alert
752752
# For example:
753753
# If the ceph public network is 2a00:8a60:1:c301::/64 and the iSCSI Gateway resides
754754
# at a dedicated gateway network (2a00:8a60:1:c300::/64) (With routing between those networks).
755-
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" will be empty.
755+
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ansible.netcommon.ipwrap }}" will be empty.
756756
# As a consequence, this prevent from deploying dashboard with iSCSI node when it reside in a subnet different than `public_network`.
757757
# Using `igw_network` make it possible, set it with the subnet used by your iSCSI node.
758758
#igw_network: "{{ public_network }}"

infrastructure-playbooks/cephadm-adopt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@
375375
when: ip_version == 'ipv4'
376376

377377
- name: manage nodes with cephadm - ipv6
378-
command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['all_ipv6_addresses'] | ips_in_ranges(cephadm_mgmt_network.split(',')) | last | ipwrap }} {{ group_names | intersect(adopt_label_group_names) | join(' ') }}"
378+
command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['all_ipv6_addresses'] | ips_in_ranges(cephadm_mgmt_network.split(',')) | last | ansible.netcommon.ipwrap }} {{ group_names | intersect(adopt_label_group_names) | join(' ') }}"
379379
changed_when: false
380380
delegate_to: '{{ groups[mon_group_name][0] }}'
381381
when: ip_version == 'ipv6'

infrastructure-playbooks/cephadm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
when: ip_version == 'ipv4'
250250

251251
- name: manage nodes with cephadm - ipv6
252-
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch host add {{ ansible_facts['hostname'] }} {{ ansible_facts['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }} {{ group_names | join(' ') }} {{ '_admin' if mon_group_name | default('mons') in group_names else '' }}"
252+
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch host add {{ ansible_facts['hostname'] }} {{ ansible_facts['all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ansible.netcommon.ipwrap }} {{ group_names | join(' ') }} {{ '_admin' if mon_group_name | default('mons') in group_names else '' }}"
253253
changed_when: false
254254
delegate_to: '{{ groups[mon_group_name][0] }}'
255255
environment:

roles/ceph-dashboard/tasks/configure_dashboard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
- name: add iscsi gateways - ipv6
369369
command: "{{ ceph_cmd }} --cluster {{ cluster }} dashboard iscsi-gateway-add -i -"
370370
args:
371-
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(igw_network.split(',')) | last | ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
371+
stdin: "{{ 'https' if hostvars[item]['api_secure'] | default(false) | bool else 'http' }}://{{ hostvars[item]['api_user'] | default('admin') }}:{{ hostvars[item]['api_password'] | default('admin') }}@{{ hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(igw_network.split(',')) | last | ansible.netcommon.ipwrap }}:{{ hostvars[item]['api_port'] | default(5000) }}"
372372
stdin_add_newline: no
373373
changed_when: false
374374
delegate_to: "{{ groups[mon_group_name][0] }}"

roles/ceph-defaults/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ alertmanager_dashboard_api_no_ssl_verify: "{{ true if dashboard_protocol == 'htt
744744
# For example:
745745
# If the ceph public network is 2a00:8a60:1:c301::/64 and the iSCSI Gateway resides
746746
# at a dedicated gateway network (2a00:8a60:1:c300::/64) (With routing between those networks).
747-
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}" will be empty.
747+
# It means "{{ hostvars[item]['ansible_facts']['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | last | ansible.netcommon.ipwrap }}" will be empty.
748748
# As a consequence, this prevent from deploying dashboard with iSCSI node when it reside in a subnet different than `public_network`.
749749
# Using `igw_network` make it possible, set it with the subnet used by your iSCSI node.
750750
igw_network: "{{ public_network }}"

roles/ceph-facts/tasks/grafana.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
- name: set grafana_server_addr fact - ipv6
1111
set_fact:
12-
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ipwrap }}"
12+
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ansible.netcommon.ipwrap }}"
1313
when:
1414
- groups.get(monitoring_group_name, []) | length > 0
1515
- ip_version == 'ipv6'
@@ -27,7 +27,7 @@
2727

2828
- name: set grafana_server_addrs fact - ipv6
2929
set_fact:
30-
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ipwrap]) | unique }}"
30+
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(grafana_network.split(',')) | last | ansible.netcommon.ipwrap]) | unique }}"
3131
with_items: "{{ groups.get(monitoring_group_name, []) }}"
3232
when:
3333
- groups.get(monitoring_group_name, []) | length > 0

roles/ceph-facts/tasks/set_monitor_address.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- name: set_fact _monitor_addresses to monitor_address_block ipv6
1313
set_fact:
14-
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | last | ipwrap }] }}"
14+
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[item]['monitor_address_block'].split(',')) | last | ansible.netcommon.ipwrap }] }}"
1515
with_items: "{{ groups.get(mon_group_name, []) }}"
1616
when:
1717
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
@@ -21,7 +21,7 @@
2121

2222
- name: set_fact _monitor_addresses to monitor_address
2323
set_fact:
24-
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['monitor_address'] | ipwrap}] }}"
24+
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['monitor_address'] | ansible.netcommon.ipwrap}] }}"
2525
with_items: "{{ groups.get(mon_group_name, []) }}"
2626
when:
2727
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
@@ -30,7 +30,7 @@
3030

3131
- name: set_fact _monitor_addresses to monitor_interface - ipv4
3232
set_fact:
33-
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version]['address'] | ipwrap }] }}"
33+
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version]['address'] | ansible.netcommon.ipwrap }] }}"
3434
with_items: "{{ groups.get(mon_group_name, []) }}"
3535
when:
3636
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
@@ -41,7 +41,7 @@
4141

4242
- name: set_fact _monitor_addresses to monitor_interface - ipv6
4343
set_fact:
44-
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version][0]['address'] | ipwrap }] }}"
44+
_monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_facts'][(hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version][0]['address'] | ansible.netcommon.ipwrap }] }}"
4545
with_items: "{{ groups.get(mon_group_name, []) }}"
4646
when:
4747
- "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"

roles/ceph-facts/tasks/set_radosgw_address.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
- name: set_fact _radosgw_address to radosgw_address_block ipv6
2020
set_fact:
21-
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ipwrap }}"
21+
_radosgw_address: "{{ hostvars[inventory_hostname]['ansible_facts']['all_ipv6_addresses'] | ips_in_ranges(hostvars[inventory_hostname]['radosgw_address_block'].split(',')) | last | ansible.netcommon.ipwrap }}"
2222
when:
2323
- radosgw_address_block is defined
2424
- radosgw_address_block != 'subnet'
2525
- ip_version == 'ipv6'
2626

2727
- name: set_fact _radosgw_address to radosgw_address
2828
set_fact:
29-
_radosgw_address: "{{ radosgw_address | ipwrap }}"
29+
_radosgw_address: "{{ radosgw_address | ansible.netcommon.ipwrap }}"
3030
when:
3131
- radosgw_address is defined
3232
- radosgw_address != 'x.x.x.x'
@@ -53,7 +53,7 @@
5353

5454
- name: set_fact _radosgw_address to radosgw_interface - ipv6
5555
set_fact:
56-
_radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version][0]['address'] | ipwrap }}"
56+
_radosgw_address: "{{ hostvars[item]['ansible_facts'][_interface][ip_version][0]['address'] | ansible.netcommon.ipwrap }}"
5757
loop: "{{ groups.get(rgw_group_name, []) }}"
5858
delegate_to: "{{ item }}"
5959
delegate_facts: true

0 commit comments

Comments
 (0)