]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph_orch_apply: fix yaml error when multiple rgw deployed
authorTeoman ONAY <tonay@ibm.com>
Wed, 21 Aug 2024 15:33:19 +0000 (17:33 +0200)
committerTeoman ONAY <tonay@ibm.com>
Fri, 23 Aug 2024 21:15:52 +0000 (23:15 +0200)
ceph orch ls rgw --format=yaml returns multiple documents
when multiple rgw are installed, this was not handled
correctly.

Signed-off-by: Teoman ONAY <tonay@ibm.com>
(cherry picked from commit 823700bc1bc1f477cd58c61cded977a706a5c308)

infrastructure-playbooks/cephadm-adopt.yml
library/ceph_orch_apply.py

index 94cc270f538ee2a0ce36fe52f5f41e9cf03568e7..facac09d4c87f8211863168e5be61d08dd758e17 100644 (file)
             hosts:
               - {{ ansible_facts['nodename'] }}
           {% if rgw_subnet is defined %}
-          networks: "{{ rgw_subnet }}"
+          networks: "{{ radosgw_address_block }}"
           {% endif %}
           spec:
             rgw_frontend_port: {{ radosgw_frontend_port }}
index 0c876b24b2a697f219f86fef4d84357c10253d49..1df457b09f91a2921118e5ea9a82e9dbc07377cf 100644 (file)
@@ -82,7 +82,12 @@ def retrieve_current_spec(module: AnsibleModule, expected_spec: Dict) -> Dict:
     """ retrieve current config of the service """
     service: str = expected_spec["service_type"]
     cmd = build_base_cmd_orch(module)
-    cmd.extend(['ls', service, '--format=yaml'])
+    cmd.extend(['ls', service])
+    if 'service_name' in expected_spec:
+        cmd.extend([expected_spec["service_name"]])
+    else:
+        cmd.extend([expected_spec["service_type"] + "." + expected_spec["service_id"]])
+    cmd.extend(['--format=yaml'])
     out = module.run_command(cmd)
     if isinstance(out, str):
         # if there is no existing service, cephadm returns the string 'No services reported'