81 lines
2.1 KiB
YAML
81 lines
2.1 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.
|
|
|
|
- name: Perform a Keystone DB sync
|
|
command: keystone-manage db_sync
|
|
sudo: yes
|
|
sudo_user: "{{ system_user }}"
|
|
|
|
- name: Restart service
|
|
service: >
|
|
name="{{ program_name }}"
|
|
state=restarted
|
|
pattern="{{ program_name }}"
|
|
|
|
- name: "Wait for keystone to come up"
|
|
wait_for:
|
|
host: "{{ ansible_ssh_host }}"
|
|
port: "{{ admin_port }}"
|
|
timeout: 25
|
|
delay: 10
|
|
|
|
# Create an service tenant
|
|
- name: Ensure service tenant
|
|
keystone: >
|
|
command=ensure_tenant
|
|
token="{{ auth_admin_token }}"
|
|
endpoint="{{ auth_admin_uri }}"
|
|
tenant_name=service
|
|
description="Service Tenant"
|
|
|
|
# Create an admin tenant
|
|
- name: Ensure admin tenant
|
|
keystone: >
|
|
command=ensure_tenant
|
|
token="{{ auth_admin_token }}"
|
|
endpoint="{{ auth_admin_uri }}"
|
|
tenant_name=admin
|
|
description="Admin Tenant"
|
|
|
|
# Create an admin user
|
|
- name: Ensure Admin user
|
|
keystone: >
|
|
command=ensure_user
|
|
token="{{ auth_admin_token }}"
|
|
endpoint="{{ auth_admin_uri }}"
|
|
user_name=admin
|
|
tenant_name=admin
|
|
password="{{ auth_admin_password }}"
|
|
|
|
# Create an admin role
|
|
- name: Ensure Admin role
|
|
keystone: >
|
|
command=ensure_role
|
|
token="{{ auth_admin_token }}"
|
|
endpoint="{{ auth_admin_uri }}"
|
|
role_name=admin
|
|
|
|
# Add a role to the user
|
|
- name: Ensure Admin user to Admin role
|
|
keystone: >
|
|
command=ensure_user_role
|
|
token="{{ auth_admin_token }}"
|
|
endpoint="{{ auth_admin_uri }}"
|
|
user_name=admin
|
|
tenant_name=admin
|
|
role_name=admin
|
|
|
|
- include: keystone_token_cron.yml
|