1 # == Class: neutron::agents::l3
3 # Installs and configures the Neutron L3 service
5 # TODO: create ability to have multiple L3 services
10 # (optional) The state of the package
14 # (optional) The state of the service
18 # (optional) Whether to start/stop the service
22 # (optional) Print debug info in logs
25 # [*external_network_bridge*]
26 # (optional) The name of the external bridge
30 # (optional) Enable overlapping IPs / network namespaces
33 # [*interface_driver*]
34 # (optional) Driver to interface with neutron
35 # Defaults to OVSInterfaceDriver
38 # (optional) The ID of the external router in neutron
41 # [*gateway_external_network_id*]
42 # (optional) The ID of the external network in neutron
45 # [*handle_internal_only_routers*]
46 # (optional) L3 Agent will handle non-external routers
50 # (optional) The port of the metadata server
54 # (optional) Send this many gratuitous ARPs for HA setup. Set it below or equal to 0
55 # to disable this feature.
58 # [*periodic_interval*]
59 # (optional) seconds between re-sync routers' data if needed
62 # [*periodic_fuzzy_delay*]
63 # (optional) seconds to start to sync routers' data after starting agent
66 # [*enable_metadata_proxy*]
67 # (optional) can be set to False if the Nova metadata server is not available
70 # [*network_device_mtu*]
71 # (optional) The MTU size for the interfaces managed by the L3 agent
73 # Should be deprecated in the next major release in favor of a global parameter
75 # [*router_delete_namespaces*]
76 # (optional) namespaces can be deleted cleanly on the host running the L3 agent
80 # (optional) Enabled or not HA for L3 agent.
83 # [*ha_vrrp_auth_type*]
84 # (optional) VRRP authentication type. Can be AH or PASS.
87 # [*ha_vrrp_auth_password*]
88 # (optional) VRRP authentication password. Required if ha_enabled = true.
91 # [*ha_vrrp_advert_int*]
92 # (optional) The advertisement interval in seconds.
96 # (optional) The working mode for the agent.
97 # 'legacy': default behavior (without DVR)
98 # 'dvr': enable DVR for an L3 agent running on compute node (DVR in production)
99 # 'dvr_snat': enable DVR with centralized SNAT support (DVR for single-host, for testing only)
100 # Defaults to 'legacy'
102 # [*allow_automatic_l3agent_failover*]
103 # (optional) Automatically reschedule routers from offline L3 agents to online
105 # This is another way to run virtual routers in highly available way but with slow
106 # failover performances compared to Keepalived feature in Neutron L3 Agent.
107 # Defaults to 'False'
109 class neutron::agents::l3 (
110 $package_ensure = 'present',
112 $manage_service = true,
114 $external_network_bridge = 'br-ex',
115 $use_namespaces = true,
116 $interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
118 $gateway_external_network_id = undef,
119 $handle_internal_only_routers = true,
120 $metadata_port = '9697',
121 $send_arp_for_ha = '3',
122 $periodic_interval = '40',
123 $periodic_fuzzy_delay = '5',
124 $enable_metadata_proxy = true,
125 $network_device_mtu = undef,
126 $router_delete_namespaces = false,
128 $ha_vrrp_auth_type = 'PASS',
129 $ha_vrrp_auth_password = undef,
130 $ha_vrrp_advert_int = '3',
131 $agent_mode = 'legacy',
132 $allow_automatic_l3agent_failover = false,
135 include neutron::params
137 Neutron_config<||> ~> Service['neutron-l3']
138 Neutron_l3_agent_config<||> ~> Service['neutron-l3']
141 neutron_l3_agent_config {
142 'DEFAULT/ha_vrrp_auth_type': value => $ha_vrrp_auth_type;
143 'DEFAULT/ha_vrrp_auth_password': value => $ha_vrrp_auth_password;
144 'DEFAULT/ha_vrrp_advert_int': value => $ha_vrrp_advert_int;
148 neutron_l3_agent_config {
149 'DEFAULT/debug': value => $debug;
150 'DEFAULT/external_network_bridge': value => $external_network_bridge;
151 'DEFAULT/use_namespaces': value => $use_namespaces;
152 'DEFAULT/interface_driver': value => $interface_driver;
153 'DEFAULT/router_id': value => $router_id;
154 'DEFAULT/gateway_external_network_id': value => $gateway_external_network_id;
155 'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers;
156 'DEFAULT/metadata_port': value => $metadata_port;
157 'DEFAULT/send_arp_for_ha': value => $send_arp_for_ha;
158 'DEFAULT/periodic_interval': value => $periodic_interval;
159 'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay;
160 'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy;
161 'DEFAULT/router_delete_namespaces': value => $router_delete_namespaces;
162 'DEFAULT/agent_mode': value => $agent_mode;
163 'DEFAULT/allow_automatic_l3agent_failover': value => $allow_automatic_l3agent_failover;
166 if $network_device_mtu {
167 warning('The neutron::l3_agent::newtork_device_mtu parameter is deprecated, use neutron::newtork_device_mtu instead.')
168 neutron_l3_agent_config {
169 'DEFAULT/network_device_mtu': value => $network_device_mtu;
172 warning('The neutron::l3_agent::newtork_device_mtu parameter is deprecated, use neutron::newtork_device_mtu instead.')
173 neutron_l3_agent_config {
174 'DEFAULT/network_device_mtu': ensure => absent;
178 if $::neutron::params::l3_agent_package {
179 Package['neutron-l3'] -> Neutron_l3_agent_config<||>
180 package { 'neutron-l3':
181 ensure => $package_ensure,
182 name => $::neutron::params::l3_agent_package,
183 require => Package['neutron'],
186 # Some platforms (RedHat) does not provide a neutron L3 agent package.
187 # The neutron L3 agent config file is provided by the neutron package.
188 Package['neutron'] -> Neutron_l3_agent_config<||>
193 $service_ensure = 'running'
195 $service_ensure = 'stopped'
199 service { 'neutron-l3':
200 ensure => $service_ensure,
201 name => $::neutron::params::l3_agent_service,
203 require => Class['neutron'],