Replace config-external with a JSON file for Keystone
Change-Id: I4c403edb7cd16f587f30a313c1943f070512eda3 Partially-Implements: blueprint replace-config-external
This commit is contained in:
parent
a0bffb2581
commit
180e8c3331
@ -43,7 +43,7 @@
|
|||||||
insecure_registry: "{{ docker_insecure_registry }}"
|
insecure_registry: "{{ docker_insecure_registry }}"
|
||||||
name: bootstrap_keystone
|
name: bootstrap_keystone
|
||||||
image: "{{ keystone_image_full }}"
|
image: "{{ keystone_image_full }}"
|
||||||
volumes: "{{ node_config_directory }}/keystone/:/opt/kolla/keystone/:ro"
|
volumes: "{{ node_config_directory }}/keystone/:/opt/kolla/config_files/:ro"
|
||||||
env:
|
env:
|
||||||
KOLLA_BOOTSTRAP:
|
KOLLA_BOOTSTRAP:
|
||||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
- "{{ node_templates_directory }}/keystone/keystone.conf_augment"
|
- "{{ node_templates_directory }}/keystone/keystone.conf_augment"
|
||||||
config_dest: "{{ node_config_directory }}/keystone/keystone.conf"
|
config_dest: "{{ node_config_directory }}/keystone/keystone.conf"
|
||||||
|
|
||||||
|
- name: Copying over Keystone JSON configuration file
|
||||||
|
template:
|
||||||
|
src: "roles/keystone/templates/keystone.json.j2"
|
||||||
|
dest: "{{ node_config_directory }}/keystone/config.json"
|
||||||
|
|
||||||
- name: Copying over config(s)
|
- name: Copying over config(s)
|
||||||
template:
|
template:
|
||||||
src: "wsgi-keystone.conf.j2"
|
src: "wsgi-keystone.conf.j2"
|
||||||
|
@ -13,6 +13,6 @@
|
|||||||
insecure_registry: "{{ docker_insecure_registry }}"
|
insecure_registry: "{{ docker_insecure_registry }}"
|
||||||
name: keystone
|
name: keystone
|
||||||
image: "{{ keystone_image_full }}"
|
image: "{{ keystone_image_full }}"
|
||||||
volumes: "{{ node_config_directory }}/keystone/:/opt/kolla/keystone/:ro"
|
volumes: "{{ node_config_directory }}/keystone/:/opt/kolla/config_files/:ro"
|
||||||
env:
|
env:
|
||||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
|
19
ansible/roles/keystone/templates/keystone.json.j2
Normal file
19
ansible/roles/keystone/templates/keystone.json.j2
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{% set keystone_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %}
|
||||||
|
{% set keystone_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %}
|
||||||
|
{
|
||||||
|
"command": "/usr/sbin/{{ keystone_cmd }}",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "/opt/kolla/config_files/keystone.conf",
|
||||||
|
"dest": "/etc/keystone/keystone.conf",
|
||||||
|
"owner": "keystone",
|
||||||
|
"perm": "0600"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "/opt/kolla/config_files/wsgi-keystone.conf",
|
||||||
|
"dest": "/etc/{{ keystone_dir }}/wsgi-keystone.conf",
|
||||||
|
"owner": "keystone",
|
||||||
|
"perm": "0644"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -7,24 +7,18 @@ source /opt/kolla/kolla-common.sh
|
|||||||
|
|
||||||
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
|
if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \
|
||||||
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
|
"${KOLLA_BASE_DISTRO}" == "debian" ]]; then
|
||||||
CMD="/usr/sbin/apache2"
|
|
||||||
ARGS="-DFOREGROUND"
|
|
||||||
|
|
||||||
# Loading Apache2 ENV variables
|
# Loading Apache2 ENV variables
|
||||||
source /etc/apache2/envvars
|
source /etc/apache2/envvars
|
||||||
else
|
|
||||||
CMD="/usr/sbin/httpd"
|
|
||||||
ARGS="-DFOREGROUND"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 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.
|
||||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||||
su -s /bin/sh -c "keystone-manage db_sync" keystone
|
su -s /bin/sh -c "keystone-manage db_sync" keystone
|
||||||
|
|
||||||
# Start the api to set initial endpoint and users with the admin_token
|
# Start the api to set initial endpoint and users with the admin_token
|
||||||
$CMD
|
$CMD
|
||||||
sleep 5
|
sleep 5
|
||||||
@ -42,4 +36,6 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ARGS="-DFOREGROUND"
|
||||||
|
echo "Running command: ${CMD} ${ARGS}"
|
||||||
exec $CMD $ARGS
|
exec $CMD $ARGS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user