Hugh Saunders 623b9f82bf Increase retries for keystone_add_service
This is the first role to run after apache/keystone are restarted
so we need to wait for them both to come up, by having a large number
of retries on the first task.

Related to: #353
2014-10-21 13:31:04 +01:00

63 lines
1.9 KiB
YAML

---
# Copyright 2014, 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 Keystone Service
keystone: >
command=ensure_service
token="{{ auth_admin_token }}"
endpoint="{{ auth_admin_uri }}"
service_name="{{ service_name }}"
service_type="{{ service_type }}"
description="{{ service_description }}"
register: add_service
until: add_service|success
retries: 30
delay: 2
# Create an admin user
- name: Ensure Keystone user
keystone: >
command=ensure_user
token="{{ auth_admin_token }}"
endpoint="{{ auth_admin_uri }}"
user_name="{{ service_name }}"
tenant_name=admin
password="{{ service_password }}"
# Add a role to the user
- name: Ensure Keystone user to Admin role
keystone: >
command=ensure_user_role
token="{{ auth_admin_token }}"
endpoint="{{ auth_admin_uri }}"
user_name="{{ service_name }}"
tenant_name=service
role_name=admin
# Create an endpoint
- name: Ensure Keystone Endpoint
keystone: >
command=ensure_endpoint
token="{{ auth_admin_token }}"
endpoint="{{ auth_admin_uri }}"
region_name={{ service_region }}
service_name="{{ service_name }}"
service_type="{{ service_type }}"
publicurl={{ service_publicurl }}
adminurl={{ service_adminurl }}
internalurl={{ service_internalurl }}
when: service_publicurl is defined and service_adminurl is defined and service_internalurl is defined