Replace config-external with a JSON file for Heat

Change-Id: Ie79667ec2f9b091403ead9abc3c0f85afb7944bc
Partially-Implements: blueprint replace-config-external
This commit is contained in:
Ryan Hallisey 2015-09-17 16:46:13 -04:00 committed by Sam Yaple
parent 57017b0acd
commit 6f9709ce9c
9 changed files with 64 additions and 22 deletions

View File

@ -41,7 +41,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_heat
image: "{{ heat_api_image_full }}"
volumes: "{{ node_config_directory }}/heat-api/:/opt/kolla/heat-api/:ro"
volumes: "{{ node_config_directory }}/heat-api/:/opt/kolla/config_files/:ro"
env:
KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"

View File

@ -16,6 +16,11 @@
- "{{ node_templates_directory }}/heat-engine/heat-engine.conf_augment"
config_dest: "{{ node_config_directory }}/heat-engine/heat.conf"
- name: Copying Heat Engine JSON configuration file
template:
src: "roles/heat/templates/heat-engine.json.j2"
dest: "{{ node_config_directory }}/heat-engine/config.json"
- include: ../../config.yml
vars:
service_name: "heat-api"
@ -35,6 +40,11 @@
- "{{ node_templates_directory }}/heat-api/heat-api.conf_augment"
config_dest: "{{ node_config_directory }}/heat-api/heat.conf"
- name: Copying Heat API JSON configuration file
template:
src: "roles/heat/templates/heat-api.json.j2"
dest: "{{ node_config_directory }}/heat-api/config.json"
- include: ../../config.yml
vars:
service_name: "heat-api-cfn"
@ -53,3 +63,8 @@
- "{{ node_templates_directory }}/heat-api-cfn/heat.conf_augment"
- "{{ node_templates_directory }}/heat-api-cfn/heat-api-cfn.conf_augment"
config_dest: "{{ node_config_directory }}/heat-api-cfn/heat.conf"
- name: Copying Heat-api-cfn JSON configuration file
template:
src: "roles/heat/templates/heat-api-cfn.json.j2"
dest: "{{ node_config_directory }}/heat-api-cfn/config.json"

View File

@ -13,7 +13,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: heat_api
image: "{{ heat_api_image_full }}"
volumes: "{{ node_config_directory }}/heat-api/:/opt/kolla/heat-api/:ro"
volumes: "{{ node_config_directory }}/heat-api/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['heat-api']
@ -32,7 +32,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: heat_api_cfn
image: "{{ heat_api_cfn_image_full }}"
volumes: "{{ node_config_directory }}/heat-api-cfn/:/opt/kolla/heat-api-cfn/:ro"
volumes: "{{ node_config_directory }}/heat-api-cfn/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['heat-api-cfn']
@ -51,7 +51,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: heat_engine
image: "{{ heat_engine_image_full }}"
volumes: "{{ node_config_directory }}/heat-engine/:/opt/kolla/heat-engine/:ro"
volumes: "{{ node_config_directory }}/heat-engine/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['heat-engine']

View File

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

View File

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

View File

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

View File

@ -1,13 +1,11 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/heat-api-cfn"
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
exec $CMD

View File

@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/heat-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.
@ -20,4 +18,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
exec $CMD $ARGS
exec $CMD

View File

@ -1,14 +1,12 @@
#!/bin/bash
set -o errexit
CMD="/usr/bin/heat-engine"
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,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
exec $CMD $ARGS
exec $CMD