From 9d82796da2ae30be4eb3dfcc9612c6947f882ded Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 3 Jan 2017 21:57:14 -0500 Subject: docker: eliminate copy-json.py in favor of json-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch rewires how we configure the Kolla external config files via Heat templates and uses a more simple json-file heat hook to directly write out Kolla config files to disk. By using a heat hook instead of a shell script we can avoid Json conversion issues. Additionally, This generic json file hook will be useful for other ad-hoc Json file configuration within the TripleO docker architecture. Co-Authored-By: Martin André Change-Id: I8c72a4a9a7022f722bfe1cef3e18517605720cce Depends-On: I2b372ac2e291339e436202c9fe58a681ed6a743f Depends-On: Id3f779b11e23fd3122ef29b7ccbae116667d4520 --- docker/services/README.rst | 5 +++++ docker/services/neutron-ovs-agent.yaml | 16 ++++++++++++++++ docker/services/nova-compute.yaml | 12 ++++++++++++ docker/services/nova-libvirt.yaml | 8 ++++++++ docker/services/services.yaml | 2 ++ 5 files changed, 43 insertions(+) (limited to 'docker/services') diff --git a/docker/services/README.rst b/docker/services/README.rst index 8d1f9e86..60719bfc 100644 --- a/docker/services/README.rst +++ b/docker/services/README.rst @@ -32,6 +32,11 @@ are re-asserted when applying latter ones. * config_settings: Custom hiera settings for this service. These are used to generate configs. + * kolla_config: Contains YAML that represents how to map config files + into the kolla container. This config file is typically mapped into + the container itself at the /var/lib/kolla/config_files/config.json + location and drives how kolla's external config mechanisms work. + * step_config: A puppet manifest that is used to step through the deployment sequence. Each sequence is given a "step" (via hiera('step') that provides information for when puppet classes should activate themselves. diff --git a/docker/services/neutron-ovs-agent.yaml b/docker/services/neutron-ovs-agent.yaml index 1c9e60db..0a061f6c 100644 --- a/docker/services/neutron-ovs-agent.yaml +++ b/docker/services/neutron-ovs-agent.yaml @@ -43,6 +43,22 @@ outputs: config_settings: {get_attr: [NeutronOvsAgentBase, role_data, config_settings]} step_config: {get_attr: [NeutronOvsAgentBase, role_data, step_config]} puppet_tags: neutron_config,neutron_agent_ovs,neutron_plugin_ml2 + kolla_config: + /var/lib/etc-data/json-config/neutron-openvswitch-agent.json: + command: /usr/bin/neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini + config_files: + - dest: /etc/neutron/neutron.conf + owner: neutron + perm: '0600' + source: /var/lib/kolla/config_files/neutron.conf + - dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini + owner: neutron + perm: '0600' + source: /var/lib/kolla/config_files/openvswitch_agent.ini + - dest: /etc/neutron/plugins/ml2/ml2_conf.ini + owner: neutron + perm: '0600' + source: /var/lib/kolla/config_files/ml2_conf.ini docker_config: step_1: neutronovsagent: diff --git a/docker/services/nova-compute.yaml b/docker/services/nova-compute.yaml index c695c94d..e765609e 100644 --- a/docker/services/nova-compute.yaml +++ b/docker/services/nova-compute.yaml @@ -41,6 +41,18 @@ outputs: config_settings: {get_attr: [NovaComputeBase, role_data, config_settings]} step_config: {get_attr: [NovaComputeBase, role_data, step_config]} puppet_tags: nova_config,nova_paste_api_ini + kolla_config: + /var/lib/etc-data/json-config/nova-compute.json: + command: /usr/bin/nova-compute --config-file /etc/nova/nova.conf --config-file /etc/nova/rootwrap.conf + config_files: + - dest: /etc/nova/nova.conf + owner: nova + perm: '0600' + source: /var/lib/kolla/config_files/nova.conf + - dest: /etc/nova/rootwrap.conf + owner: nova + perm: '0600' + source: /var/lib/kolla/config_files/rootwrap.conf docker_config: step_1: novacompute: diff --git a/docker/services/nova-libvirt.yaml b/docker/services/nova-libvirt.yaml index a40a21fd..004d624a 100644 --- a/docker/services/nova-libvirt.yaml +++ b/docker/services/nova-libvirt.yaml @@ -41,6 +41,14 @@ outputs: config_settings: {get_attr: [NovaLibvirtBase, role_data, config_settings]} step_config: {get_attr: [NovaLibvirtBase, role_data, step_config]} puppet_tags: nova_config + kolla_config: + /var/lib/etc-data/json-config/nova-libvirt.json: + command: /usr/sbin/libvirtd --config /etc/libvirt/libvirtd.conf + config_files: + - dest: /etc/libvirt/libvirtd.conf + owner: root + perm: '0644' + source: /var/lib/kolla/config_files/libvirtd.conf docker_config: step_1: nova_libvirt: diff --git a/docker/services/services.yaml b/docker/services/services.yaml index 3d51eb19..8c31107f 100644 --- a/docker/services/services.yaml +++ b/docker/services/services.yaml @@ -68,6 +68,8 @@ outputs: step_config: {get_attr: [PuppetServices, role_data, step_config]} puppet_tags: {list_join: [",", {get_attr: [ServiceChain, role_data, puppet_tags]}]} + kolla_config: + map_merge: {get_attr: [ServiceChain, role_data, kolla_config]} docker_config: step_1: {map_merge: {get_attr: [ServiceChain, role_data, docker_config, step_1]}} step_2: {map_merge: {get_attr: [ServiceChain, role_data, docker_config, step_2]}} -- cgit 1.2.3-korg