Make configurable the location where config files are merged

An operator may want to specify the location of custom config
files so that kolla can detect their location and merge
them with the default configs generated.

Partially implements: blueprint multi-project-config

Change-Id: Ibfb38d07a36dfa7fe25381adc34cc1d3cbe7d1e1
This commit is contained in:
Ryan Hallisey 2016-05-19 02:39:37 -04:00
parent c5f686ac43
commit 2da010a7b9
17 changed files with 112 additions and 109 deletions

View File

@ -6,6 +6,9 @@
# again. Persistent files allow for idempotency
container_config_directory: "/var/lib/kolla/config_files"
# The directory to merge custom config files the kolla's config files
node_custom_config: "/etc/kolla/config"
# The project to generate configuration files for
project: ""

View File

@ -24,8 +24,8 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/ceph.conf.j2"
- "/etc/kolla/config/ceph.conf"
- "/etc/kolla/config/ceph/{{ inventory_hostname }}/ceph.conf"
- "{{ node_custom_config }}/ceph.conf"
- "{{ node_custom_config }}/ceph/{{ inventory_hostname }}/ceph.conf"
dest: "{{ node_config_directory }}/{{ item }}/ceph.conf"
with_items:
- "ceph-mon"

View File

@ -26,12 +26,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/cinder.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/cinder.conf"
- "/etc/kolla/config/cinder/{{ item }}.conf"
- "/etc/kolla/config/cinder/{{ inventory_hostname }}/cinder.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/cinder.conf"
- "{{ node_custom_config }}/cinder/{{ item }}.conf"
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder.conf"
dest: "{{ node_config_directory }}/{{ item }}/cinder.conf"
with_items:
- "cinder-api"

View File

@ -20,12 +20,12 @@
service_name: "{{ item.service }}"
sources:
- "{{ role_path }}/templates/{{ item.service }}.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/glance.conf"
- "/etc/kolla/config/glance/{{ item.service }}.conf"
- "/etc/kolla/config/glance/{{ inventory_hostname }}/{{ item.service }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/glance.conf"
- "{{ node_custom_config }}/glance/{{ item.service }}.conf"
- "{{ node_custom_config }}/glance/{{ inventory_hostname }}/{{ item.service }}.conf"
dest: "{{ node_config_directory }}/{{ item.service }}/{{ item.service }}.conf"
when: inventory_hostname in groups[item.group]
with_items: "{{ glance_service_groups }}"

View File

@ -31,12 +31,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/heat.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/heat.conf"
- "/etc/kolla/config/heat/{{ item }}.conf"
- "/etc/kolla/config/heat/{{ inventory_hostname }}/heat.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/heat.conf"
- "{{ node_custom_config }}/heat/{{ item }}.conf"
- "{{ node_custom_config }}/heat/{{ inventory_hostname }}/heat.conf"
dest: "{{ node_config_directory }}/{{ item }}/heat.conf"
with_items:
- "heat-api"

View File

@ -26,12 +26,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/ironic.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/ironic.conf"
- "/etc/kolla/config/ironic/{{ item }}.conf"
- "/etc/kolla/config/ironic/{{ inventory_hostname }}/ironic.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/ironic.conf"
- "{{ node_custom_config }}/ironic/{{ item }}.conf"
- "{{ node_custom_config }}/ironic/{{ inventory_hostname }}/ironic.conf"
dest: "{{ node_config_directory }}/{{ item }}/ironic.conf"
with_items:
- "ironic-api"

View File

@ -20,11 +20,11 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/keystone.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/keystone.conf"
- "/etc/kolla/config/keystone/{{ inventory_hostname }}/keystone.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/keystone.conf"
- "{{ node_custom_config }}/keystone/{{ inventory_hostname }}/keystone.conf"
dest: "{{ node_config_directory }}/{{ item }}/keystone.conf"
with_items:
- "keystone"

View File

@ -22,12 +22,12 @@
service_name: "magnum-api"
sources:
- "{{ role_path }}/templates/magnum.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/magnum.conf"
- "/etc/kolla/config/magnum/{{ item }}.conf"
- "/etc/kolla/config/magnum/{{ inventory_hostname }}/magnum.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/magnum.conf"
- "{{ node_custom_config }}/magnum/{{ item }}.conf"
- "{{ node_custom_config }}/magnum/{{ inventory_hostname }}/magnum.conf"
dest: "{{ node_config_directory }}/{{ item }}/magnum.conf"
with_items:
- "magnum-api"

View File

@ -24,12 +24,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/manila.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/manila.conf"
- "/etc/kolla/config/manila/{{ item }}.conf"
- "/etc/kolla/config/manila/{{ inventory_hostname }}/manila.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/manila.conf"
- "{{ node_custom_config }}/manila/{{ item }}.conf"
- "{{ node_custom_config }}/manila/{{ inventory_hostname }}/manila.conf"
dest: "{{ node_config_directory }}/{{ item }}/manila.conf"
with_items:
- "manila-api"

