Skip to content

Commit 5618405

Browse files
committedMar 4, 2022
adopt: fix node labelling
When using group of group, the playbook will apply undesired labels on nodes. This commit fixes it by applying only the expected labels. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2057528 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 266b6e7)
1 parent be24105 commit 5618405

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed
 

‎group_vars/all.yml.sample

+12
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ dummy:
5656
#mgr_group_name: mgrs
5757
#rgwloadbalancer_group_name: rgwloadbalancers
5858
#grafana_server_group_name: grafana-server
59+
#adopt_label_group_names:
60+
# - "{{ mon_group_name }}"
61+
# - "{{ osd_group_name }}"
62+
# - "{{ rgw_group_name }}"
63+
# - "{{ mds_group_name }}"
64+
# - "{{ nfs_group_name }}"
65+
# - "{{ rbdmirror_group_name }}"
66+
# - "{{ client_group_name }}"
67+
# - "{{ iscsi_gw_group_name }}"
68+
# - "{{ mgr_group_name }}"
69+
# - "{{ rgwloadbalancer_group_name }}"
70+
# - "{{ grafana_server_group_name }}"
5971

6072
# If configure_firewall is true, then ansible will try to configure the
6173
# appropriate firewalling rules so that Ceph daemons can communicate

‎group_vars/rhcs.yml.sample

+12
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ dummy:
5656
#mgr_group_name: mgrs
5757
#rgwloadbalancer_group_name: rgwloadbalancers
5858
#grafana_server_group_name: grafana-server
59+
#adopt_label_group_names:
60+
# - "{{ mon_group_name }}"
61+
# - "{{ osd_group_name }}"
62+
# - "{{ rgw_group_name }}"
63+
# - "{{ mds_group_name }}"
64+
# - "{{ nfs_group_name }}"
65+
# - "{{ rbdmirror_group_name }}"
66+
# - "{{ client_group_name }}"
67+
# - "{{ iscsi_gw_group_name }}"
68+
# - "{{ mgr_group_name }}"
69+
# - "{{ rgwloadbalancer_group_name }}"
70+
# - "{{ grafana_server_group_name }}"
5971

6072
# If configure_firewall is true, then ansible will try to configure the
6173
# appropriate firewalling rules so that Ceph daemons can communicate

‎infrastructure-playbooks/cephadm-adopt.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@
325325
when: is_hci | bool
326326

327327
- name: manage nodes with cephadm - ipv4
328-
command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['all_ipv4_addresses'] | ips_in_ranges(cephadm_mgmt_network.split(',')) | first }} {{ group_names | join(' ') }}"
328+
command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['all_ipv4_addresses'] | ips_in_ranges(cephadm_mgmt_network.split(',')) | first }} {{ group_names | intersect(adopt_label_group_names) | join(' ') }}"
329329
changed_when: false
330330
delegate_to: '{{ groups[mon_group_name][0] }}'
331331
when: ip_version == 'ipv4'
332332

333333
- name: manage nodes with cephadm - ipv6
334-
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 | join(' ') }}"
334+
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(' ') }}"
335335
changed_when: false
336336
delegate_to: '{{ groups[mon_group_name][0] }}'
337337
when: ip_version == 'ipv6'

‎roles/ceph-defaults/defaults/main.yml

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ iscsi_gw_group_name: iscsigws
4848
mgr_group_name: mgrs
4949
rgwloadbalancer_group_name: rgwloadbalancers
5050
grafana_server_group_name: grafana-server
51+
adopt_label_group_names:
52+
- "{{ mon_group_name }}"
53+
- "{{ osd_group_name }}"
54+
- "{{ rgw_group_name }}"
55+
- "{{ mds_group_name }}"
56+
- "{{ nfs_group_name }}"
57+
- "{{ rbdmirror_group_name }}"
58+
- "{{ client_group_name }}"
59+
- "{{ iscsi_gw_group_name }}"
60+
- "{{ mgr_group_name }}"
61+
- "{{ rgwloadbalancer_group_name }}"
62+
- "{{ grafana_server_group_name }}"
5163

5264
# If configure_firewall is true, then ansible will try to configure the
5365
# appropriate firewalling rules so that Ceph daemons can communicate

0 commit comments

Comments
 (0)
Please sign in to comment.