openstack-ansible-os_trove/tasks/trove_service_setup.yml
Samuel Matzek 69f47bc587 Remove trove_regular_user
Remove the unnecessary trove_regular_user.  The documenation that was
referenced [1] when this was added to the role is intended to configure
Trove for development purposes. The trove_regular_user is not used by the
Trove service and is only being created to give the developer a non-admin
user to use for testing.

[1] https://docs.openstack.org/trove/latest/install/manual_install.html

Change-Id: I7c9289e191255e92530ea62568b212320f705ff8
2017-07-27 07:52:00 -05:00

121 lines
4.3 KiB
YAML

---
# Copyright 2016 Internet Solutions (Pty) Ltd
#
# 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.
#
# (c) 2016 Donovan Francesco <donovan.francesco@is.co.za>
# (c) 2016 Paul Stevens <paul.stevens@is.co.za>
# Reference: https://docs.openstack.org/trove/latest/install/manual_install.html
- name: Ensure the trove tenant exists
keystone:
command: "ensure_tenant"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
tenant_name: "{{ trove_service_tenant_name }}"
project_name: "{{ trove_service_project_name }}"
description: "{{ trove_service_description }}"
register: add_trove_tenant
until: add_trove_tenant |success
retries: 5
delay: 2
tags:
- trove-api-setup
- trove-service-add
- trove-setup
- name: Ensure the service for trove exists
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 }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
service_name: "{{ trove_service_name }}"
service_type: "{{ trove_service_type }}"
description: "{{ trove_service_description }}"
register: add_trove_service
until: add_trove_service |success
retries: 5
delay: 2
tags:
- trove-api-setup
- trove-service-add
- trove-setup
- name: Ensure the trove admin user exists
keystone:
command: "ensure_user"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
user_name: "{{ trove_admin_user_name }}"
tenant_name: "{{ trove_service_tenant_name }}"
password: "{{ trove_service_password }}"
project_name: "{{ trove_service_project_name }}"
register: add_trove_admin_user
until: add_trove_admin_user |success
retries: 5
delay: 2
tags:
- trove-api-setup
- trove-service-add
- trove-user-add
- trove-setup
- name: Ensure the trove admin user has the admin role
keystone:
command: "ensure_user_role"
endpoint: "{{ keystone_service_adminurl }}"
login_user: "{{ keystone_admin_user_name }}"
login_password: "{{ keystone_auth_admin_password }}"
login_project_name: "{{ keystone_admin_tenant_name }}"
user_name: "{{ trove_admin_user_name }}"
tenant_name: "{{ trove_service_tenant_name }}"
role_name: "{{ item }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
project_name: "{{ trove_service_project_name }}"
register: ensure_trove_admin_roles
until: ensure_trove_admin_roles |success
retries: 5
delay: 2
with_items: "{{ trove_service_admin_role_names }}"
- name: Ensure the trove endpoint is registered
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 }}"
insecure: "{{ keystone_service_adminuri_insecure }}"
region_name: "{{ trove_service_region }}"
service_name: "{{ trove_service_name }}"
service_type: "{{ trove_service_type }}"
endpoint_list:
- url: "{{ trove_service_publicurl }}"
interface: "public"
- url: "{{ trove_service_internalurl }}"
interface: "internal"
- url: "{{ trove_service_adminurl }}"
interface: "admin"
register: add_trove_endpoints
until: add_trove_endpoints |success
retries: 5
delay: 2