Replace config-external with a JSON file for Glance

Change-Id: I14187db31a009c150424ea28b854a78c9ae3941d
Partially-Implements: blueprint replace-config-external
This commit is contained in:
rthallisey 2015-08-28 18:29:43 -04:00 committed by Ryan Hallisey
parent 180e8c3331
commit 3fa0aa2ddc
7 changed files with 45 additions and 15 deletions

View File

@ -58,7 +58,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_glance
image: "{{ glance_api_image_full }}"
volumes: "{{ node_config_directory }}/glance-api/:/opt/kolla/glance-api/:ro"
volumes: "{{ node_config_directory }}/glance-api/:/opt/kolla/config_files/:ro"
volumes_from:
- glance_data
env:

View File

@ -18,6 +18,11 @@
- "{{ node_templates_directory }}/glance-registry/glance-registry.conf_augment"
config_dest: "{{ node_config_directory }}/glance-registry/glance-registry.conf"
- name: Copying over Glance Registry JSON configuration file
template:
src: "roles/glance/templates/glance-registry.json.j2"
dest: "{{ node_config_directory }}/glance-registry/config.json"
- include: ../../config.yml
vars:
service_name: "glance-api"
@ -36,3 +41,8 @@
- "{{ 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"
- name: Copying over Glance API JSON configuration file
template:
src: "roles/glance/templates/glance-api.json.j2"
dest: "{{ node_config_directory }}/glance-api/config.json"

View File

@ -13,7 +13,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: glance_registry
image: "{{ glance_registry_image_full }}"
volumes: "{{ node_config_directory }}/glance-registry/:/opt/kolla/glance-registry/:ro"
volumes: "{{ node_config_directory }}/glance-registry/:/opt/kolla/config_files/:ro"
volumes_from:
- glance_data
env:
@ -34,7 +34,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: glance_api
image: "{{ glance_api_image_full }}"
volumes: "{{ node_config_directory }}/glance-api/:/opt/kolla/glance-api/:ro"
volumes: "{{ node_config_directory }}/glance-api/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['glance-api']

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/glance-api",
"config_files": [
{
"source": "/opt/kolla/config_files/glance-api.conf",
"dest": "/etc/glance/glance-api.conf",
"owner": "glance",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/glance-registry",
"config_files": [
{
"source": "/opt/kolla/config_files/glance-registry.conf",
"dest": "/etc/glance/glance-registry.conf",
"owner": "glance",
"perm": "0600"
}
]
}

View File

@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/glance-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Execute config strategy
set_configs
# Generate run command
python /opt/kolla/set_configs.py
CMD=$(cat /run_command)
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
@ -17,4 +15,5 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
exec $CMD $ARGS
echo "Running command: ${CMD}"
exec $CMD

View File

@ -1,13 +1,12 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/glance-registry"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Execute config strategy
set_configs
# Generate run command
python /opt/kolla/set_configs.py
CMD=$(cat /run_command)
exec $CMD $ARGS
echo "Running command: ${CMD}"
exec $CMD