Ansible Glance support
Adds support for glance in ansible Partially-Implements: blueprint ansible-service Change-Id: I2d162e79f85877116b0e33b1843de6ccb62a445a
This commit is contained in:
parent
fcda6a06d8
commit
e7a7cc9017
@ -9,3 +9,6 @@ support
|
||||
|
||||
[keystone:children]
|
||||
support
|
||||
|
||||
[glance:children]
|
||||
support
|
||||
|
@ -12,3 +12,9 @@ support
|
||||
|
||||
[message-broker:children]
|
||||
support
|
||||
|
||||
[keystone:children]
|
||||
support
|
||||
|
||||
[glance:children]
|
||||
support
|
||||
|
@ -1,13 +1,13 @@
|
||||
---
|
||||
- name: Ensuring templates config directory exists
|
||||
file:
|
||||
path: "{{ node_templates_directory }}/{{ project_name }}"
|
||||
path: "{{ node_templates_directory }}/{{ service_name }}"
|
||||
state: "directory"
|
||||
recurse: yes
|
||||
|
||||
- name: Ensuring config directory exists
|
||||
file:
|
||||
path: "{{ node_config_directory }}/{{ project_name }}"
|
||||
path: "{{ node_config_directory }}/{{ service_name }}"
|
||||
state: "directory"
|
||||
|
||||
- name: Copying over config(s)
|
||||
|
@ -1,8 +1,7 @@
|
||||
---
|
||||
|
||||
|
||||
- include: ../../config.yml
|
||||
vars:
|
||||
service_name: "mariadb"
|
||||
config_source:
|
||||
- "roles/database/templates/galera.cnf.j2"
|
||||
config_template_dest:
|
||||
|
49
ansible/roles/glance/defaults/main.yml
Normal file
49
ansible/roles/glance/defaults/main.yml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
project_name: "glance"
|
||||
|
||||
####################
|
||||
# Database
|
||||
####################
|
||||
glance_database_name: "glance"
|
||||
glance_database_user: "glance"
|
||||
glance_database_address: "{{ kolla_internal_address }}"
|
||||
|
||||
# Do not override "service_*" variables
|
||||
service_database_name: "{{ glance_database_name }}"
|
||||
service_database_user: "{{ glance_database_user }}"
|
||||
service_database_password: "{{ glance_database_password }}"
|
||||
|
||||
|
||||
####################
|
||||
# Docker
|
||||
####################
|
||||
docker_glance_registry: "{{ docker_registry }}"
|
||||
docker_glance_namespace: "{{ docker_namespace }}"
|
||||
kolla_glance_base_distro: "{{ kolla_base_distro }}"
|
||||
kolla_glance_install_type: "{{ kolla_install_type }}"
|
||||
kolla_glance_registry_container_name: "glance-registry"
|
||||
kolla_glance_api_container_name: "glance-api"
|
||||
|
||||
docker_glance_registry_image: "{{ docker_glance_registry }}{{ docker_glance_namespace }}/{{ kolla_glance_base_distro }}-{{ kolla_glance_install_type }}-{{ kolla_glance_registry_container_name }}"
|
||||
docker_glance_registry_tag: "{{ openstack_release }}"
|
||||
docker_glance_registry_image_full: "{{ docker_glance_registry_image }}:{{ docker_glance_api_tag }}"
|
||||
|
||||
docker_glance_api_image: "{{ docker_glance_registry }}{{ docker_glance_namespace }}/{{ kolla_glance_base_distro }}-{{ kolla_glance_install_type }}-{{ kolla_glance_api_container_name }}"
|
||||
docker_glance_api_tag: "{{ openstack_release }}"
|
||||
docker_glance_api_image_full: "{{ docker_glance_api_image }}:{{ docker_glance_api_tag }}"
|
||||
|
||||
|
||||
####################
|
||||
# Openstack
|
||||
####################
|
||||
glance_public_address: "{{ kolla_external_address }}"
|
||||
glance_admin_address: "{{ kolla_internal_address }}"
|
||||
glance_internal_address: "{{ kolla_internal_address }}"
|
||||
|
||||
glance_registry_port: "9191"
|
||||
glance_api_port: "9292"
|
||||
|
||||
glance_logging_verbose: "{{ openstack_logging_verbose }}"
|
||||
glance_logging_debug: "{{ openstack_logging_debug }}"
|
||||
|
||||
glance_keystone_user: "glance"
|
12
ansible/roles/glance/tasks/bootstrap.yml
Normal file
12
ansible/roles/glance/tasks/bootstrap.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
- include: ../../bootstrap.yml
|
||||
vars:
|
||||
container_detach: False
|
||||
container_environment:
|
||||
KOLLA_BOOTSTRAP:
|
||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||
container_image: "{{ docker_glance_api_image_full }}"
|
||||
container_name: "bootstrap_glance_api"
|
||||
container_restart_policy: "no"
|
||||
container_volumes:
|
||||
- "{{ node_config_directory }}/glance-api/:/opt/kolla/glance-api/:ro"
|
36
ansible/roles/glance/tasks/config.yml
Normal file
36
ansible/roles/glance/tasks/config.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
- include: ../../config.yml
|
||||
vars:
|
||||
service_name: "glance-registry"
|
||||
config_source:
|
||||
- "roles/glance/templates/glance-registry.conf.j2"
|
||||
- "/etc/kolla/config/global.conf"
|
||||
- "/etc/kolla/config/database.conf"
|
||||
- "/etc/kolla/config/glance.conf"
|
||||
- "/etc/kolla/config/glance/glance-registry.conf"
|
||||
config_template_dest:
|
||||
- "{{ node_templates_directory }}/glance-registry/glance.conf_minimal"
|
||||
- "{{ node_templates_directory }}/glance-registry/glance.conf_global"
|
||||
- "{{ node_templates_directory }}/glance-registry/glance.conf_database"
|
||||
- "{{ node_templates_directory }}/glance-registry/glance.conf_augment"
|
||||
- "{{ node_templates_directory }}/glance-registry/glance-registry.conf_augment"
|
||||
config_dest: "{{ node_config_directory }}/glance-registry/glance-registry.conf"
|
||||
|
||||
- include: ../../config.yml
|
||||
vars:
|
||||
service_name: "glance-api"
|
||||
config_source:
|
||||
- "roles/glance/templates/glance-api.conf.j2"
|
||||
- "/etc/kolla/config/global.conf"
|
||||
- "/etc/kolla/config/database.conf"
|
||||
- "/etc/kolla/config/messaging.conf"
|
||||
- "/etc/kolla/config/glance.conf"
|
||||
- "/etc/kolla/config/glance/glance-api.conf"
|
||||
config_template_dest:
|
||||
- "{{ node_templates_directory }}/glance-api/glance.conf_minimal"
|
||||
- "{{ node_templates_directory }}/glance-api/glance.conf_global"
|
||||
- "{{ node_templates_directory }}/glance-api/glance.conf_database"
|
||||
- "{{ node_templates_directory }}/glance-api/glance.conf_messaging"
|
||||
- "{{ node_templates_directory }}/glance-api/glance.conf_augment"
|
||||
- "{{ node_templates_directory }}/glance-api/glance-api.conf_augment"
|
||||
config_dest: "{{ node_config_directory }}/glance-api/glance-api.conf"
|
8
ansible/roles/glance/tasks/main.yml
Normal file
8
ansible/roles/glance/tasks/main.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- include: config.yml
|
||||
|
||||
- include: bootstrap.yml
|
||||
|
||||
- include: start.yml
|
||||
|
||||
#- include: register.yml
|
12
ansible/roles/glance/tasks/register.yml
Normal file
12
ansible/roles/glance/tasks/register.yml
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
# NB: Not an Attorney
|
||||
#
|
||||
# Upstream ansible will have all of the new modules we need based on
|
||||
# the shade library. They are written, but the keystone modules haven't3
|
||||
# been merged yet. None of the modules will land before Ansible 2.0.
|
||||
#
|
||||
# These new modules will be relicensed using ASL2.0 as the result of a
|
||||
# gentlemen's agreement that the Kolla authors will not alter the Shade code.
|
||||
# This does not place additional restrictions on the license of this work. The
|
||||
# relicense agreement is based upon trust, not something legally binding and
|
||||
# has no binding impact on the license of Kolla..
|
18
ansible/roles/glance/tasks/start.yml
Normal file
18
ansible/roles/glance/tasks/start.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
- include: ../../start.yml
|
||||
vars:
|
||||
container_environment:
|
||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||
container_image: "{{ docker_glance_registry_image_full }}"
|
||||
container_name: "glance_registry"
|
||||
container_volumes:
|
||||
- "{{ node_config_directory }}/glance-registry/:/opt/kolla/glance-registry/:ro"
|
||||
|
||||
- include: ../../start.yml
|
||||
vars:
|
||||
container_environment:
|
||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||
container_image: "{{ docker_glance_api_image_full }}"
|
||||
container_name: "glance_api"
|
||||
container_volumes:
|
||||
- "{{ node_config_directory }}/glance-api/:/opt/kolla/glance-api/:ro"
|
30
ansible/roles/glance/templates/glance-api.conf.j2
Normal file
30
ansible/roles/glance/templates/glance-api.conf.j2
Normal file
@ -0,0 +1,30 @@
|
||||
[DEFAULT]
|
||||
verbose = true
|
||||
debug = true
|
||||
|
||||
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
|
||||
rabbit_host = {{ kolla_internal_address }}
|
||||
rabbit_userid = {{ rabbitmq_user }}
|
||||
rabbit_password = {{ rabbitmq_password }}
|
||||
rabbit_ha_queues = true
|
||||
|
||||
notification_driver = nova.openstack.common.notifier.rpc_notifier
|
||||
|
||||
registry_host = {{ kolla_internal_address }}
|
||||
|
||||
[database]
|
||||
connection = mysql://{{ glance_database_user }}:{{ glance_database_password }}@{{ glance_database_address }}/{{ glance_database_name }}
|
||||
|
||||
[keystone_authtoken]
|
||||
auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
|
||||
auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
|
||||
auth_plugin = password
|
||||
project_domain_id = default
|
||||
user_domain_id = default
|
||||
project_name = service
|
||||
username = {{ glance_keystone_user }}
|
||||
password = {{ glance_keystone_password }}
|
||||
|
||||
[paste_deploy]
|
||||
flavor = keystone
|
21
ansible/roles/glance/templates/glance-registry.conf.j2
Normal file
21
ansible/roles/glance/templates/glance-registry.conf.j2
Normal file
@ -0,0 +1,21 @@
|
||||
[DEFAULT]
|
||||
verbose = true
|
||||
debug = true
|
||||
|
||||
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||
|
||||
[database]
|
||||
connection = mysql://{{ glance_database_user }}:{{ glance_database_password }}@{{ glance_database_address }}/{{ glance_database_name }}
|
||||
|
||||
[keystone_authtoken]
|
||||
auth_uri = http://{{ kolla_internal_address }}:{{ keystone_public_port }}
|
||||
auth_url = http://{{ kolla_internal_address }}:{{ keystone_admin_port }}
|
||||
auth_plugin = password
|
||||
project_domain_id = default
|
||||
user_domain_id = default
|
||||
project_name = service
|
||||
username = {{ glance_keystone_user }}
|
||||
password = {{ glance_keystone_password }}
|
||||
|
||||
[paste_deploy]
|
||||
flavor = keystone
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
- include: ../../config.yml
|
||||
vars:
|
||||
service_name: "keystone"
|
||||
config_source:
|
||||
- "roles/keystone/templates/keystone.conf.j2"
|
||||
- "/etc/kolla/config/global.conf"
|
||||
|
@ -13,3 +13,8 @@
|
||||
roles:
|
||||
- keystone
|
||||
tags: keystone
|
||||
|
||||
- hosts: glance
|
||||
roles:
|
||||
- glance
|
||||
tags: glance
|
||||
|
@ -10,4 +10,11 @@ source /opt/kolla/kolla-common.sh
|
||||
# Config-internal script exec out of this function, it does not return here.
|
||||
set_configs
|
||||
|
||||
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||
su -s /bin/sh -c "glance-manage db_sync" glance
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec $CMD $ARGS
|
||||
|
@ -10,11 +10,4 @@ source /opt/kolla/kolla-common.sh
|
||||
# Config-internal script exec out of this function, it does not return here.
|
||||
set_configs
|
||||
|
||||
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||
su -s /bin/sh -c "glance-manage db_sync" glance
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec $CMD $ARGS
|
||||
|
0
etc/kolla/config/glance.conf
Normal file
0
etc/kolla/config/glance.conf
Normal file
0
etc/kolla/config/glance/glance-api.conf
Normal file
0
etc/kolla/config/glance/glance-api.conf
Normal file
0
etc/kolla/config/glance/glance-registry.conf
Normal file
0
etc/kolla/config/glance/glance-registry.conf
Normal file
@ -76,5 +76,4 @@ keystone_admin_port: "35357"
|
||||
####################
|
||||
# RabbitMQ options
|
||||
####################
|
||||
#placeholder
|
||||
|
||||
rabbitmq_user: "openstack"
|
||||
|
@ -22,6 +22,9 @@ keystone_admin_token: "password"
|
||||
keystone_admin_password: "password"
|
||||
keystone_database_password: "password"
|
||||
|
||||
glance_database_password: "password"
|
||||
glance_keystone_password: "password"
|
||||
|
||||
|
||||
####################
|
||||
# RabbitMQ options
|
||||
|
Loading…
Reference in New Issue
Block a user