Replace config-external with a JSON file for Cinder

Partially-Implements: blueprint replace-config-external

Change-Id: Ic247433290b51c9fb613d90e4a9a0f3d11526b35
This commit is contained in:
Ryan Hallisey 2015-09-17 14:58:02 -04:00 committed by Sam Yaple
parent 2c23f2d445
commit 57017b0acd
11 changed files with 89 additions and 29 deletions

View File

@ -57,7 +57,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: bootstrap_cinder
image: "{{ cinder_api_image_full }}"
volumes: "{{ node_config_directory }}/cinder-api/:/opt/kolla/cinder-api/:ro"
volumes: "{{ node_config_directory }}/cinder-api/:/opt/kolla/config_files/:ro"
volumes_from:
- cinder_data
env:

View File

@ -19,6 +19,12 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/cinder.conf"
when: inventory_hostname in groups['cinder-api']
- name: Copying Cinder API JSON configuration file
template:
src: "roles/cinder/templates/cinder-api.json.j2"
dest: "{{ node_config_directory }}/cinder-api/config.json"
when: inventory_hostname in groups['cinder-api']
- include: ../../config.yml
vars:
service_name: "cinder-backup"
@ -39,6 +45,12 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/cinder.conf"
when: inventory_hostname in groups['cinder-backup']
- name: Copying Cinder Backup JSON configuration file
template:
src: "roles/cinder/templates/cinder-backup.json.j2"
dest: "{{ node_config_directory }}/cinder-backup/config.json"
when: inventory_hostname in groups['cinder-backup']
- include: ../../config.yml
vars:
service_name: "cinder-scheduler"
@ -59,6 +71,12 @@
config_dest: "{{ node_config_directory }}/{{ service_name }}/cinder.conf"
when: inventory_hostname in groups['cinder-scheduler']
- name: Copying Cinder Scheduler JSON configuration file
template:
src: "roles/cinder/templates/cinder-scheduler.json.j2"
dest: "{{ node_config_directory }}/cinder-scheduler/config.json"
when: inventory_hostname in groups['cinder-scheduler']
- include: ../../config.yml
vars:
service_name: "cinder-volume"
@ -78,3 +96,9 @@
- "{{ node_templates_directory }}/{{ service_name }}/{{ service_name }}.conf_augment"
config_dest: "{{ node_config_directory }}/{{ service_name }}/cinder.conf"
when: inventory_hostname in groups['cinder-volume']
- name: Copying Cinder Volume JSON configuration file
template:
src: "roles/cinder/templates/cinder-volume.json.j2"
dest: "{{ node_config_directory }}/cinder-volume/config.json"
when: inventory_hostname in groups['cinder-volume']

View File

@ -12,7 +12,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: cinder_api
image: "{{ cinder_api_image_full }}"
volumes: "{{ node_config_directory }}/cinder-api/:/opt/kolla/cinder-api/:ro"
volumes: "{{ node_config_directory }}/cinder-api/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['cinder-api']
@ -31,7 +31,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: cinder_backup
image: "{{ cinder_backup_image_full }}"
volumes: "{{ node_config_directory }}/cinder-backup/:/opt/kolla/cinder-backup/:ro"
volumes: "{{ node_config_directory }}/cinder-backup/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['cinder-backup']
@ -50,7 +50,7 @@
insecure_registry: "{{ docker_insecure_registry }}"
name: cinder_scheduler
image: "{{ cinder_scheduler_image_full }}"
volumes: "{{ node_config_directory }}/cinder-scheduler/:/opt/kolla/cinder-scheduler/:ro"
volumes: "{{ node_config_directory }}/cinder-scheduler/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['cinder-scheduler']
@ -70,7 +70,7 @@
privileged: True
name: cinder_volume
image: "{{ cinder_volume_image_full }}"
volumes: "{{ node_config_directory }}/cinder-volume/:/opt/kolla/cinder-volume/:ro"
volumes: "{{ node_config_directory }}/cinder-volume/:/opt/kolla/config_files/:ro"
env:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
when: inventory_hostname in groups['cinder-volume']

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/cinder-api --config-file /etc/cinder/cinder.conf",
"config_files": [
{
"source": "/opt/kolla/config_files/cinder.conf",
"dest": "/etc/cinder/cinder.conf",
"owner": "cinder",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/cinder-backup --config-file /etc/cinder/cinder.conf",
"config_files": [
{
"source": "/opt/kolla/config_files/cinder.conf",
"dest": "/etc/cinder/cinder.conf",
"owner": "cinder",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/cinder-scheduler --config-file /etc/cinder/cinder.conf",
"config_files": [
{
"source": "/opt/kolla/config_files/cinder.conf",
"dest": "/etc/cinder/cinder.conf",
"owner": "cinder",
"perm": "0600"
}
]
}

View File

@ -0,0 +1,11 @@
{
"command": "/usr/bin/cinder-volume --config-file /etc/cinder/cinder.conf",
"config_files": [
{
"source": "/opt/kolla/config_files/cinder.conf",
"dest": "/etc/cinder/cinder.conf",
"owner": "cinder",
"perm": "0600"
}
]
}

View File

@ -2,14 +2,12 @@
set -o errexit
CMD="/usr/bin/cinder-api"
ARGS="--config-file /etc/cinder/cinder.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.
@ -18,4 +16,4 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
exit 0
fi
exec $CMD $ARGS
exec $CMD

View File

@ -2,13 +2,11 @@
set -o errexit
CMD="/usr/bin/cinder-backup"
ARGS="--config-file /etc/cinder/cinder.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

View File

@ -2,13 +2,11 @@
set -o errexit
CMD="/usr/bin/cinder-scheduler"
ARGS="--config-file /etc/cinder/cinder.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

View File

@ -2,13 +2,11 @@
set -o errexit
CMD="/usr/bin/cinder-volume"
ARGS="--config-file /etc/cinder/cinder.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