View File

@ -20,8 +20,8 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/galera.cnf.j2"
- "/etc/kolla/config/galera.cnf"
- "/etc/kolla/config/mariadb/{{ inventory_hostname }}/galera.cnf"
- "{{ node_custom_config }}/galera.cnf"
- "{{ node_custom_config }}/mariadb/{{ inventory_hostname }}/galera.cnf"
dest: "{{ node_config_directory }}/{{ item }}/galera.cnf"
with_items:
- "mariadb"

View File

@ -24,12 +24,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/mistral.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/mistral.conf"
- "/etc/kolla/config/mistral/{{ item }}.conf"
- "/etc/kolla/config/mistral/{{ inventory_hostname }}/mistral.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/mistral.conf"
- "{{ node_custom_config }}/mistral/{{ item }}.conf"
- "{{ node_custom_config }}/mistral/{{ inventory_hostname }}/mistral.conf"
dest: "{{ node_config_directory }}/{{ item }}/mistral.conf"
with_items:
- "mistral-api"

View File

@ -22,12 +22,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/murano.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/murano.conf"
- "/etc/kolla/config/murano/{{ item }}.conf"
- "/etc/kolla/config/murano/{{ inventory_hostname }}/murano.conf"
- "{{ node_config_directory }}/config/global.conf"
- "{{ node_config_directory }}/config/database.conf"
- "{{ node_config_directory }}/config/messaging.conf"
- "{{ node_config_directory }}/config/murano.conf"
- "{{ node_config_directory }}/config/murano/{{ item }}.conf"
- "{{ node_config_directory }}/config/murano/{{ inventory_hostname }}/murano.conf"
dest: "{{ node_config_directory }}/{{ item }}/murano.conf"
with_items:
- "murano-api"

View File

@ -20,12 +20,12 @@
merge_configs:
sources:
- "{{ role_path }}/templates/neutron.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/neutron.conf"
- "/etc/kolla/config/neutron/{{ item }}.conf"
- "/etc/kolla/config/neutron/{{ inventory_hostname }}/neutron.conf"
- "{{ node_config_directory }}/config/global.conf"
- "{{ node_config_directory }}/config/database.conf"
- "{{ node_config_directory }}/config/messaging.conf"
- "{{ node_config_directory }}/config/neutron.conf"
- "{{ node_config_directory }}/config/neutron/{{ item }}.conf"
- "{{ node_config_directory }}/config/neutron/{{ inventory_hostname }}/neutron.conf"
dest: "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/neutron.conf"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:
@ -36,8 +36,8 @@
merge_configs:
sources:
- "{{ role_path }}/templates/ml2_conf.ini.j2"
- "/etc/kolla/config/neutron/ml2_conf.ini"
- "/etc/kolla/config/neutron/{{ inventory_hostname }}/neutron.conf"
- "{{ node_config_directory }}/config/neutron/ml2_conf.ini"
- "{{ node_config_directory }}/config/neutron/{{ inventory_hostname }}/neutron.conf"
dest: "{{ node_config_directory }}/neutron-openvswitch-agent-fake-{{ item }}/ml2_conf.ini"
with_sequence: start=1 end={{ num_nova_fake_per_node }}
when:

View File

@ -44,12 +44,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/neutron.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/neutron.conf"
- "/etc/kolla/config/neutron/{{ item }}.conf"
- "/etc/kolla/config/neutron/{{ inventory_hostname }}/neutron.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/neutron.conf"
- "{{ node_custom_config }}/neutron/{{ item }}.conf"
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron.conf"
dest: "{{ node_config_directory }}/{{ item }}/neutron.conf"
with_items:
- "neutron-dhcp-agent"
@ -65,8 +65,8 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/ml2_conf.ini.j2"
- "/etc/kolla/config/neutron/ml2_conf.ini"
- "/etc/kolla/config/neutron/{{ inventory_hostname }}/neutron.conf"
- "{{ node_custom_config }}/neutron/ml2_conf.ini"
- "{{ node_custom_config }}/neutron/{{ inventory_hostname }}/neutron.conf"
dest: "{{ node_config_directory }}/{{ item }}/ml2_conf.ini"
with_items:
- "neutron-dhcp-agent"
@ -82,7 +82,7 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/dhcp_agent.ini.j2"
- "/etc/kolla/config/neutron/dhcp_agent.ini"
- "{{ node_custom_config }}/neutron/dhcp_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/dhcp_agent.ini"
with_items:
- "neutron-dhcp-agent"
@ -100,7 +100,7 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/l3_agent.ini.j2"
- "/etc/kolla/config/neutron/l3_agent.ini"
- "{{ node_custom_config }}/neutron/l3_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/l3_agent.ini"
with_items:
- "neutron-l3-agent"
@ -111,7 +111,7 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/fwaas_driver.ini.j2"
- "/etc/kolla/config/neutron/fwaas_driver.ini"
- "{{ node_custom_config }}/neutron/fwaas_driver.ini"
dest: "{{ node_config_directory }}/{{ item }}/fwaas_driver.ini"
with_items:
- "neutron-l3-agent"
@ -122,7 +122,7 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/metadata_agent.ini.j2"
- "/etc/kolla/config/neutron/metadata_agent.ini"
- "{{ node_custom_config }}/neutron/metadata_agent.ini"
dest: "{{ node_config_directory }}/{{ item }}/metadata_agent.ini"
with_items:
- "neutron-metadata-agent"

