Merge "Replace config-external with a JSON file for Glance"
This commit is contained in:
commit
9a814e128f
@ -58,7 +58,7 @@
|
|||||||
insecure_registry: "{{ docker_insecure_registry }}"
|
insecure_registry: "{{ docker_insecure_registry }}"
|
||||||
name: bootstrap_glance
|
name: bootstrap_glance
|
||||||
image: "{{ glance_api_image_full }}"
|
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:
|
volumes_from:
|
||||||
- glance_data
|
- glance_data
|
||||||
env:
|
env:
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
- "{{ node_templates_directory }}/glance-registry/glance-registry.conf_augment"
|
- "{{ node_templates_directory }}/glance-registry/glance-registry.conf_augment"
|
||||||
config_dest: "{{ node_config_directory }}/glance-registry/glance-registry.conf"
|
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
|
- include: ../../config.yml
|
||||||
vars:
|
vars:
|
||||||
service_name: "glance-api"
|
service_name: "glance-api"
|
||||||
@ -36,3 +41,8 @@
|
|||||||
- "{{ node_templates_directory }}/glance-api/glance.conf_augment"
|
- "{{ node_templates_directory }}/glance-api/glance.conf_augment"
|
||||||
- "{{ node_templates_directory }}/glance-api/glance-api.conf_augment"
|
- "{{ node_templates_directory }}/glance-api/glance-api.conf_augment"
|
||||||
config_dest: "{{ node_config_directory }}/glance-api/glance-api.conf"
|
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"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
insecure_registry: "{{ docker_insecure_registry }}"
|
insecure_registry: "{{ docker_insecure_registry }}"
|
||||||
name: glance_registry
|
name: glance_registry
|
||||||
image: "{{ glance_registry_image_full }}"
|
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:
|
volumes_from:
|
||||||
- glance_data
|
- glance_data
|
||||||
env:
|
env:
|
||||||
@ -34,7 +34,7 @@
|
|||||||
insecure_registry: "{{ docker_insecure_registry }}"
|
insecure_registry: "{{ docker_insecure_registry }}"
|
||||||
name: glance_api
|
name: glance_api
|
||||||
image: "{{ glance_api_image_full }}"
|
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:
|
env:
|
||||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
when: inventory_hostname in groups['glance-api']
|
when: inventory_hostname in groups['glance-api']
|
||||||
|
11
ansible/roles/glance/templates/glance-api.json.j2
Normal file
11
ansible/roles/glance/templates/glance-api.json.j2
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
11
ansible/roles/glance/templates/glance-registry.json.j2
Normal file
11
ansible/roles/glance/templates/glance-registry.json.j2
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,14 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
CMD="/usr/bin/glance-api"
|
|
||||||
ARGS=""
|
|
||||||
|
|
||||||
# Loading common functions.
|
# Loading common functions.
|
||||||
source /opt/kolla/kolla-common.sh
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
# Execute config strategy
|
# Generate run command
|
||||||
set_configs
|
python /opt/kolla/set_configs.py
|
||||||
|
CMD=$(cat /run_command)
|
||||||
|
|
||||||
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||||
@ -17,4 +15,5 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec $CMD $ARGS
|
echo "Running command: ${CMD}"
|
||||||
|
exec $CMD
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
CMD="/usr/bin/glance-registry"
|
|
||||||
ARGS=""
|
|
||||||
|
|
||||||
# Loading common functions.
|
# Loading common functions.
|
||||||
source /opt/kolla/kolla-common.sh
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
# Execute config strategy
|
# Generate run command
|
||||||
set_configs
|
python /opt/kolla/set_configs.py
|
||||||
|
CMD=$(cat /run_command)
|
||||||
|
|
||||||
exec $CMD $ARGS
|
echo "Running command: ${CMD}"
|
||||||
|
exec $CMD
|
||||||
|
Loading…
Reference in New Issue
Block a user