Add extra config yaml files for big switch agents.
authorxinwu <xin.wu@bigswitch.com>
Mon, 25 Jan 2016 07:51:37 +0000 (23:51 -0800)
committerxinwu <xin.wu@bigswitch.com>
Mon, 22 Feb 2016 23:56:19 +0000 (15:56 -0800)
This change adds extra config yaml files for big switch agent
and big switch lldp.

This change is mainly for compute nodes. The changes related
to controller nodes are landed at e78e1c8d9b5a7ebf327987b22091bff3ed42d1c1

This change also removes the neutron_enable_bigswitch_ml2 flag. Instead,
User needs to specify NeutronMechanismDrivers: bsn_ml2 in environment file.

Previous discussion about this change can be found at an abandoned
review request https://review.openstack.org/#/c/271940/

Depends-On: Iefcfe698691234490504b6747ced7bb9147118de

Change-Id: I81341a4b123dc4a8312a9a00f4b663c7cca63d7c

environments/neutron-ml2-bigswitch.yaml
puppet/compute.yaml
puppet/extraconfig/pre_deploy/compute/neutron-ml2-bigswitch.yaml [new file with mode: 0644]
puppet/extraconfig/pre_deploy/controller/neutron-ml2-bigswitch.yaml
puppet/manifests/overcloud_compute.pp
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp

index 69c9132..750d3c4 100644 (file)
@@ -2,11 +2,13 @@
 # extensions, configured via puppet
 resource_registry:
   OS::TripleO::ControllerExtraConfigPre: ../puppet/extraconfig/pre_deploy/controller/neutron-ml2-bigswitch.yaml
+  OS::TripleO::ComputeExtraConfigPre: ../puppet/extraconfig/pre_deploy/compute/neutron-ml2-bigswitch.yaml
 
 parameter_defaults:
   # Required to fill in:
   NeutronBigswitchRestproxyServers:
   NeutronBigswitchRestproxyServerAuth:
+  NeutronMechanismDrivers: bsn_ml2
 
   # Optional:
   # NeutronBigswitchRestproxyAutoSyncOnFailure:
@@ -14,4 +16,6 @@ parameter_defaults:
   # NeutronBigswitchRestproxyNeutronId:
   # NeutronBigswitchRestproxyServerSsl:
   # NeutronBigswitchRestproxySslCertDirectory:
+  # NeutronBigswitchAgentEnabled:
+  # NeutronBigswitchLLDPEnabled:
 
index e56c376..7586ebd 100644 (file)
@@ -443,6 +443,7 @@ resources:
             - all_nodes # provided by allNodesConfig
             - '"%{::osfamily}"'
             - common
+            - neutron_bigswitch_data # Optionally provided by ComputeExtraConfigPre
             - cisco_n1kv_data  # Optionally provided by ComputeExtraConfigPre
             - nova_nuage_data  # Optionally provided by ComputeExtraConfigPre
             - midonet_data # Optionally provided by AllNodesExtraConfig
diff --git a/puppet/extraconfig/pre_deploy/compute/neutron-ml2-bigswitch.yaml b/puppet/extraconfig/pre_deploy/compute/neutron-ml2-bigswitch.yaml
new file mode 100644 (file)
index 0000000..49c7719
--- /dev/null
@@ -0,0 +1,45 @@
+heat_template_version: 2015-04-30
+
+description: Configure hieradata for Big Switch agents on compute node
+
+parameters:
+  server:
+    description: ID of the controller node to apply this config to
+    type: string
+  NeutronBigswitchAgentEnabled:
+    description: The state of the neutron-bsn-agent service.
+    type: boolean
+    default: false
+  NeutronBigswitchLLDPEnabled:
+    description: The state of the neutron-bsn-lldp service.
+    type: boolean
+    default: true
+
+
+resources:
+  NeutronBigswitchConfig:
+    type: OS::Heat::StructuredConfig
+    properties:
+      group: os-apply-config
+      config:
+        hiera:
+          datafiles:
+            neutron_bigswitch_data:
+              mapped_data:
+                neutron::agents::bigswitch::agent_enabled: {get_input: neutron_enable_bigswitch_agent}
+                neutron::agents::bigswitch::lldp_enabled: {get_input: neutron_enable_bigswitch_lldp}
+
+  NeutronBigswitchDeployment:
+    type: OS::Heat::StructuredDeployment
+    properties:
+      name: NeutronBigswitchDeployment
+      config: {get_resource: NeutronBigswitchConfig}
+      server: {get_param: server}
+      input_values:
+        neutron_enable_bigswitch_agent: {get_param: NeutronBigswitchAgentEnabled}
+        neutron_enable_bigswitch_lldp: {get_param: NeutronBigswitchLLDPEnabled}
+
+outputs:
+  deploy_stdout:
+    description: Deployment reference, used to trigger puppet apply on changes
+    value: {get_attr: [NeutronBigswitchDeployment, deploy_stdout]}
index 1e65296..467f57c 100644 (file)
@@ -44,7 +44,6 @@ resources:
           datafiles:
             neutron_bigswitch_data:
               mapped_data:
-                neutron_enable_bigswitch_ml2: true
                 neutron::plugins::ml2::bigswitch::restproxy::servers: {get_input: restproxy_servers}
                 neutron::plugins::ml2::bigswitch::restproxy::server_auth: {get_input: restproxy_server_auth}
                 neutron::plugins::ml2::bigswitch::restproxy::auto_sync_on_failure: {get_input: restproxy_auto_sync_on_failure}
index 3022787..0f1318c 100644 (file)
@@ -131,6 +131,10 @@ else {
       n1kv_version => hiera('n1kv_vem_version', undef),
     }
   }
+
+  if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
+    include ::neutron::agents::bigswitch
+  }
 }
 
 
index 601f35f..14dde15 100644 (file)
@@ -355,8 +355,9 @@ if hiera('step') >= 3 {
         include ::neutron::plugins::ml2::cisco::type_nexus_vxlan
       }
 
-      if hiera('neutron_enable_bigswitch_ml2', false) {
+      if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
         include ::neutron::plugins::ml2::bigswitch::restproxy
+        include ::neutron::agents::bigswitch
       }
       neutron_l3_agent_config {
         'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);
index b57bcff..c527c26 100644 (file)
@@ -732,8 +732,9 @@ if hiera('step') >= 3 {
     }
   }
 
-  if hiera('neutron_enable_bigswitch_ml2', false) {
+  if 'bsn_ml2' in hiera('neutron::plugins::ml2::mechanism_drivers') {
     include ::neutron::plugins::ml2::bigswitch::restproxy
+    include ::neutron::agents::bigswitch
   }
   neutron_l3_agent_config {
     'DEFAULT/ovs_use_veth': value => hiera('neutron_ovs_use_veth', false);