diff --git a/ansible/roles/heat/tasks/bootstrap.yml b/ansible/roles/heat/tasks/bootstrap.yml index ca772ab303..cf0d199782 100644 --- a/ansible/roles/heat/tasks/bootstrap.yml +++ b/ansible/roles/heat/tasks/bootstrap.yml @@ -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 }}" diff --git a/ansible/roles/heat/tasks/config.yml b/ansible/roles/heat/tasks/config.yml index bf1364a010..4bc8787c4f 100644 --- a/ansible/roles/heat/tasks/config.yml +++ b/ansible/roles/heat/tasks/config.yml @@ -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" diff --git a/ansible/roles/heat/tasks/start.yml b/ansible/roles/heat/tasks/start.yml index 62f8ba1e0c..c388f43f35 100644 --- a/ansible/roles/heat/tasks/start.yml +++ b/ansible/roles/heat/tasks/start.yml @@ -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'] diff --git a/ansible/roles/heat/templates/heat-api-cfn.json.j2 b/ansible/roles/heat/templates/heat-api-cfn.json.j2 new file mode 100644 index 0000000000..6ebaf00a8d --- /dev/null +++ b/ansible/roles/heat/templates/heat-api-cfn.json.j2 @@ -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" + } + ] +} diff --git a/ansible/roles/heat/templates/heat-api.json.j2 b/ansible/roles/heat/templates/heat-api.json.j2 new file mode 100644 index 0000000000..25de4b0178 --- /dev/null +++ b/ansible/roles/heat/templates/heat-api.json.j2 @@ -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" + } + ] +} diff --git a/ansible/roles/heat/templates/heat-engine.json.j2 b/ansible/roles/heat/templates/heat-engine.json.j2 new file mode 100644 index 0000000000..8ca57e841d --- /dev/null +++ b/ansible/roles/heat/templates/heat-engine.json.j2 @@ -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" + } + ] +} diff --git a/docker/heat/heat-api-cfn/start.sh b/docker/heat/heat-api-cfn/start.sh index 54b5331850..d43e035812 100755 --- a/docker/heat/heat-api-cfn/start.sh +++ b/docker/heat/heat-api-cfn/start.sh @@ -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 diff --git a/docker/heat/heat-api/start.sh b/docker/heat/heat-api/start.sh index 25bfa2bff6..a0d3d6d041 100755 --- a/docker/heat/heat-api/start.sh +++ b/docker/heat/heat-api/start.sh @@ -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 diff --git a/docker/heat/heat-engine/start.sh b/docker/heat/heat-engine/start.sh index 8f9a6f1cb4..db69f85094 100755 --- a/docker/heat/heat-engine/start.sh +++ b/docker/heat/heat-engine/start.sh @@ -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