Add neutron L3 agent resource
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
4a9fee81e8
commit
fa52977697
@ -254,11 +254,19 @@ def setup_resources():
|
||||
signals.connect(node1, neutron_agents_ovs)
|
||||
|
||||
# NEUTRON DHCP, L3, metadata agents
|
||||
|
||||
neutron_agents_dhcp = vr.create('neutron_agents_dhcp', 'resources/neutron_agents_dhcp_puppet', {
|
||||
'use_namespaces': False,
|
||||
})[0]
|
||||
signals.connect(node1, neutron_agents_dhcp)
|
||||
neutron_agents_l3 = vr.create('neutron_agents_l3', 'resources/neutron_agents_l3_puppet', {
|
||||
# TODO(bogdando) these should come from the node network resource
|
||||
'use_namespaces': False,
|
||||
'metadata_port': 8775,
|
||||
'external_network_bridge': 'br-floating',
|
||||
# The ID of the external router in neutron as 'router_id' input
|
||||
# The ID of the external network in neutron as 'gateway_external_network_id'
|
||||
})[0]
|
||||
signals.connect(node1, neutron_agents_l3)
|
||||
|
||||
# NEUTRON FOR COMPUTE (node2)
|
||||
# Deploy chain neutron -> (plugins) -> ( agents )
|
||||
|
@ -1,12 +1,11 @@
|
||||
# Neutron DHCP agent puppet resource
|
||||
|
||||
Setups Neutron DHCP agent.
|
||||
Installs and configures the Neutron DHCP service
|
||||
|
||||
# Parameters
|
||||
|
||||
https://github.com/openstack/puppet-neutron/blob/5.1.0/manifests/agents/dhcp.pp
|
||||
|
||||
|
||||
``package_ensure``
|
||||
(optional) Ensure state for package. Defaults to 'present'.
|
||||
|
||||
|
100
resources/neutron_agents_l3_puppet/README.md
Normal file
100
resources/neutron_agents_l3_puppet/README.md
Normal file
@ -0,0 +1,100 @@
|
||||
# Neutron L3 agent puppet resource
|
||||
|
||||
Installs and configures the Neutron L3 service
|
||||
TODO: create ability to have multiple L3 services
|
||||
|
||||
# Parameters
|
||||
|
||||
https://github.com/openstack/puppet-neutron/blob/5.1.0/manifests/agents/l3.pp
|
||||
|
||||
``package_ensure``
|
||||
(optional) The state of the package
|
||||
Defaults to present
|
||||
|
||||
``debug``
|
||||
(optional) Print debug info in logs
|
||||
Defaults to false
|
||||
|
||||
``external_network_bridge``
|
||||
(optional) The name of the external bridge
|
||||
Defaults to br-ex
|
||||
|
||||
``use_namespaces``
|
||||
(optional) Enable overlapping IPs / network namespaces
|
||||
Defaults to false
|
||||
|
||||
``interface_driver``
|
||||
(optional) Driver to interface with neutron
|
||||
Defaults to OVSInterfaceDriver
|
||||
|
||||
``router_id``
|
||||
(optional) The ID of the external router in neutron
|
||||
Defaults to blank
|
||||
|
||||
``gateway_external_network_id``
|
||||
(optional) The ID of the external network in neutron
|
||||
Defaults to blank
|
||||
|
||||
``handle_internal_only_routers``
|
||||
(optional) L3 Agent will handle non-external routers
|
||||
Defaults to true
|
||||
|
||||
``metadata_port``
|
||||
(optional) The port of the metadata server
|
||||
Defaults to 9697
|
||||
|
||||
``send_arp_for_ha``
|
||||
(optional) Send this many gratuitous ARPs for HA setup. Set it below or equal to 0
|
||||
to disable this feature.
|
||||
Defaults to 3
|
||||
|
||||
``periodic_interval``
|
||||
(optional) seconds between re-sync routers' data if needed
|
||||
Defaults to 40
|
||||
|
||||
``periodic_fuzzy_delay``
|
||||
(optional) seconds to start to sync routers' data after starting agent
|
||||
Defaults to 5
|
||||
|
||||
``enable_metadata_proxy``
|
||||
(optional) can be set to False if the Nova metadata server is not available
|
||||
Defaults to True
|
||||
|
||||
``network_device_mtu``
|
||||
(optional) The MTU size for the interfaces managed by the L3 agent
|
||||
Defaults to undef
|
||||
Should be deprecated in the next major release in favor of a global parameter
|
||||
|
||||
``router_delete_namespaces``
|
||||
(optional) namespaces can be deleted cleanly on the host running the L3 agent
|
||||
Defaults to False
|
||||
|
||||
``ha_enabled``
|
||||
(optional) Enabled or not HA for L3 agent.
|
||||
Defaults to false
|
||||
|
||||
``ha_vrrp_auth_type``
|
||||
(optional) VRRP authentication type. Can be AH or PASS.
|
||||
Defaults to "PASS"
|
||||
|
||||
``ha_vrrp_auth_password``
|
||||
(optional) VRRP authentication password. Required if ha_enabled = true.
|
||||
Defaults to undef
|
||||
|
||||
``ha_vrrp_advert_int``
|
||||
(optional) The advertisement interval in seconds.
|
||||
Defaults to '2'
|
||||
|
||||
``agent_mode``
|
||||
(optional) The working mode for the agent.
|
||||
'legacy': default behavior (without DVR)
|
||||
'dvr': enable DVR for an L3 agent running on compute node (DVR in production)
|
||||
'dvr_snat': enable DVR with centralized SNAT support (DVR for single-host, for testing only)
|
||||
Defaults to 'legacy'
|
||||
|
||||
``allow_automatic_l3agent_failover``
|
||||
(optional) Automatically reschedule routers from offline L3 agents to online
|
||||
L3 agents.
|
||||
This is another way to run virtual routers in highly available way but with slow
|
||||
failover performances compared to Keepalived feature in Neutron L3 Agent.
|
||||
Defaults to 'False'
|
16
resources/neutron_agents_l3_puppet/actions/remove.pp
Normal file
16
resources/neutron_agents_l3_puppet/actions/remove.pp
Normal file
@ -0,0 +1,16 @@
|
||||
class { 'neutron::agents::l3':
|
||||
package_ensure => 'absent',
|
||||
enabled => false,
|
||||
}
|
||||
|
||||
include neutron::params
|
||||
|
||||
package { 'neutron':
|
||||
ensure => 'absent',
|
||||
name => $::neutron::params::package_name,
|
||||
}
|
||||
|
||||
# Remove external class dependency
|
||||
Service <| title == 'neutron-l3' |> {
|
||||
require => undef
|
||||
}
|
63
resources/neutron_agents_l3_puppet/actions/run.pp
Normal file
63
resources/neutron_agents_l3_puppet/actions/run.pp
Normal file
@ -0,0 +1,63 @@
|
||||
$resource = hiera($::resource_name)
|
||||
|
||||
$ip = $resource['input']['ip']['value']
|
||||
|
||||
$package_ensure = $resource['input']['package_ensure']['value']
|
||||
$debug = $resource['input']['debug']['value']
|
||||
$external_network_bridge = $resource['input']['external_network_bridge']['value']
|
||||
$use_namespaces = $resource['input']['use_namespaces']['value']
|
||||
$interface_driver = $resource['input']['interface_driver']['value']
|
||||
$router_id = $resource['input']['router_id']['value']
|
||||
$gateway_external_network_id = $resource['input']['gateway_external_network_id']['value']
|
||||
$handle_internal_only_routers = $resource['input']['handle_internal_only_routers']['value']
|
||||
$metadata_port = $resource['input']['metadata_port']['value']
|
||||
$send_arp_for_ha = $resource['input']['send_arp_for_ha']['value']
|
||||
$periodic_interval = $resource['input']['periodic_interval']['value']
|
||||
$periodic_fuzzy_delay = $resource['input']['periodic_fuzzy_delay']['value']
|
||||
$enable_metadata_proxy = $resource['input']['enable_metadata_proxy']['value']
|
||||
$network_device_mtu = $resource['input']['network_device_mtu']['value']
|
||||
$router_delete_namespaces = $resource['input']['router_delete_namespaces']['value']
|
||||
$ha_enabled = $resource['input']['ha_enabled']['value']
|
||||
$ha_vrrp_auth_type = $resource['input']['ha_vrrp_auth_type']['value']
|
||||
$ha_vrrp_auth_password = $resource['input']['ha_vrrp_auth_password']['value']
|
||||
$ha_vrrp_advert_int = $resource['input']['ha_vrrp_advert_int']['value']
|
||||
$agent_mode = $resource['input']['agent_mode']['value']
|
||||
$allow_automatic_l3agent_failover = $resource['input']['allow_automatic_l3agent_failover']['value']
|
||||
|
||||
class { 'neutron::agents::l3':
|
||||
enabled => true,
|
||||
manage_service => true,
|
||||
package_ensure => $package_ensure,
|
||||
debug => $debug,
|
||||
external_network_bridge => $external_network_bridge,
|
||||
use_namespaces => $use_namespaces,
|
||||
interface_driver => $interface_driver,
|
||||
router_id => $router_id,
|
||||
gateway_external_network_id => $gateway_external_network_id,
|
||||
handle_internal_only_routers => $handle_internal_only_routers,
|
||||
metadata_port => $metadata_port,
|
||||
send_arp_for_ha => $send_arp_for_ha,
|
||||
periodic_interval => $periodic_interval,
|
||||
periodic_fuzzy_delay => $periodic_fuzzy_delay,
|
||||
enable_metadata_proxy => $enable_metadata_proxy,
|
||||
network_device_mtu => $network_device_mtu,
|
||||
router_delete_namespaces => $router_delete_namespaces,
|
||||
ha_enabled => $ha_enabled,
|
||||
ha_vrrp_auth_type => $ha_vrrp_auth_type,
|
||||
ha_vrrp_auth_password => $ha_vrrp_auth_password,
|
||||
ha_vrrp_advert_int => $ha_vrrp_advert_int,
|
||||
agent_mode => $agent_mode,
|
||||
allow_automatic_l3agent_failover => $allow_automatic_l3agent_failover,
|
||||
}
|
||||
|
||||
include neutron::params
|
||||
|
||||
package { 'neutron':
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::package_name,
|
||||
}
|
||||
|
||||
# Remove external class dependency
|
||||
Service <| title == 'neutron-l3' |> {
|
||||
require => undef
|
||||
}
|
84
resources/neutron_agents_l3_puppet/meta.yaml
Normal file
84
resources/neutron_agents_l3_puppet/meta.yaml
Normal file
@ -0,0 +1,84 @@
|
||||
handler: puppet
|
||||
id: 'neutron_agents_l3_puppet'
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
|
||||
package_ensure:
|
||||
schema: str
|
||||
value: 'present'
|
||||
debug:
|
||||
schema: bool
|
||||
value: false
|
||||
external_network_bridge:
|
||||
schema: str
|
||||
value: 'br-ex'
|
||||
use_namespaces:
|
||||
schema: bool
|
||||
value: true
|
||||
interface_driver:
|
||||
schema: str
|
||||
value: 'neutron.agent.linux.interface.OVSInterfaceDriver'
|
||||
router_id:
|
||||
schema: str
|
||||
value:
|
||||
gateway_external_network_id:
|
||||
schema: str
|
||||
value:
|
||||
handle_internal_only_routers:
|
||||
schema: bool
|
||||
value: true
|
||||
metadata_port:
|
||||
schema: int
|
||||
value: 9697
|
||||
send_arp_for_ha:
|
||||
schema: int
|
||||
value: 3
|
||||
periodic_interval:
|
||||
schema: int
|
||||
value: 40
|
||||
periodic_fuzzy_delay:
|
||||
schema: int
|
||||
value: 5
|
||||
enable_metadata_proxy:
|
||||
schema: bool
|
||||
value: true
|
||||
network_device_mtu:
|
||||
schema: str
|
||||
value:
|
||||
router_delete_namespaces:
|
||||
schema: bool
|
||||
value: false
|
||||
ha_enabled:
|
||||
schema: bool
|
||||
value: false
|
||||
ha_vrrp_auth_type:
|
||||
schema: str
|
||||
value: 'PASS'
|
||||
ha_vrrp_auth_password:
|
||||
schema: str
|
||||
value:
|
||||
ha_vrrp_advert_int:
|
||||
schema: int
|
||||
value: 3
|
||||
agent_mode:
|
||||
schema: str
|
||||
value: 'legacy'
|
||||
allow_automatic_l3agent_failover:
|
||||
schema: bool
|
||||
value: false
|
||||
|
||||
git:
|
||||
schema: {repository: str!, branch: str!}
|
||||
value: {repository: 'https://github.com/openstack/puppet-neutron', branch: '5.1.0'}
|
||||
|
||||
puppet_module: 'neutron'
|
||||
tags: [resource/neutron, resource/neutron_agents_l3]
|
||||
version: 1.0.0
|
Loading…
Reference in New Issue
Block a user