Replace config-external with a JSON file for Nova

Change-Id: I38c545484a7b1f3906d844eb3a7486e11c4b276a
Partially-Implements: blueprint replace-config-external
This commit is contained in:
rthallisey 2015-08-28 18:42:18 -04:00 committed by Jeff Peeler
parent 9a814e128f
commit aebb16fff9
19 changed files with 163 additions and 56 deletions

View File

@ -59,7 +59,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_nova name: bootstrap_nova
image: "{{ nova_api_image_full }}" 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: env:
KOLLA_BOOTSTRAP: KOLLA_BOOTSTRAP:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"

View File

@ -19,6 +19,11 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['nova-api'] 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 - include: ../../config.yml
vars: vars:
service_name: "nova-conductor" service_name: "nova-conductor"
@ -39,6 +44,11 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['nova-conductor'] 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 - include: ../../config.yml
vars: vars:
service_name: "nova-consoleauth" service_name: "nova-consoleauth"
@ -59,6 +69,11 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['nova-consoleauth'] 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 - include: ../../config.yml
vars: vars:
service_name: "nova-scheduler" service_name: "nova-scheduler"
@ -79,6 +94,11 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['nova-scheduler'] 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 - include: ../../config.yml
vars: vars:
service_name: "nova-compute" service_name: "nova-compute"
@ -99,6 +119,11 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['compute'] 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 - include: ../../config.yml
vars: vars:
service_name: "nova-novncproxy" service_name: "nova-novncproxy"
@ -118,3 +143,13 @@
- "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment" - "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment"
config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf" config_dest: "{{ node_config_directory }}/{{ service_name }}/nova.conf"
when: inventory_hostname in groups['nova-novncproxy'] 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"

View File

@ -16,7 +16,7 @@
name: nova_libvirt name: nova_libvirt
image: "{{ nova_libvirt_image_full }}" image: "{{ nova_libvirt_image_full }}"
volumes: volumes:
- "{{ node_config_directory }}/nova-libvirt/:/opt/kolla/nova-libvirt/:ro" - "{{ node_config_directory }}/nova-libvirt/:/opt/kolla/config_files/:ro"
- "/run:/run" - "/run:/run"
- "/sys/fs/cgroup:/sys/fs/cgroup" - "/sys/fs/cgroup:/sys/fs/cgroup"
volumes_from: volumes_from:
@ -41,7 +41,7 @@
name: nova_api name: nova_api
image: "{{ nova_api_image_full }}" image: "{{ nova_api_image_full }}"
volumes: 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" - "/lib/modules:/lib/modules:ro"
env: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
@ -61,7 +61,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: nova_conductor name: nova_conductor
image: "{{ nova_conductor_image_full }}" 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: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['nova-conductor'] when: inventory_hostname in groups['nova-conductor']
@ -80,7 +80,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: nova_consoleauth name: nova_consoleauth
image: "{{ nova_consoleauth_image_full }}" 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: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['nova-consoleauth'] when: inventory_hostname in groups['nova-consoleauth']
@ -99,7 +99,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: nova_novncproxy name: nova_novncproxy
image: "{{ nova_novncproxy_image_full }}" 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: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['nova-novncproxy'] when: inventory_hostname in groups['nova-novncproxy']
@ -118,7 +118,7 @@
insecure_registry: "{{ docker_insecure_registry }}" insecure_registry: "{{ docker_insecure_registry }}"
name: nova_scheduler name: nova_scheduler
image: "{{ nova_scheduler_image_full }}" 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: env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['nova-scheduler'] when: inventory_hostname in groups['nova-scheduler']
@ -139,7 +139,7 @@
name: nova_compute name: nova_compute
image: "{{ nova_compute_image_full }}" image: "{{ nova_compute_image_full }}"
volumes: 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" - "/lib/modules:/lib/modules:ro"
- "/run:/run" - "/run:/run"
volumes_from: volumes_from:

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -0,0 +1,4 @@
{
"command": "/usr/sbin/libvirtd",
"config_files": []
}

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -1,14 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-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

View File

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-compute"
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

View File

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-conductor"
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

View File

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-consoleauth"
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

View File

@ -1,14 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/sbin/libvirtd"
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)
# TODO(SamYaple): Tweak libvirt.conf rather than change permissions. # TODO(SamYaple): Tweak libvirt.conf rather than change permissions.
# Fix permissions for libvirt # Fix permissions for libvirt
@ -17,4 +15,5 @@ if [[ -c /dev/kvm ]]; then
chown root:kvm /dev/kvm chown root:kvm /dev/kvm
fi fi
exec $CMD $ARGS echo "Running command: ${CMD}"
exec $CMD

View File

@ -1,13 +1,11 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-network"
ARGS=""
# Loading common functions. # Loading common functions.
source /opt/kolla/kolla-common.sh source /opt/kolla/kolla-common.sh
# Execute config strategy python /opt/kolla/set_configs.py
set_configs CMD=$(cat /run_command)
exec $CMD $ARGS echo "Running command: ${CMD}"
exec $CMD

View File

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-novncproxy"
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

View File

@ -1,13 +1,12 @@
#!/bin/bash #!/bin/bash
set -o errexit set -o errexit
CMD="/usr/bin/nova-scheduler"
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