View File

@ -18,11 +18,11 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/nova.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/nova.conf"
- "/etc/kolla/config/nova/{{ item }}.conf"
- "/etc/kolla/config/nova/{{ inventory_hostname }}/nova.conf"
- "{{ node_config_directory }}/config/global.conf"
- "{{ node_config_directory }}/config/database.conf"
- "{{ node_config_directory }}/config/messaging.conf"
- "{{ node_config_directory }}/config/nova.conf"
- "{{ node_config_directory }}/config/nova/{{ item }}.conf"
- "{{ node_config_directory }}/config/nova/{{ inventory_hostname }}/nova.conf"
dest: "{{ node_config_directory }}/nova-compute-fake-{{ item }}/nova.conf"
with_sequence: start=1 end={{ num_nova_fake_per_node }}

View File

@ -49,12 +49,12 @@
service_name: "{{ item }}"
sources:
- "{{ role_path }}/templates/nova.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/database.conf"
- "/etc/kolla/config/messaging.conf"
- "/etc/kolla/config/nova.conf"
- "/etc/kolla/config/nova/{{ item }}.conf"
- "/etc/kolla/config/nova/{{ inventory_hostname }}/nova.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/database.conf"
- "{{ node_custom_config }}/messaging.conf"
- "{{ node_custom_config }}/nova.conf"
- "{{ node_custom_config }}/nova/{{ item }}.conf"
- "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf"
dest: "{{ node_config_directory }}/{{ item }}/nova.conf"
with_items:
- "nova-api"

View File

@ -49,10 +49,10 @@
service_name: "swift-{{ item }}"
sources:
- "{{ role_path }}/templates/swift.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
- "/etc/kolla/config/swift/{{ inventory_hostname }}/{{ item }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/swift.conf"
- "{{ node_custom_config }}/swift/{{ item }}.conf"
- "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
dest: "{{ node_config_directory }}/swift-{{ item }}/swift.conf"
with_items:
- "account-auditor"
@ -76,10 +76,10 @@
service_name: "swift-{{ item }}"
sources:
- "{{ role_path }}/templates/account.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift/account.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
- "/etc/kolla/config/swift/{{ inventory_hostname }}/{{ item }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/swift/account.conf"
- "{{ node_custom_config }}/swift/{{ item }}.conf"
- "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
dest: "{{ node_config_directory }}/swift-{{ item }}/{{ item }}.conf"
with_items:
- "account-auditor"
@ -93,10 +93,10 @@
service_name: "swift-{{ item }}"
sources:
- "{{ role_path }}/templates/container.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift/container.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
- "/etc/kolla/config/swift/{{ inventory_hostname }}/{{ item }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/swift/container.conf"
- "{{ node_custom_config }}/swift/{{ item }}.conf"
- "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
dest: "{{ node_config_directory }}/swift-{{ item }}/{{ item }}.conf"
with_items:
- "container-auditor"
@ -110,10 +110,10 @@
service_name: "swift-{{ item }}"
sources:
- "{{ role_path }}/templates/object.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift/object.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
- "/etc/kolla/config/swift/{{ inventory_hostname }}/{{ item }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/swift/object.conf"
- "{{ node_custom_config }}/swift/{{ item }}.conf"
- "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
dest: "{{ node_config_directory }}/swift-{{ item }}/{{ item }}.conf"
with_items:
- "object-auditor"
@ -128,9 +128,9 @@
service_name: "swift-{{ item }}"
sources:
- "{{ role_path }}/templates/proxy-server.conf.j2"
- "/etc/kolla/config/global.conf"
- "/etc/kolla/config/swift/{{ item }}.conf"
- "/etc/kolla/config/swift/{{ inventory_hostname }}/{{ item }}.conf"
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/swift/{{ item }}.conf"
- "{{ node_custom_config }}/swift/{{ inventory_hostname }}/{{ item }}.conf"
dest: "{{ node_config_directory }}/swift-{{ item }}/{{ item }}.conf"
with_items:
- "proxy-server"
@ -142,7 +142,7 @@
- name: Copying over Swift ring files
copy:
src: "/etc/kolla/config/swift/{{ item }}"
src: "{{ node_custom_config }}/swift/{{ item }}"
dest: "{{ node_config_directory }}/swift/{{ item }}"
backup: yes
with_items: