Register keystone endpoints for glance

This commit is contained in:
Flavio Percoco 2017-08-30 10:40:40 +02:00
parent 433e30db2f
commit d826dbc337
4 changed files with 76 additions and 11 deletions

View File

@ -6,8 +6,32 @@ action: provision
hiera_data: {}
hiera_data_file: ''
keystone_config:
admin_username: 'admin'
admin_project_name: 'admin'
admin_domain_name: 'default'
admin_password: 'weakpassword'
glance_config:
DEFAULT:
public_bind_host: "0.0.0.0"
database:
connection: "mysql+pymysql://root:weakpassword@mariadb:3306/glance"
# NOTE(flaper87): Auth section for config file
keystone_authtoken:
auth_uri: 'http://keystone:35357'
auth_url: 'http://keystone:5000/v3'
password: weakpassword
username: 'glance'
project: 'admin'
# NOTE(flaper87): Required for registering the keystone endpoint
keystone_default_domain: 'default'
keystone_region: 'regionOne'
keystone_project: 'admin'
keystone_public_url: 'http://glance:9292'
keystone_internal_url: 'http://glance:9292'
keystone_admin_url: 'http://glance:9292'
keystone_user_password: 'weakpassword'
keystone_username: 'glance'

View File

@ -18,8 +18,8 @@
glance::api::show_image_direct_url: DEFAULT.show_image_direct_url
glance::api::show_multiple_locations: DEFAULT.show_multiple_locations
glance::api::authtoken::auth_uri: keystone_authtoken.auth_uri
glance::api::authtoken::auth_url: keystone_authtoken.auth_url
keystone_auth_uri: keystone_authtoken.auth_uri
keystone_identity_uri: keystone_authtoken.auth_url
glance::api::authtoken::password: keystone_authtoken.password
glance::api::authtoken::username: keystone_authtoken.username
glance::api::authtoken::project: keystone_authtoken.project
@ -44,6 +44,15 @@
glance::notification_driver: oslo_messaging_notifications.driver
glance::notification_topics: oslo_messaging_notifications.topics
# NOTE(flaper87): Required for registering the keystone endpoint
keystone_region: keystone_region
keystone_default_domain: keystone_default_domain
glance::keystone::auth::tenant: keystone_tenant
glance::keystone::auth::public_url: keystone_public_url
glance::keystone::auth::internal_url: keystone_internal_url
glance::keystone::auth::admin_url: keystone_admin_url
glance::keystone::auth::password: keystone_user_password
default: '{{glance_config}}'
fact_variable: 'glance_config'

39
tasks/keystone.yml Normal file
View File

@ -0,0 +1,39 @@
#- name: Read keystone_config
# include_role:
# name: ansible-role-k8s-keystone
# tasks_from: hiera
- name: Register Glance in Keystone
include_role:
name: ansible-role-k8s-tripleo
tasks_from: bootstrap-service-endpoints
vars:
auth_url: '{{glance_config.keystone_authtoken.auth_url}}'
username: '{{keystone_config.admin_username}}'
password: '{{keystone_config.admin_password}}'
project_name: '{{keystone_config.admin_project_name}}'
domain_name: '{{keystone_config.admin_domain_name}}'
service_name: 'glance'
service_type: 'image'
service_region: 'RegionOne'
service_project: '{{glance_config.keystone_authtoken.project}}'
service_password: '{{glance_config.keystone_authtoken.password}}'
service_username: '{{glance_config.keystone_authtoken.username}}'
service_internal_url: '{{glance_config.keystone_internal_url}}'
service_public_url: '{{glance_config.keystone_public_url}}'
service_admin_url: '{{glance_config.keystone_admin_url}}'
#- name: Create keystone user
# os_user:
# auth:
# auth_url: '{{glance_config.keystone_authtoken.auth_url}}'
# username: '{{keystone_config.admin_username}}'
# password: '{{keystone_config.admin_password}}'
# project_name: '{{keystone_config.admin_project_name}}'
# state: present
# name: '{{glance_config.keystone_username}}'
# password: '{{glance_config.keystone_user_password}}'
# update_password: on_create
# domain: '{{glance_config.keystone_default_domain}}'
# default_project: '{{glance_config.keystone_project}}'
#

View File

@ -1,12 +1,3 @@
- name: Create project
k8s_v1_namespace:
host: "{{coe_host}}"
context: "{{kube_context}}"
kubeconfig: "{{config_file}}"
name: openstack
state: present
debug: yes
- name: Upload config files
template:
src: "{{item}}"
@ -175,3 +166,5 @@
config_map:
name: glance
state: present
- include: keystone.yml