From f9d40a525e0b0fe01c9d1eb979fd464d0fd63969 Mon Sep 17 00:00:00 2001 From: Logan V Date: Sat, 30 Jul 2016 13:57:59 -0500 Subject: [PATCH] Allow Neutron services to specify config path An example is I80546b6deefe0878398716d173b7dcc36c3bef3a where the configuration needs to be dropped to /etc/calico. By adapting this task we can allow services to deploy configs to arbitrary paths instead of a statically set /etc/neutron. Change-Id: I8c4c7f513074fbd154ab253182b83227628d44ef --- defaults/main.yml | 8 ++++++++ .../notes/service-conf-path-b27cab31dbc72ad4.yaml | 6 ++++++ tasks/neutron_post_install.yml | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/service-conf-path-b27cab31dbc72ad4.yaml diff --git a/defaults/main.yml b/defaults/main.yml index a3fcd2c4..013509e2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -155,6 +155,7 @@ neutron_services: group: neutron_dhcp_agent service_name: neutron-dhcp-agent service_en: "{{ neutron_dhcp | bool }}" + service_conf_path: "/etc/neutron" service_conf: dhcp_agent.ini service_rootwrap: rootwrap.d/dhcp.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini --log-file=/var/log/neutron/neutron-dhcp-agent.log @@ -164,6 +165,7 @@ neutron_services: group: neutron_openvswitch_agent service_name: neutron-openvswitch-agent service_en: "{{ 'ml2.ovs' in neutron_plugin_type }}" + service_conf_path: "/etc/neutron" service_conf: plugins/ml2/openvswitch_agent.ini service_rootwrap: rootwrap.d/openvswitch-plugin.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --log-file=/var/log/neutron/neutron-openvswitch-agent.log @@ -173,6 +175,7 @@ neutron_services: group: neutron_linuxbridge_agent service_name: neutron-linuxbridge-agent service_en: "{{ neutron_plugin_type == 'ml2.lxb' }}" + service_conf_path: "/etc/neutron" service_conf: plugins/ml2/linuxbridge_agent.ini service_rootwrap: rootwrap.d/linuxbridge-plugin.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/plugins/ml2/linuxbridge_agent.ini --log-file=/var/log/neutron/neutron-linuxbridge-agent.log @@ -182,6 +185,7 @@ neutron_services: group: neutron_metadata_agent service_name: neutron-metadata-agent service_en: "{{ neutron_metadata | bool }}" + service_conf_path: "/etc/neutron" service_conf: metadata_agent.ini config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini --log-file=/var/log/neutron/neutron-metadata-agent.log config_overrides: "{{ neutron_metadata_agent_ini_overrides }}" @@ -190,6 +194,7 @@ neutron_services: group: neutron_metering_agent service_name: neutron-metering-agent service_en: "{{ neutron_metering | bool }}" + service_conf_path: "/etc/neutron" service_conf: metering_agent.ini config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metering_agent.ini --log-file=/var/log/neutron/neutron-metering-agent.log config_overrides: "{{ neutron_metering_agent_ini_overrides }}" @@ -198,6 +203,7 @@ neutron_services: group: neutron_l3_agent service_name: neutron-l3-agent service_en: "{{ neutron_l3 | bool }}" + service_conf_path: "/etc/neutron" service_conf: l3_agent.ini service_rootwrap: rootwrap.d/l3.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --log-file=/var/log/neutron/neutron-l3-agent.log @@ -207,6 +213,7 @@ neutron_services: group: neutron_lbaasv2_agent service_name: neutron-lbaasv2-agent service_en: "{{ neutron_lbaasv2 | bool }}" + service_conf_path: "/etc/neutron" service_conf: lbaas_agent.ini service_rootwrap: rootwrap.d/lbaas-haproxy.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/lbaas_agent.ini --log-file=/var/log/neutron/neutron-lbaasv2-agent.log @@ -216,6 +223,7 @@ neutron_services: group: neutron_l3_agent service_name: neutron-vpn-agent service_en: "{{ neutron_vpnaas | bool }}" + service_conf_path: "/etc/neutron" service_conf: vpnaas_agent.ini service_rootwrap: rootwrap.d/vpnaas.filters config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/vpnaas_agent.ini --log-file=/var/log/neutron/neutron-vpn-agent.log diff --git a/releasenotes/notes/service-conf-path-b27cab31dbc72ad4.yaml b/releasenotes/notes/service-conf-path-b27cab31dbc72ad4.yaml new file mode 100644 index 00000000..86a45bca --- /dev/null +++ b/releasenotes/notes/service-conf-path-b27cab31dbc72ad4.yaml @@ -0,0 +1,6 @@ +--- +features: + - A new variable is supported in the ``neutron_services`` dictionary called + ``service_conf_path``. This variable enables services to deploy their + config templates to paths outside of /etc/neutron by specifying a + directory using the new variable. diff --git a/tasks/neutron_post_install.yml b/tasks/neutron_post_install.yml index 7918d0ae..9eef9a39 100644 --- a/tasks/neutron_post_install.yml +++ b/tasks/neutron_post_install.yml @@ -65,7 +65,7 @@ - name: Generate neutron agent only Config config_template: src: "{{ item.value.service_conf }}.j2" - dest: "/etc/neutron/{{ item.value.service_conf }}" + dest: "{{ item.value.service_conf_path }}/{{ item.value.service_conf }}" owner: "{{ neutron_system_user_name }}" group: "{{ neutron_system_group_name }}" mode: "0644" @@ -76,6 +76,7 @@ - Restart neutron services when: - item.value.service_en | bool + - item.value.service_conf_path is defined - item.value.service_conf is defined - item.value.group in group_names