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

View File

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

View File

@ -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:

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
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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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