openstack-ansible-os_gnocchi/tasks/gnocchi_service_setup.yml
Steve Lewis 2f40fd77ff Enable Gnocchi role lifecycle var for Identity
Because Gnocchi depends on Swift to exist in the service catalog
and be available when using Swift storage, the Gnocchi role must be
run after the Swift service is installed. However the Swift service
benefits from the existence of the Gnocchi roles' identity artifacts
in Keystone when it is configured.

To work around this circular dependency, a special role lifecycle
var is introduced to limit the scope of execution of the Gnocchi
role to only creating the identity artifacts so that this role can
be executed quickly and safely before Swift is installed to allow
Swift to be properly configured, and again without that variable
set after Swift is installed to perform the standard install of
Gnocchi.

No release note or special documentation is provided since this is
still targeting the first release cycle of OpenStack-Ansible with
this role and no special documentation exists for the lifecycle vars
in other services (such as galera_server).

Change-Id: If4fa5c1c4401911057f99488694d74f5d83330a8
2016-09-07 12:35:57 -07:00

56 lines
2.0 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Create a service
- name: Ensure Gnocchi service
keystone:
command: "ensure_service"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
service_name: "{{ gnocchi_service_name }}"
service_type: "{{ gnocchi_service_type }}"
description: "{{ gnocchi_service_description }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
register: add_service
until: add_service|success
retries: 5
delay: 2
# Create an endpoint
- name: Ensure Gnocchi endpoint
keystone:
command: "ensure_endpoint"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
region_name: "{{ gnocchi_service_region }}"
service_name: "{{ gnocchi_service_name }}"
service_type: "{{ gnocchi_service_type }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
endpoint_list:
- url: "{{ gnocchi_service_publicurl }}"
interface: "public"
- url: "{{ gnocchi_service_internalurl }}"
interface: "internal"
- url: "{{ gnocchi_service_adminurl }}"
interface: "admin"
register: add_endpoint
until: add_endpoint|success
retries: 5
delay: 10