openstack-ansible-os_keystone/tasks/keystone_service_setup.yml
Matt Thompson d9ab5ade84 Use different passwords for admin and keystone users
Currently, the keystone service user is created w/ the same password as
the admin user.  This change updates the keystone service user creation
to be done w/ the value of keystone_service_password instead of
keystone_auth_admin_password.

Change-Id: Icc643c3a79ca5f58b53651b90695adafb83532e5
Closes-Bug: #1443955
2015-04-14 16:48:45 +01:00

200 lines
5.4 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: Restart service
service:
name: "{{ keystone_system_service_name }}"
state: restarted
pattern: "{{ keystone_system_service_name }}"
tags:
- keystone-db-sync
- keystone-setup
- name: Wait for keystone admin to come up
wait_for:
host: "{{ ansible_ssh_host }}"
port: "{{ keystone_admin_port }}"
timeout: 25
delay: 10
tags:
- keystone-db-sync
- keystone-setup
- name: Wait for keystone service to come up
wait_for:
host: "{{ ansible_ssh_host }}"
port: "{{ keystone_service_port }}"
timeout: 25
delay: 10
tags:
- keystone-db-sync
- keystone-setup
# Create an service tenant
- name: Ensure service tenant
keystone:
command: "ensure_tenant"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
tenant_name: "{{ keystone_service_tenant_name }}"
description: "{{ keystone_service_description }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-setup
# Create an admin tenant
- name: Ensure admin tenant
keystone:
command: "ensure_tenant"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
tenant_name: "{{ keystone_admin_tenant_name }}"
description: "{{ keystone_admin_description }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-setup
# Create an admin user
- name: Ensure Admin user
keystone:
command: "ensure_user"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
user_name: "{{ keystone_admin_user_name }}"
tenant_name: "{{ keystone_admin_tenant_name }}"
password: "{{ keystone_auth_admin_password }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-setup
# Create an admin role
- name: Ensure Admin role
keystone:
command: "ensure_role"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
role_name: "{{ keystone_role_name }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-setup
# Add a role to the user
- name: Ensure Admin user to Admin role
keystone:
command: "ensure_user_role"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
user_name: "{{ keystone_admin_user_name }}"
tenant_name: "{{ keystone_admin_tenant_name }}"
role_name: "{{ keystone_role_name }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-setup
# Create a service
- name: Ensure Keystone Service
keystone:
command: "ensure_service"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
service_name: "{{ keystone_service_name }}"
service_type: "{{ keystone_service_type }}"
description: "{{ keystone_service_description }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-service-add
- keystone-setup
# Create a service user
- name: Ensure Keystone user
keystone:
command: "ensure_user"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
user_name: "{{ keystone_service_user_name }}"
tenant_name: "{{ keystone_service_tenant_name }}"
password: "{{ keystone_service_password }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-service-add
- keystone-setup
# Add a role to the user
- name: Ensure Keystone user to Admin role
keystone:
command: "ensure_user_role"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
user_name: "{{ keystone_service_user_name }}"
tenant_name: "{{ keystone_service_tenant_name }}"
role_name: "{{ keystone_role_name }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-service-add
- keystone-setup
# Create an endpoint
- name: Ensure Keystone Endpoint
keystone:
command: "ensure_endpoint"
token: "{{ keystone_auth_admin_token }}"
endpoint: "{{ keystone_service_adminurl }}"
region_name: "{{ keystone_service_region }}"
service_name: "{{ keystone_service_name }}"
service_type: "{{ keystone_service_type }}"
publicurl: "{{ keystone_service_publicurl }}"
adminurl: "{{ keystone_service_adminurl }}"
internalurl: "{{ keystone_service_internalurl }}"
register: add_service
until: add_service|success
retries: 5
delay: 10
tags:
- keystone-api-setup
- keystone-service-add
- keystone-setup