From a88bfffa2d94c4febad52790082b0d47d0ffc46d Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Fri, 19 Jul 2013 17:59:00 +0200 Subject: [PATCH] Handle L2 agent configurations for compute and network nodes separately --- manifests/node/compute.pp | 2 +- manifests/node/controller.pp | 2 +- manifests/node/network.pp | 2 +- manifests/quantum/agent/l2/compute.pp | 39 +++++++++++++++++++ .../quantum/agent/{l2.pp => l2/network.pp} | 2 +- 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 manifests/quantum/agent/l2/compute.pp rename manifests/quantum/agent/{l2.pp => l2/network.pp} (96%) diff --git a/manifests/node/compute.pp b/manifests/node/compute.pp index 42370a0..fe71dad 100644 --- a/manifests/node/compute.pp +++ b/manifests/node/compute.pp @@ -21,7 +21,7 @@ class kickstack::node::compute inherits kickstack { $glance_api_host = getvar("${::kickstack::fact_prefix}glance_api_host") if $amqp_host and $amqp_password { - include kickstack::quantum::agent::l2 + include kickstack::quantum::agent::l2::compute if $nova_sql_conn and $nova_keystone_password and $glance_api_host { include kickstack::nova::compute } diff --git a/manifests/node/controller.pp b/manifests/node/controller.pp index cf5e330..774dbdf 100644 --- a/manifests/node/controller.pp +++ b/manifests/node/controller.pp @@ -45,6 +45,6 @@ class kickstack::node::controller inherits kickstack { # require this. Until that is fixed, pull the # L2 agent into the controller. if $quantum_sql_conn and $quantum_keystone_password { - include kickstack::quantum::agent::l2 + include kickstack::quantum::agent::l2::compute } } diff --git a/manifests/node/network.pp b/manifests/node/network.pp index 8f7c174..f179825 100644 --- a/manifests/node/network.pp +++ b/manifests/node/network.pp @@ -23,7 +23,7 @@ class kickstack::node::network inherits kickstack { include kickstack::quantum::agent::dhcp include kickstack::quantum::agent::l3 if $quantum_sql_conn { - include kickstack::quantum::agent::l2 + include kickstack::quantum::agent::l2::network } if $quantum_metadata_shared_secret { include kickstack::quantum::agent::metadata diff --git a/manifests/quantum/agent/l2/compute.pp b/manifests/quantum/agent/l2/compute.pp new file mode 100644 index 0000000..221d889 --- /dev/null +++ b/manifests/quantum/agent/l2/compute.pp @@ -0,0 +1,39 @@ +class kickstack::quantum::agent::l2::compute inherits kickstack { + + include kickstack::quantum::config + + $tenant_network_type = "$::kickstack::quantum_tenant_network_type" + + case "$::kickstack::quantum_plugin" { + 'ovs': { + case $tenant_network_type { + 'gre': { + $local_tunnel_ip = getvar("ipaddress_${nic_data}") + class { 'quantum::agents::ovs': + bridge_mappings => [], + bridge_uplinks => [], + integration_bridge => $::kickstack::quantum_integration_bridge, + enable_tunneling => true, + local_ip => $local_tunnel_ip, + tunnel_bridge => $::kickstack::quantum_tunnel_bridge, + } + } + default: { + $bridge_uplinks = ["br-${nic_data}:${nic_data}"] + class { 'quantum::agents::ovs': + bridge_mappings => ["${::kickstack::quantum_physnet}:br-${nic_data}"], + bridge_uplinks => $bridge_uplinks, + integration_bridge => $::kickstack::quantum_integration_bridge, + enable_tunneling => false, + local_ip => '', + } + } + } + } + 'linuxbridge': { + class { "quantum::agents::linuxbridge": + physical_interface_mappings => "default:$nic_data" + } + } + } +} diff --git a/manifests/quantum/agent/l2.pp b/manifests/quantum/agent/l2/network.pp similarity index 96% rename from manifests/quantum/agent/l2.pp rename to manifests/quantum/agent/l2/network.pp index a1f9620..89ecb55 100644 --- a/manifests/quantum/agent/l2.pp +++ b/manifests/quantum/agent/l2/network.pp @@ -1,4 +1,4 @@ -class kickstack::quantum::agent::l2 inherits kickstack { +class kickstack::quantum::agent::l2::network inherits kickstack { include kickstack::quantum::config