From 05d6c6fd5292ca30fa6e19becc4032893ba47da5 Mon Sep 17 00:00:00 2001 From: Steve Lewis Date: Sat, 17 Sep 2016 08:10:08 -0700 Subject: [PATCH] Lookup Gnocchi service before proxy is configured We were seeing the configuration adjusted on a random swift host which may not be a proxy node in all cases. This change performs the lookup earlier, and on the proxy hosts where it is needed. Change-Id: Iaf21679d847b3ee1ecc461bb1528c3139737d163 --- tasks/swift_proxy_hosts.yml | 23 +++++++++++++++++++++++ tasks/swift_service_setup.yml | 24 ------------------------ 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/tasks/swift_proxy_hosts.yml b/tasks/swift_proxy_hosts.yml index a2cfa703..48cced6b 100644 --- a/tasks/swift_proxy_hosts.yml +++ b/tasks/swift_proxy_hosts.yml @@ -13,6 +13,29 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Get Gnocchi project id + keystone: + command: get_project + tenant_name: "{{ gnocchi_service_project_name }}" + endpoint: "{{ keystone_service_adminurl }}" + login_user: "{{ keystone_admin_user_name }}" + login_password: "{{ keystone_auth_admin_password }}" + login_project_name: "{{ keystone_admin_tenant_name }}" + insecure: "{{ keystone_service_adminuri_insecure }}" + register: get_gnocchi_project + until: get_gnocchi_project|success + retries: 5 + delay: 10 + when: + - swift_gnocchi_enabled | bool + +- name: Store Gnocchi project id + set_fact: + swift_gnocchi_service_project_id: "{{ keystone_facts.id }}" + when: + - swift_gnocchi_enabled | bool + - get_gnocchi_project | success + - include: swift_init_common.yml vars: program_name: "swift-proxy-server" diff --git a/tasks/swift_service_setup.yml b/tasks/swift_service_setup.yml index 1f9323ea..9ab581cf 100644 --- a/tasks/swift_service_setup.yml +++ b/tasks/swift_service_setup.yml @@ -168,27 +168,3 @@ until: add_service|success retries: 5 delay: 10 - -- name: Get Gnocchi project id - keystone: - command: get_project - tenant_name: "{{ gnocchi_service_project_name }}" - endpoint: "{{ keystone_service_adminurl }}" - login_user: "{{ keystone_admin_user_name }}" - login_password: "{{ keystone_auth_admin_password }}" - login_project_name: "{{ keystone_admin_tenant_name }}" - insecure: "{{ keystone_service_adminuri_insecure }}" - register: get_gnocchi_project - until: get_gnocchi_project|success - retries: 5 - delay: 10 - when: - - swift_gnocchi_enabled | bool - - swift_gnocchi_service_project_id is not defined - -- name: Store Gnocchi project id - set_fact: - swift_gnocchi_service_project_id: "{{ keystone_facts.id }}" - when: - - swift_gnocchi_enabled | bool - - get_gnocchi_project | success