]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
adopt: fix node labelling
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 3 Mar 2022 12:44:53 +0000 (13:44 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 3 Mar 2022 16:01:58 +0000 (17:01 +0100)
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 266b6e739c26a931f1c975a990f22906223015ef)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
infrastructure-playbooks/cephadm-adopt.yml
roles/ceph-defaults/defaults/main.yml

index e3a1950ccf467f269b71502f0d1b4244b8282849..2a40f80d6fe279da2a54c02e1116a9f08c75764a 100644 (file)
@@ -56,6 +56,18 @@ dummy:
 #mgr_group_name: mgrs
 #rgwloadbalancer_group_name: rgwloadbalancers
 #monitoring_group_name: monitoring
+#adopt_label_group_names:
+#  - "{{ mon_group_name }}"
+#  - "{{ osd_group_name }}"
+#  - "{{ rgw_group_name }}"
+#  - "{{ mds_group_name }}"
+#  - "{{ nfs_group_name }}"
+#  - "{{ rbdmirror_group_name }}"
+#  - "{{ client_group_name }}"
+#  - "{{ iscsi_gw_group_name }}"
+#  - "{{ mgr_group_name }}"
+#  - "{{ rgwloadbalancer_group_name }}"
+#  - "{{ monitoring_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate
index febf4133ee43f5ebde6c0ddad286277de953694b..0aebed86155d1a7997279da37ccaefdffca506aa 100644 (file)
@@ -56,6 +56,18 @@ dummy:
 #mgr_group_name: mgrs
 #rgwloadbalancer_group_name: rgwloadbalancers
 #monitoring_group_name: monitoring
+#adopt_label_group_names:
+#  - "{{ mon_group_name }}"
+#  - "{{ osd_group_name }}"
+#  - "{{ rgw_group_name }}"
+#  - "{{ mds_group_name }}"
+#  - "{{ nfs_group_name }}"
+#  - "{{ rbdmirror_group_name }}"
+#  - "{{ client_group_name }}"
+#  - "{{ iscsi_gw_group_name }}"
+#  - "{{ mgr_group_name }}"
+#  - "{{ rgwloadbalancer_group_name }}"
+#  - "{{ monitoring_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate
index bc5d6bd46b5a526fce849fc1938885667eb0f55c..3136e5229ad9bb2863d480788df80bad1011c81b 100644 (file)
       when: is_hci | bool
 
     - name: manage nodes with cephadm - ipv4
-      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(' ') }}"
+      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(' ') }}"
       changed_when: false
       delegate_to: '{{ groups[mon_group_name][0] }}'
       when: ip_version == 'ipv4'
 
     - name: manage nodes with cephadm - ipv6
-      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(' ') }}"
+      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(' ') }}"
       changed_when: false
       delegate_to: '{{ groups[mon_group_name][0] }}'
       when: ip_version == 'ipv6'
index 7ebc0c6130d69affab4f48d0f253cd5d27513ee4..b6cbdb2885c13086fc933b5eafe632942dd7294a 100644 (file)
@@ -48,6 +48,18 @@ iscsi_gw_group_name: iscsigws
 mgr_group_name: mgrs
 rgwloadbalancer_group_name: rgwloadbalancers
 monitoring_group_name: monitoring
+adopt_label_group_names:
+  - "{{ mon_group_name }}"
+  - "{{ osd_group_name }}"
+  - "{{ rgw_group_name }}"
+  - "{{ mds_group_name }}"
+  - "{{ nfs_group_name }}"
+  - "{{ rbdmirror_group_name }}"
+  - "{{ client_group_name }}"
+  - "{{ iscsi_gw_group_name }}"
+  - "{{ mgr_group_name }}"
+  - "{{ rgwloadbalancer_group_name }}"
+  - "{{ monitoring_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate