Attempt to split out agent and controller parts
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
class {"quantum::server":}
|
||||
class {"quantum::plugins::ovs":
|
||||
bridge_uplinks => "br-virtual:eth1",
|
||||
server => true
|
||||
}
|
||||
|
@@ -1,82 +0,0 @@
|
||||
class quantum::plugins::ovs (
|
||||
$bridge_uplinks = ['br-virtual:eth1'],
|
||||
$bridge_mappings = ['default:br-virtual'],
|
||||
$tenant_network_type = "vlan",
|
||||
|
||||
$network_vlan_ranges = "default:1000:2000",
|
||||
$integration_bridge = "br-int",
|
||||
|
||||
$enable_tunneling = "True",
|
||||
$tunnel_bridge = "br-tun",
|
||||
$tunnel_id_ranges = "1:1000",
|
||||
$local_ip = "10.0.0.1",
|
||||
|
||||
$server = false
|
||||
) inherits quantum {
|
||||
include "quantum::params"
|
||||
|
||||
if !$server {
|
||||
$package = $::quantum::params::ovs_agent_package
|
||||
$package_require = [Class['quantum']]
|
||||
} else {
|
||||
$package = $::quantum::params::ovs_server_package
|
||||
$package_require = [Class['quantum'], Service[$::quantum::params::server_service]]
|
||||
}
|
||||
|
||||
Package["quantum-plugin-ovs"] -> Quantum_plugin_ovs<||>
|
||||
Quantum_config<||> ~> Service["quantum-plugin-ovs-service"]
|
||||
Quantum_plugin_ovs<||> ~> Service["quantum-plugin-ovs-service"]
|
||||
|
||||
class {
|
||||
"vswitch":
|
||||
provider => ovs
|
||||
}
|
||||
|
||||
vs_bridge {$integration_bridge:
|
||||
external_ids => "bridge-id=$ingration_bridge",
|
||||
ensure => present
|
||||
}
|
||||
|
||||
quantum::plugins::ovs::bridge{$bridge_mappings:}
|
||||
|
||||
quantum::plugins::ovs::port{$bridge_uplinks:}
|
||||
|
||||
package { "quantum-plugin-ovs":
|
||||
name => $package,
|
||||
ensure => $package_ensure,
|
||||
require => $package_require
|
||||
}
|
||||
|
||||
$br_map_str = join($bridge_mappings, ",")
|
||||
quantum_plugin_ovs {
|
||||
"OVS/integration_bridge": value => $integration_bridge;
|
||||
"OVS/network_vlan_ranges": value => $network_vlan_ranges;
|
||||
"OVS/tenant_network_type": value => $tenant_network_type;
|
||||
"OVS/bridge_mappings": value => $br_map_str;
|
||||
}
|
||||
|
||||
if ($tenant_network_type == "gre") and ($enable_tunneling) {
|
||||
vs_bridge {$tunnel_bridge:
|
||||
ensure => present
|
||||
}
|
||||
quantum_plugin_ovs {
|
||||
"OVS/enable_tunneling": value => $enable_tunneling;
|
||||
"OVS/tunnel_bridge": value => $tunnel_bridge;
|
||||
"OVS/tunnel_id_ranges": value => $tunnel_id_ranges;
|
||||
"OVS/local_ip": value => $local_ip;
|
||||
}
|
||||
}
|
||||
|
||||
if $enabled {
|
||||
$service_ensure = "running"
|
||||
} else {
|
||||
$service_ensure = "stopped"
|
||||
}
|
||||
|
||||
service { 'quantum-plugin-ovs-service':
|
||||
name => $::quantum::params::ovs_agent_service,
|
||||
enable => $enable,
|
||||
ensure => $service_ensure,
|
||||
require => [Package[$package]]
|
||||
}
|
||||
}
|
44
manifests/plugins/ovs/agent.pp
Normal file
44
manifests/plugins/ovs/agent.pp
Normal file
@@ -0,0 +1,44 @@
|
||||
class quantum::plugins::ovs::agent (
|
||||
$controller = false
|
||||
) inherits quantum::plugin::ovs {
|
||||
Package["quantum-plugin-ovs-agent"] -> Quantum_plugin_ovs<||>
|
||||
|
||||
class {
|
||||
"vswitch":
|
||||
provider => ovs
|
||||
}
|
||||
|
||||
vs_bridge {$integration_bridge:
|
||||
external_ids => "bridge-id=$ingration_bridge",
|
||||
ensure => present
|
||||
}
|
||||
|
||||
if $enable_tunneling {
|
||||
vs_bridge {$tunnel_bridge:
|
||||
external_ids => "bridge-id=$tunnel_bridge",
|
||||
ensure => present
|
||||
}
|
||||
}
|
||||
|
||||
quantum::plugins::ovs::bridge{$bridge_mappings:}
|
||||
quantum::plugins::ovs::port{$bridge_uplinks:}
|
||||
|
||||
package { "quantum-plugin-ovs-agent":
|
||||
name => $::quantum::params::ovs_agent_package,
|
||||
ensure => $package_ensure,
|
||||
require => [Class['quantum'], Service["quantum-plugin-ovs-service"]]
|
||||
}
|
||||
|
||||
if $enabled {
|
||||
$service_ensure = "running"
|
||||
} else {
|
||||
$service_ensure = "stopped"
|
||||
}
|
||||
|
||||
service { 'quantum-plugin-ovs-service':
|
||||
name => $::quantum::params::ovs_agent_service,
|
||||
enable => $enable,
|
||||
ensure => $service_ensure,
|
||||
require => [Package["quantum-plugin-ovs-agent"]]
|
||||
}
|
||||
}
|
49
manifests/plugins/ovs/init.pp
Normal file
49
manifests/plugins/ovs/init.pp
Normal file
@@ -0,0 +1,49 @@
|
||||
class quantum::plugins::ovs (
|
||||
$bridge_uplinks = ['br-virtual:eth1'],
|
||||
$bridge_mappings = ['default:br-virtual'],
|
||||
$tenant_network_type = "vlan",
|
||||
|
||||
$network_vlan_ranges = "default:1000:2000",
|
||||
$integration_bridge = "br-int",
|
||||
|
||||
$enable_tunneling = "True",
|
||||
$tunnel_bridge = "br-tun",
|
||||
$tunnel_id_ranges = "1:1000",
|
||||
$local_ip = "10.0.0.1",
|
||||
|
||||
$controller = true
|
||||
) inherits quantum {
|
||||
Package["quantum-plugin-ovs"] -> Quantum_plugin_ovs<||>
|
||||
|
||||
$package_require = [Class['quantum']]
|
||||
|
||||
if $controller {
|
||||
Quantum_config<||> ~> Service["quantum-server"]
|
||||
Quantum_plugin_ovs<||> ~> Service["quantum-server"]
|
||||
|
||||
$package_require += Service[$::quantum::params::server_service]
|
||||
}
|
||||
|
||||
package { "quantum-plugin-ovs":
|
||||
name => $::quantum::params::ovs_server_package,
|
||||
ensure => $package_ensure,
|
||||
require => $package_require
|
||||
}
|
||||
|
||||
$br_map_str = join($bridge_mappings, ",")
|
||||
quantum_plugin_ovs {
|
||||
"OVS/integration_bridge": value => $integration_bridge;
|
||||
"OVS/network_vlan_ranges": value => $network_vlan_ranges;
|
||||
"OVS/tenant_network_type": value => $tenant_network_type;
|
||||
"OVS/bridge_mappings": value => $br_map_str;
|
||||
}
|
||||
|
||||
if ($tenant_network_type == "gre") and ($enable_tunneling) {
|
||||
quantum_plugin_ovs {
|
||||
"OVS/enable_tunneling": value => $enable_tunneling;
|
||||
"OVS/tunnel_bridge": value => $tunnel_bridge;
|
||||
"OVS/tunnel_id_ranges": value => $tunnel_id_ranges;
|
||||
"OVS/local_ip": value => $local_ip;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user