Skip to content

Commit f44faa9

Browse files
committed
neutron: Template vpnaas config only when it is enabled
Closes-Bug: #2119733 Change-Id: I917437834dd159e107309584e84f5b14b72100d2 Signed-off-by: Michal Nasiadka <[email protected]> (cherry picked from commit 249c33f)
1 parent 0620a63 commit f44faa9

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

ansible/roles/neutron/tasks/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
dest: "{{ node_config_directory }}/{{ item.key }}/neutron_vpnaas.conf"
119119
mode: "0660"
120120
when:
121+
- enable_neutron_vpnaas | bool
121122
- item.key in services_need_neutron_vpnaas_conf
122123
with_dict: "{{ neutron_services | select_services_enabled_and_mapped_to_host }}"
123124

ansible/roles/neutron/templates/neutron-l3-agent-wrapper.sh.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ neutron-netns-cleanup \
1717

1818
neutron-l3-agent \
1919
--config-file /etc/neutron/neutron.conf \
20-
--config-file /etc/neutron/neutron_vpnaas.conf \
21-
--config-file /etc/neutron/l3_agent.ini{% if enable_neutron_fwaas | bool %} \
20+
--config-file /etc/neutron/l3_agent.ini{% if enable_neutron_vpnaas | bool %} \
21+
--config-file /etc/neutron/neutron_vpnaas.conf{% endif %}{% if enable_neutron_fwaas | bool %} \
2222
--config-file /etc/neutron/fwaas_driver.ini{% endif %}

ansible/roles/neutron/templates/neutron-l3-agent.json.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"dest": "/etc/neutron/neutron.conf",
1313
"owner": "neutron",
1414
"perm": "0600"
15-
},
15+
}{% if enable_neutron_vpnaas | bool %},
1616
{
1717
"source": "{{ container_config_directory }}/neutron_vpnaas.conf",
1818
"dest": "/etc/neutron/neutron_vpnaas.conf",
1919
"owner": "neutron",
2020
"perm": "0600"
21-
}{% if enable_neutron_fwaas | bool %},
21+
}{% endif %}{% if enable_neutron_fwaas | bool %},
2222
{
2323
"source": "{{ container_config_directory }}/fwaas_driver.ini",
2424
"dest": "/etc/neutron/fwaas_driver.ini",

ansible/roles/neutron/templates/neutron-server.json.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"command": "neutron-server --config-file /etc/neutron/neutron.conf {% if neutron_plugin_agent in ['openvswitch', 'linuxbridge', 'ovn'] %} --config-file /etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/neutron_vpnaas.conf {% elif neutron_plugin_agent in ['vmware_nsxv', 'vmware_nsxv3', 'vmware_nsxp', 'vmware_dvs'] %} --config-file /etc/neutron/plugins/vmware/nsx.ini {% endif %}{% if enable_neutron_fwaas | bool %}--config-file /etc/neutron/fwaas_driver.ini{% endif %}",
2+
"command": "neutron-server --config-file /etc/neutron/neutron.conf {% if neutron_plugin_agent in ['openvswitch', 'linuxbridge', 'ovn'] %} --config-file /etc/neutron/plugins/ml2/ml2_conf.ini {% if enable_neutron_vpnaas | bool %}--config-file /etc/neutron/neutron_vpnaas.conf{% endif %}{% elif neutron_plugin_agent in ['vmware_nsxv', 'vmware_nsxv3', 'vmware_nsxp', 'vmware_dvs'] %} --config-file /etc/neutron/plugins/vmware/nsx.ini {% endif %}{% if enable_neutron_fwaas | bool %}--config-file /etc/neutron/fwaas_driver.ini{% endif %}",
33
"config_files": [
44
{
55
"source": "{{ container_config_directory }}/neutron.conf",
@@ -15,12 +15,14 @@
1515
"perm": "0600"
1616
},
1717
{% endif %}
18+
{% if enable_neutron_vpnaas | bool %}
1819
{
1920
"source": "{{ container_config_directory }}/neutron_vpnaas.conf",
2021
"dest": "/etc/neutron/neutron_vpnaas.conf",
2122
"owner": "neutron",
2223
"perm": "0600"
2324
},
25+
{% endif %}
2426
{% if enable_neutron_taas | bool %}
2527
{
2628
"source": "{{ container_config_directory }}/neutron_taas.conf",
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
{% if enable_neutron_vpnaas | bool %}
21
[service_providers]
32
{% if neutron_plugin_agent == 'vmware_nsxv' %}
43
service_provider = VPN:vmware:vmware_nsx.services.vpnaas.nsxv.ipsec_driver.NSXvIPsecVpnDriver:default
54
{% else %}
65
service_provider = VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
76
{% endif %}
8-
{% endif %}

0 commit comments

Comments
 (0)