diff options
| author | Sam Yaple <sam@yaple.net> | 2015-09-25 10:47:36 +0000 |
|---|---|---|
| committer | Sam Yaple <sam@yaple.net> | 2015-09-25 11:06:42 +0000 |
| commit | 0cc328c625498192d5eeaeaac04d5a397737b271 (patch) | |
| tree | b62f69b924ee83642f5aa3ae786e6fa78c54108b | |
| parent | 9b18d2d28bb58ba7a957b788c905f3f077cabede (diff) | |
| download | kolla-0cc328c625498192d5eeaeaac04d5a397737b271.tar.gz kolla-0cc328c625498192d5eeaeaac04d5a397737b271.zip | |
Replace config-external - murano
Change-Id: I8c5fdb2f2d3284960318a8189c4cc5bd6a8e59e9
Partially-Implements: blueprint replace-config-external
| -rw-r--r-- | ansible/roles/murano/tasks/bootstrap.yml | 2 | ||||
| -rw-r--r-- | ansible/roles/murano/tasks/config.yml | 12 | ||||
| -rw-r--r-- | ansible/roles/murano/tasks/start.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/murano/templates/murano-api.json.j2 | 11 | ||||
| -rw-r--r-- | ansible/roles/murano/templates/murano-engine.json.j2 | 11 | ||||
| -rwxr-xr-x | docker/murano/murano-api/start.sh | 10 | ||||
| -rwxr-xr-x | docker/murano/murano-engine/start.sh | 10 |
7 files changed, 45 insertions, 15 deletions
diff --git a/ansible/roles/murano/tasks/bootstrap.yml b/ansible/roles/murano/tasks/bootstrap.yml index 69eca1752..31811ae35 100644 --- a/ansible/roles/murano/tasks/bootstrap.yml +++ b/ansible/roles/murano/tasks/bootstrap.yml @@ -42,7 +42,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: bootstrap_murano image: "{{ murano_api_image_full }}" - volumes: "{{ node_config_directory }}/murano-api/:/opt/kolla/murano-api/:ro" + volumes: "{{ node_config_directory }}/murano-api/:/opt/kolla/config_files/:ro" env: KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" diff --git a/ansible/roles/murano/tasks/config.yml b/ansible/roles/murano/tasks/config.yml index 2398f8196..0033972ba 100644 --- a/ansible/roles/murano/tasks/config.yml +++ b/ansible/roles/murano/tasks/config.yml @@ -19,6 +19,12 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/murano.conf" when: inventory_hostname in groups['murano-engine'] +- name: Copying over murano-engine JSON configuration file + template: + src: "murano-engine.json.j2" + dest: "{{ node_config_directory }}/murano-engine/config.json" + when: inventory_hostname in groups['murano-engine'] + - include: ../../config.yml vars: service_name: "murano-api" @@ -38,3 +44,9 @@ - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" config_dest: "{{ node_config_directory }}/{{ service_name }}/murano.conf" when: inventory_hostname in groups['murano-api'] + +- name: Copying over murano-api JSON configuration file + template: + src: "murano-api.json.j2" + dest: "{{ node_config_directory }}/murano-api/config.json" + when: inventory_hostname in groups['murano-api'] diff --git a/ansible/roles/murano/tasks/start.yml b/ansible/roles/murano/tasks/start.yml index c857ef0fb..3ec223170 100644 --- a/ansible/roles/murano/tasks/start.yml +++ b/ansible/roles/murano/tasks/start.yml @@ -13,7 +13,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: murano_engine image: "{{ murano_engine_image_full }}" - volumes: "{{ node_config_directory }}/murano-engine/:/opt/kolla/murano-engine/:ro" + volumes: "{{ node_config_directory }}/murano-engine/:/opt/kolla/config_files/:ro" volumes_from: env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" @@ -33,7 +33,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: murano_api image: "{{ murano_api_image_full }}" - volumes: "{{ node_config_directory }}/murano-api/:/opt/kolla/murano-api/:ro" + volumes: "{{ node_config_directory }}/murano-api/:/opt/kolla/config_files/:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['murano-api'] diff --git a/ansible/roles/murano/templates/murano-api.json.j2 b/ansible/roles/murano/templates/murano-api.json.j2 new file mode 100644 index 000000000..bfafba91e --- /dev/null +++ b/ansible/roles/murano/templates/murano-api.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/murano-api --config-file /etc/murano/murano.conf", + "config_files": [ + { + "source": "/opt/kolla/config_files/murano.conf", + "dest": "/etc/murano/murano.conf", + "owner": "murano", + "perm": "0644" + } + ] +} diff --git a/ansible/roles/murano/templates/murano-engine.json.j2 b/ansible/roles/murano/templates/murano-engine.json.j2 new file mode 100644 index 000000000..d4ad92c08 --- /dev/null +++ b/ansible/roles/murano/templates/murano-engine.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/murano-engine --config-file /etc/murano/murano.conf", + "config_files": [ + { + "source": "/opt/kolla/config_files/murano.conf", + "dest": "/etc/murano/murano.conf", + "owner": "murano", + "perm": "0644" + } + ] +} diff --git a/docker/murano/murano-api/start.sh b/docker/murano/murano-api/start.sh index 7d712177d..59599398e 100755 --- a/docker/murano/murano-api/start.sh +++ b/docker/murano/murano-api/start.sh @@ -1,14 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/murano-api" -ARGS="--config-file /etc/murano/murano.conf" - # 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 diff --git a/docker/murano/murano-engine/start.sh b/docker/murano/murano-engine/start.sh index 22834fc4c..d43e03581 100755 --- a/docker/murano/murano-engine/start.sh +++ b/docker/murano/murano-engine/start.sh @@ -1,13 +1,11 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/murano-engine" -ARGS="--config-file /etc/murano/murano.conf" - # 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 |
