21b45f63d7
In Keystone v3, the _member_ role is not implicitly created on first use like it is in v2. This patch adds variables to define the default role name for users: - keystone_default_role_name: this is the default role name from Keystone's point of view - horizon_default_role_name: this is the default user role from Horizon's point of view Both Keystone and Horizon's tasks ensure that the role they're using are registered in the Keystone database. To maintain backwards compatibility the default value for both variables is '_member_'. DocImpact Closes-bug: 1474916 Change-Id: Ie01e1771c0b435815dfe55fc0ba9a6d803ebe958
229 lines
6.4 KiB
YAML
229 lines
6.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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
register: add_service
|
|
until: add_service|success
|
|
retries: 5
|
|
delay: 10
|
|
tags:
|
|
- keystone-api-setup
|
|
- keystone-setup
|
|
|
|
# Add the default user role
|
|
- name: Ensure default keystone user role
|
|
keystone:
|
|
command: "ensure_role"
|
|
token: "{{ keystone_auth_admin_token }}"
|
|
endpoint: "{{ keystone_service_adminurl }}"
|
|
role_name: "{{ keystone_default_role_name }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
register: add_member_role
|
|
until: add_member_role|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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
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 }}"
|
|
insecure: "{{ keystone_service_adminuri_insecure }}"
|
|
endpoint_list:
|
|
- url: "{{ keystone_service_publicurl }}"
|
|
interface: "public"
|
|
- url: "{{ keystone_service_adminurl_v3 }}"
|
|
interface: "admin"
|
|
- url: "{{ keystone_service_internalurl }}"
|
|
interface: "internal"
|
|
register: add_service
|
|
until: add_service|success
|
|
retries: 5
|
|
delay: 10
|
|
tags:
|
|
- keystone-api-setup
|
|
- keystone-service-add
|
|
- keystone-setup
|