From: petruha <5363545+p37ruh4@users.noreply.github.com> Date: Mon, 16 Mar 2020 16:35:20 +0000 (+0100) Subject: ceph-facts: Fix system_secret_key variable handling X-Git-Tag: v4.0.17~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2a50c19dc8d74ebcc4241896c5ee7d6d375c90e;p=ceph-ansible.git ceph-facts: Fix system_secret_key variable handling This commit fixes the system_secret_key variable not substitued by the right value and always using the 'system_secret_key' string instead. $ egrep 'system_(access|secret)_key' group_vars/all.yml system_access_key: foofoofoofoofoofoofo system_secret_key: barbarbarbarbarbarbarbarbarbarbarbarbarb $ ansible-playbook -vv -i hosts site.yml.sample -e rgw_multisite=true (...) - hostname: storage0 endpoint: http://192.168.100.42:8080 instance_name: rgw0 radosgw_address: 192.168.50.3 radosgw_frontend_port: 8085 rgw_realm: canada rgw_zone: montreal rgw_zone_user: justin.trudeau rgw_zone_user_display_name: Justin Trudeau rgw_zonegroup: quebec system_access_key: foofoofoofoofoofoofo system_secret_key: system_secret_key Fixes https://github.com/ceph/ceph-ansible/issues/5150 Signed-off-by: petruha <5363545+p37ruh4@users.noreply.github.com> (cherry picked from commit 73b3fadb0ed4cd9eba62669c189fa76178431f07) --- diff --git a/roles/ceph-facts/tasks/set_radosgw_address.yml b/roles/ceph-facts/tasks/set_radosgw_address.yml index 8f6ed2d0d..2da3acaeb 100644 --- a/roles/ceph-facts/tasks/set_radosgw_address.yml +++ b/roles/ceph-facts/tasks/set_radosgw_address.yml @@ -52,7 +52,7 @@ - name: set_fact rgw_instances with rgw multisite set_fact: - rgw_instances: "{{ rgw_instances|default([]) | union([{'instance_name': 'rgw' + item | string, 'radosgw_address': _radosgw_address, 'radosgw_frontend_port': radosgw_frontend_port | int, 'rgw_realm': rgw_realm | string, 'rgw_zonegroup': rgw_zonegroup | string, 'rgw_zone': rgw_zone | string, 'system_access_key': system_access_key, 'system_secret_key': 'system_secret_key', 'rgw_zone_user': rgw_zone_user, 'rgw_zone_user_display_name': rgw_zone_user_display_name, 'endpoint': (rgw_pull_proto + '://' + rgw_pullhost + ':' + rgw_pull_port | string) if not rgw_zonemaster | bool and rgw_zonesecondary | bool else omit }]) }}" + rgw_instances: "{{ rgw_instances|default([]) | union([{'instance_name': 'rgw' + item | string, 'radosgw_address': _radosgw_address, 'radosgw_frontend_port': radosgw_frontend_port | int, 'rgw_realm': rgw_realm | string, 'rgw_zonegroup': rgw_zonegroup | string, 'rgw_zone': rgw_zone | string, 'system_access_key': system_access_key, 'system_secret_key': system_secret_key, 'rgw_zone_user': rgw_zone_user, 'rgw_zone_user_display_name': rgw_zone_user_display_name, 'endpoint': (rgw_pull_proto + '://' + rgw_pullhost + ':' + rgw_pull_port | string) if not rgw_zonemaster | bool and rgw_zonesecondary | bool else omit }]) }}" with_sequence: start=0 end={{ radosgw_num_instances|int - 1 }} when: - inventory_hostname in groups.get(rgw_group_name, [])