diff --git a/ansible/roles/nova/tasks/bootstrap.yml b/ansible/roles/nova/tasks/bootstrap.yml index c41fcf4494799342fcda02107fe88cdb49b1e499..c06c011d00f9b7e4bfc4fb2140513e459a550892 100644 --- a/ansible/roles/nova/tasks/bootstrap.yml +++ b/ansible/roles/nova/tasks/bootstrap.yml @@ -59,7 +59,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: bootstrap_nova image: "{{ nova_api_image_full }}" - volumes: "{{ node_config_directory }}/nova-api/:/opt/kolla/nova-api/:ro" + volumes: "{{ node_config_directory }}/nova-api/:/opt/kolla/config_files/:ro" env: KOLLA_BOOTSTRAP: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" diff --git a/ansible/roles/nova/tasks/config.yml b/ansible/roles/nova/tasks/config.yml index b1ea0df0553ecbf89eca59c86dad8e8c19f9481e..917ef25d2c89f151eec26e98abad4bfeea11ecc7 100644 --- a/ansible/roles/nova/tasks/config.yml +++ b/ansible/roles/nova/tasks/config.yml @@ -19,6 +19,11 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['nova-api'] +- name: Copying Nova API JSON configuration file + template: + src: "roles/nova/templates/nova-api.json.j2" + dest: "{{ node_config_directory }}/nova-api/config.json" + - include: ../../config.yml vars: service_name: "nova-conductor" @@ -39,6 +44,11 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['nova-conductor'] +- name: Copying Nova Conductor JSON configuration file + template: + src: "roles/nova/templates/nova-conductor.json.j2" + dest: "{{ node_config_directory }}/nova-conductor/config.json" + - include: ../../config.yml vars: service_name: "nova-consoleauth" @@ -59,6 +69,11 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['nova-consoleauth'] +- name: Copying Nova Consoleauth JSON configuration file + template: + src: "roles/nova/templates/nova-consoleauth.json.j2" + dest: "{{ node_config_directory }}/nova-consoleauth/config.json" + - include: ../../config.yml vars: service_name: "nova-scheduler" @@ -79,6 +94,11 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['nova-scheduler'] +- name: Copying Nova Scheduler JSON configuration file + template: + src: "roles/nova/templates/nova-scheduler.json.j2" + dest: "{{ node_config_directory }}/nova-scheduler/config.json" + - include: ../../config.yml vars: service_name: "nova-compute" @@ -99,6 +119,11 @@ config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['compute'] +- name: Copying Nova Compute JSON configuration file + template: + src: "roles/nova/templates/nova-compute.json.j2" + dest: "{{ node_config_directory }}/nova-compute/config.json" + - include: ../../config.yml vars: service_name: "nova-novncproxy" @@ -118,3 +143,13 @@ - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" when: inventory_hostname in groups['nova-novncproxy'] + +- name: Copying Nova Novncproxy JSON configuration file + template: + src: "roles/nova/templates/nova-novncproxy.json.j2" + dest: "{{ node_config_directory }}/nova-novncproxy/config.json" + +- name: Copying Nova Libvirt JSON configuration file + template: + src: "roles/nova/templates/nova-libvirt.json.j2" + dest: "{{ node_config_directory }}/nova-libvirt/config.json" diff --git a/ansible/roles/nova/tasks/start.yml b/ansible/roles/nova/tasks/start.yml index b6b657c2411e98fa1c06a5f254cfa5480b29967a..09501330b03d68531a500c3633634734e501ea07 100644 --- a/ansible/roles/nova/tasks/start.yml +++ b/ansible/roles/nova/tasks/start.yml @@ -16,7 +16,7 @@ name: nova_libvirt image: "{{ nova_libvirt_image_full }}" volumes: - - "{{ node_config_directory }}/nova-libvirt/:/opt/kolla/nova-libvirt/:ro" + - "{{ node_config_directory }}/nova-libvirt/:/opt/kolla/config_files/:ro" - "/run:/run" - "/sys/fs/cgroup:/sys/fs/cgroup" volumes_from: @@ -41,7 +41,7 @@ name: nova_api image: "{{ nova_api_image_full }}" volumes: - - "{{ node_config_directory }}/nova-api/:/opt/kolla/nova-api/:ro" + - "{{ node_config_directory }}/nova-api/:/opt/kolla/config_files/:ro" - "/lib/modules:/lib/modules:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" @@ -61,7 +61,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: nova_conductor image: "{{ nova_conductor_image_full }}" - volumes: "{{ node_config_directory }}/nova-conductor/:/opt/kolla/nova-conductor/:ro" + volumes: "{{ node_config_directory }}/nova-conductor/:/opt/kolla/config_files/:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['nova-conductor'] @@ -80,7 +80,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: nova_consoleauth image: "{{ nova_consoleauth_image_full }}" - volumes: "{{ node_config_directory }}/nova-consoleauth/:/opt/kolla/nova-consoleauth/:ro" + volumes: "{{ node_config_directory }}/nova-consoleauth/:/opt/kolla/config_files/:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['nova-consoleauth'] @@ -99,7 +99,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: nova_novncproxy image: "{{ nova_novncproxy_image_full }}" - volumes: "{{ node_config_directory }}/nova-novncproxy/:/opt/kolla/nova-novncproxy/:ro" + volumes: "{{ node_config_directory }}/nova-novncproxy/:/opt/kolla/config_files/:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['nova-novncproxy'] @@ -118,7 +118,7 @@ insecure_registry: "{{ docker_insecure_registry }}" name: nova_scheduler image: "{{ nova_scheduler_image_full }}" - volumes: "{{ node_config_directory }}/nova-scheduler/:/opt/kolla/nova-scheduler/:ro" + volumes: "{{ node_config_directory }}/nova-scheduler/:/opt/kolla/config_files/:ro" env: KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" when: inventory_hostname in groups['nova-scheduler'] @@ -139,7 +139,7 @@ name: nova_compute image: "{{ nova_compute_image_full }}" volumes: - - "{{ node_config_directory }}/nova-compute/:/opt/kolla/nova-compute/:ro" + - "{{ node_config_directory }}/nova-compute/:/opt/kolla/config_files/:ro" - "/lib/modules:/lib/modules:ro" - "/run:/run" volumes_from: diff --git a/ansible/roles/nova/templates/nova-api.json.j2 b/ansible/roles/nova/templates/nova-api.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..cf4bdf3f6af460aabedb5b522bab5b1046e62a84 --- /dev/null +++ b/ansible/roles/nova/templates/nova-api.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-api", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-compute.json.j2 b/ansible/roles/nova/templates/nova-compute.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..c9513d15798e71986c74b3cbb34b52d0e33a532a --- /dev/null +++ b/ansible/roles/nova/templates/nova-compute.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-compute", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-conductor.json.j2 b/ansible/roles/nova/templates/nova-conductor.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..41902783cef8fae3f1bd345a03cb270fe3cbfea2 --- /dev/null +++ b/ansible/roles/nova/templates/nova-conductor.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-conductor", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-consoleauth.json.j2 b/ansible/roles/nova/templates/nova-consoleauth.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..0aaad565c82f234b59c2d8de48047ee70881c098 --- /dev/null +++ b/ansible/roles/nova/templates/nova-consoleauth.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-consoleauth", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-libvirt.json.j2 b/ansible/roles/nova/templates/nova-libvirt.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..5ec623dd967c6ee4e1bb149ccb544f5967679e10 --- /dev/null +++ b/ansible/roles/nova/templates/nova-libvirt.json.j2 @@ -0,0 +1,4 @@ +{ + "command": "/usr/sbin/libvirtd", + "config_files": [] +} diff --git a/ansible/roles/nova/templates/nova-network.json.j2 b/ansible/roles/nova/templates/nova-network.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..eea74c71dd85b63703f256d4bc0cd1d6971d01d9 --- /dev/null +++ b/ansible/roles/nova/templates/nova-network.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-network", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-novncproxy.json.j2 b/ansible/roles/nova/templates/nova-novncproxy.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..c565202a7f0a080e8e37b124b5b8557f169dc392 --- /dev/null +++ b/ansible/roles/nova/templates/nova-novncproxy.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-novncproxy", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/ansible/roles/nova/templates/nova-scheduler.json.j2 b/ansible/roles/nova/templates/nova-scheduler.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..3e34eedd76177d19af237f78fb44f62e9a1b5555 --- /dev/null +++ b/ansible/roles/nova/templates/nova-scheduler.json.j2 @@ -0,0 +1,11 @@ +{ + "command": "/usr/bin/nova-scheduler", + "config_files": [ + { + "source": "/opt/kolla/config_files/nova.conf", + "dest": "/etc/nova/nova.conf", + "owner": "nova", + "perm": "0600" + } + ] +} diff --git a/docker/nova/nova-api/start.sh b/docker/nova/nova-api/start.sh index ad25ba65c209d919bc9e37ae00d017fadfb97cad..c61c37febee9971d47266b8e372086ba4b7b99cc 100755 --- a/docker/nova/nova-api/start.sh +++ b/docker/nova/nova-api/start.sh @@ -1,14 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-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 diff --git a/docker/nova/nova-compute/start.sh b/docker/nova/nova-compute/start.sh index 48e77542b8cad91ff24dfe1aa7a05068e85d1509..6191ce851271468326b09ba1e5b4a11887b09b8d 100755 --- a/docker/nova/nova-compute/start.sh +++ b/docker/nova/nova-compute/start.sh @@ -1,13 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-compute" -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 diff --git a/docker/nova/nova-conductor/start.sh b/docker/nova/nova-conductor/start.sh index 1fe7d0586616b51aae88482b88fec7ba2ffaa1cf..6191ce851271468326b09ba1e5b4a11887b09b8d 100755 --- a/docker/nova/nova-conductor/start.sh +++ b/docker/nova/nova-conductor/start.sh @@ -1,13 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-conductor" -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 diff --git a/docker/nova/nova-consoleauth/start.sh b/docker/nova/nova-consoleauth/start.sh index 1abccde19e3491448f09f8ea9baf3022c929649b..6191ce851271468326b09ba1e5b4a11887b09b8d 100755 --- a/docker/nova/nova-consoleauth/start.sh +++ b/docker/nova/nova-consoleauth/start.sh @@ -1,13 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-consoleauth" -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 diff --git a/docker/nova/nova-libvirt/start.sh b/docker/nova/nova-libvirt/start.sh index ae0de867b5071dd3193dbd23010d5fc5fd4919a4..aa07f62dda72e37ace21f87b013892886eceab4b 100755 --- a/docker/nova/nova-libvirt/start.sh +++ b/docker/nova/nova-libvirt/start.sh @@ -1,14 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/sbin/libvirtd" -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) # TODO(SamYaple): Tweak libvirt.conf rather than change permissions. # Fix permissions for libvirt @@ -17,4 +15,5 @@ if [[ -c /dev/kvm ]]; then chown root:kvm /dev/kvm fi -exec $CMD $ARGS +echo "Running command: ${CMD}" +exec $CMD diff --git a/docker/nova/nova-network/start.sh b/docker/nova/nova-network/start.sh index 88f941b337a8eac877320f9c89f4a400784ef187..2f8254b890e4cf6915afd91cb726b9bec2a2477d 100755 --- a/docker/nova/nova-network/start.sh +++ b/docker/nova/nova-network/start.sh @@ -1,13 +1,11 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-network" -ARGS="" - # Loading common functions. source /opt/kolla/kolla-common.sh -# Execute config strategy -set_configs +python /opt/kolla/set_configs.py +CMD=$(cat /run_command) -exec $CMD $ARGS +echo "Running command: ${CMD}" +exec $CMD diff --git a/docker/nova/nova-novncproxy/start.sh b/docker/nova/nova-novncproxy/start.sh index 6e59d125338d4132d1eeaa86c73d90d18f4965e3..6191ce851271468326b09ba1e5b4a11887b09b8d 100755 --- a/docker/nova/nova-novncproxy/start.sh +++ b/docker/nova/nova-novncproxy/start.sh @@ -1,13 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-novncproxy" -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 diff --git a/docker/nova/nova-scheduler/start.sh b/docker/nova/nova-scheduler/start.sh index d9b3e14eb71864208dc3a51840c754f286f040f8..6191ce851271468326b09ba1e5b4a11887b09b8d 100755 --- a/docker/nova/nova-scheduler/start.sh +++ b/docker/nova/nova-scheduler/start.sh @@ -1,13 +1,12 @@ #!/bin/bash set -o errexit -CMD="/usr/bin/nova-scheduler" -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