]> git.apps.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>
Fri, 4 Mar 2022 11:51:14 +0000 (12:51 +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 664ec12e8e91eaf1a12b71299b28993c033d241d..069a6e7b4197756021de2a9be2fb5b6c947be2cc 100644 (file)
@@ -56,6 +56,18 @@ dummy:
 #mgr_group_name: mgrs
 #rgwloadbalancer_group_name: rgwloadbalancers
 #grafana_server_group_name: grafana-server
+#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 }}"
+#  - "{{ grafana_server_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate
index b8715d96bc75775f5b818bddd5c6e6572ec5d839..a9ac470eae057602643c641c18a45c02aab84e36 100644 (file)
@@ -56,6 +56,18 @@ dummy:
 #mgr_group_name: mgrs
 #rgwloadbalancer_group_name: rgwloadbalancers
 #grafana_server_group_name: grafana-server
+#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 }}"
+#  - "{{ grafana_server_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate
index 0ded7c6e01b57fe8d3dc2f4c200bed51694131df..6a8d18350232625826f5a56ee0b13aab8b46310c 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 9488374aaa1fc0219e95bb98e4293828abab9804..d9b444017b4579ca0c347ddbbda3dc30649edfc2 100644 (file)
@@ -48,6 +48,18 @@ iscsi_gw_group_name: iscsigws
 mgr_group_name: mgrs
 rgwloadbalancer_group_name: rgwloadbalancers
 grafana_server_group_name: grafana-server
+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 }}"
+  - "{{ grafana_server_group_name }}"
 
 # If configure_firewall is true, then ansible will try to configure the
 # appropriate firewalling rules so that Ceph daemons can communicate