Browse Source

Puppet added

Change-Id: I8406b7daa5fc667edbe827f65de2d71aed629125
Nikita Koshikov 4 years ago
parent
commit
563fbd9b7c
38 changed files with 1250 additions and 7 deletions
  1. 12
    0
      deployment_scripts/puppet/modules/apic/manifests/api.pp
  2. 39
    0
      deployment_scripts/puppet/modules/apic/manifests/host_agent.pp
  3. 20
    0
      deployment_scripts/puppet/modules/apic/manifests/params.pp
  4. 39
    0
      deployment_scripts/puppet/modules/apic/manifests/svc_agent.pp
  5. 89
    0
      deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_apic_gbp.pp
  6. 89
    0
      deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_apic_ml2.pp
  7. 37
    0
      deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_mapping.pp
  8. 79
    0
      deployment_scripts/puppet/modules/cisco_aci/manifests/generic_apic_ml2.pp
  9. 11
    0
      deployment_scripts/puppet/modules/gbp/manifests/client.pp
  10. 17
    0
      deployment_scripts/puppet/modules/gbp/manifests/config.pp
  11. 18
    0
      deployment_scripts/puppet/modules/gbp/manifests/heat.pp
  12. 17
    0
      deployment_scripts/puppet/modules/gbp/manifests/horizon.pp
  13. 22
    0
      deployment_scripts/puppet/modules/gbp/manifests/manage.pp
  14. 22
    0
      deployment_scripts/puppet/modules/gbp/manifests/params.pp
  15. 49
    0
      deployment_scripts/puppet/modules/heat/manifests/ha_services.pp
  16. 31
    0
      deployment_scripts/puppet/modules/heat/manifests/params.pp
  17. 48
    0
      deployment_scripts/puppet/modules/heat/manifests/services.pp
  18. 19
    0
      deployment_scripts/puppet/modules/horizon/manifests/params.pp
  19. 15
    0
      deployment_scripts/puppet/modules/horizon/manifests/project.pp
  20. 13
    0
      deployment_scripts/puppet/modules/horizon/manifests/service.pp
  21. 58
    0
      deployment_scripts/puppet/modules/lldp/manifests/init.pp
  22. 20
    0
      deployment_scripts/puppet/modules/lldp/manifests/params.pp
  23. 3
    0
      deployment_scripts/puppet/modules/neutron/files/neutron
  24. 25
    0
      deployment_scripts/puppet/modules/neutron/files/neutron-server.conf
  25. 26
    0
      deployment_scripts/puppet/modules/neutron/manifests/config.pp
  26. 45
    0
      deployment_scripts/puppet/modules/neutron/manifests/config_apic.pp
  27. 13
    0
      deployment_scripts/puppet/modules/neutron/manifests/config_auth.pp
  28. 39
    0
      deployment_scripts/puppet/modules/neutron/manifests/network.pp
  29. 31
    0
      deployment_scripts/puppet/modules/neutron/manifests/params.pp
  30. 57
    0
      deployment_scripts/puppet/modules/neutron/manifests/services/agents.pp
  31. 16
    0
      deployment_scripts/puppet/modules/neutron/manifests/services/apic_server.pp
  32. 62
    0
      deployment_scripts/puppet/modules/neutron/manifests/services/ha_agents.pp
  33. 29
    0
      deployment_scripts/puppet/modules/neutron/manifests/services/ovs_agent.pp
  34. 35
    0
      deployment_scripts/puppet/modules/neutron/manifests/services/server.pp
  35. 71
    0
      deployment_scripts/puppet/site.pp
  36. 19
    5
      metadata.yaml
  37. 13
    0
      pre_build_hook
  38. 2
    2
      tasks.yaml

+ 12
- 0
deployment_scripts/puppet/modules/apic/manifests/api.pp View File

@@ -0,0 +1,12 @@
1
+#Class apic::api
2
+class apic::api (
3
+  $package_ensure  = 'present',
4
+) {
5
+
6
+    include apic::params
7
+    package { 'apic_api':
8
+        ensure => $package_ensure,
9
+        name   => $::apic::params::package_apic_api,
10
+    }
11
+
12
+}

+ 39
- 0
deployment_scripts/puppet/modules/apic/manifests/host_agent.pp View File

@@ -0,0 +1,39 @@
1
+#Class apic::host_agent
2
+class apic::host_agent (
3
+    $package_ensure     = 'present',
4
+    $enabled            = true,
5
+    $manage_service     = true,
6
+){
7
+    include apic::params
8
+
9
+    if $manage_service {
10
+        if $enabled {
11
+            $service_ensure = 'running'
12
+        } else {
13
+            $service_ensure = 'stopped'
14
+        }
15
+    }
16
+
17
+    package { 'apic_host_agent':
18
+        ensure => $package_ensure,
19
+        name   => $::apic::params::package_apic_agent,
20
+    }
21
+
22
+    service { 'apic-host-agent':
23
+        ensure     => $service_ensure,
24
+        name       => $::apic::params::service_apic_host_agent,
25
+        enable     => $enabled,
26
+        hasstatus  => true,
27
+        hasrestart => true,
28
+        require    => Package['apic_host_agent'],
29
+    }
30
+
31
+    Package['apic_host_agent']      -> Neutron_config<||>
32
+    Package['apic_host_agent']      -> Neutron_plugin_ml2<||>
33
+    Package['apic_host_agent']      -> Neutron_plugin_ml2_cisco<||>
34
+    Neutron_config<||>              ~> Service['apic-host-agent']
35
+    Neutron_plugin_ml2<||>          ~> Service['apic-host-agent']
36
+    Neutron_plugin_ml2_cisco<||>    ~> Service['apic-host-agent']
37
+    File_line<||>                   ~> Service['apic-host-agent']
38
+
39
+}

+ 20
- 0
deployment_scripts/puppet/modules/apic/manifests/params.pp View File

@@ -0,0 +1,20 @@
1
+#Class apic::params
2
+class apic::params {
3
+
4
+    case $::osfamily {
5
+        'RedHat': {
6
+        }
7
+
8
+        'Debian': {
9
+            $package_apic_svc           = 'neutron-driver-apic-svc'
10
+            $package_apic_agent         = 'neutron-driver-apic-agent'
11
+            $package_apic_api           = 'python-apicapi'
12
+            $service_apic_svc_agent     = 'neutron-driver-apic-svc'
13
+            $service_apic_host_agent    = 'neutron-driver-apic-agent'
14
+        }
15
+
16
+        default: {
17
+            fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
18
+        }
19
+    }
20
+}

+ 39
- 0
deployment_scripts/puppet/modules/apic/manifests/svc_agent.pp View File

@@ -0,0 +1,39 @@
1
+#Class apic::svc_agent
2
+class apic::svc_agent (
3
+    $package_ensure = 'present',
4
+    $enabled        = true,
5
+    $manage_service = true,
6
+){
7
+    include apic::params
8
+
9
+    if $manage_service {
10
+        if $enabled {
11
+            $service_ensure = 'running'
12
+        } else {
13
+            $service_ensure = 'stopped'
14
+        }
15
+    }
16
+
17
+    Package['apic_svc_agent']       -> Neutron_config<||>
18
+    Package['apic_svc_agent']       -> Neutron_plugin_ml2<||>
19
+    Package['apic_svc_agent']       -> Neutron_plugin_ml2_cisco<||>
20
+    Neutron_config<||>              ~> Service['apic-svc-agent']
21
+    Neutron_plugin_ml2<||>          ~> Service['apic-svc-agent']
22
+    Neutron_plugin_ml2_cisco<||>    ~> Service['apic-svc-agent']
23
+    File_line<||>                   ~> Service['apic-svc-agent']
24
+
25
+    package { 'apic_svc_agent':
26
+        ensure => $package_ensure,
27
+        name   => $::apic::params::package_apic_svc,
28
+    }
29
+
30
+    service { 'apic-svc-agent':
31
+        ensure     => $service_ensure,
32
+        name       => $::apic::params::service_apic_svc_agent,
33
+        enable     => $enabled,
34
+        hasstatus  => true,
35
+        hasrestart => true,
36
+        require    => Package['apic_svc_agent'],
37
+    }
38
+
39
+}

+ 89
- 0
deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_apic_gbp.pp View File

@@ -0,0 +1,89 @@
1
+#Class cisco_aci::gbp_and_apic_gbp
2
+class cisco_aci::gbp_and_apic_gbp (
3
+    $ha_prefix          = '',
4
+    $role               = 'compute',
5
+    $use_lldp           = true,
6
+    $apic_hosts         = '10.0.0.1',
7
+    $apic_username      = 'admin',
8
+    $apic_password      = 'password',
9
+    $static_config      = '',
10
+    $additional_config  = '',
11
+    $service_plugins    = 'neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,gbpservice.neutron.services.grouppolicy.plugin.GroupPolicyPlugin,gbpservice.neutron.services.servicechain.servicechain_plugin.ServiceChainPlugin',
12
+    $mechanism_drivers  = 'openvswitch,apic_gbp',
13
+    $policy_drivers     = 'implicit_policy,apic',
14
+    $admin_username     = 'admin',
15
+    $admin_password     = 'admin',
16
+    $admin_tenant       = 'admin',
17
+    $ext_net_enable     = false,
18
+    $ext_net_name       = 'ext',
19
+    $ext_net_switch     = '101',
20
+    $ext_net_port       = '1/1',
21
+    $ext_net_subnet     = '10.0.0.0/24',
22
+    $ext_net_gateway    = '10.0.0.1',
23
+){
24
+    include 'apic::params'
25
+    include 'apic::api'
26
+
27
+    case $role {
28
+        /controller/: {
29
+            if $use_lldp {
30
+                include 'apic::svc_agent'
31
+            }
32
+            include 'neutron::services::apic_server'
33
+            include "neutron::services::${ha_prefix}agents"
34
+            include 'gbp::heat'
35
+            include "heat::${ha_prefix}services"
36
+            include 'gbp::horizon'
37
+            include 'gbp::client'
38
+            include 'gbp::manage'
39
+            class {'neutron::config_auth':
40
+                admin_username => $admin_username,
41
+                admin_password => $admin_password,
42
+                admin_tenant   => $admin_tenant,
43
+            }
44
+            if ($role == 'primary-controller' and $ext_net_enable == true){
45
+                class {'neutron::network':
46
+                    tenant_name     => $admin_tenant,
47
+                    ext_net_name    => $ext_net_name,
48
+                    ext_net_subnet  => $ext_net_subnet,
49
+                    ext_net_gateway => $ext_net_gateway,
50
+                }
51
+            }
52
+        }
53
+        'compute': {
54
+            include 'neutron::services::ovs_agent'
55
+        }
56
+        default: {
57
+        }
58
+    }
59
+
60
+    if $use_lldp {
61
+        include 'lldp'
62
+        include 'apic::host_agent'
63
+
64
+    }
65
+
66
+    class {'gbp::config':
67
+        policy_drivers => $policy_drivers,
68
+    }
69
+
70
+    class {'neutron::config':
71
+        service_plugins   => $service_plugins,
72
+        mechanism_drivers => $mechanism_drivers,
73
+    }
74
+
75
+    class {'neutron::config_apic':
76
+        apic_hosts        => $apic_hosts,
77
+        apic_username     => $apic_username,
78
+        apic_password     => $apic_password,
79
+        static_config     => $static_config,
80
+        additional_config => $additional_config,
81
+        ext_net_enable    => $ext_net_enable,
82
+        ext_net_name      => $ext_net_name,
83
+        ext_net_switch    => $ext_net_switch,
84
+        ext_net_port      => $ext_net_port,
85
+        ext_net_subnet    => $ext_net_subnet,
86
+        ext_net_gateway   => $ext_net_gateway,
87
+    }
88
+
89
+}

+ 89
- 0
deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_apic_ml2.pp View File

@@ -0,0 +1,89 @@
1
+#Class cisco_aci::gbp_and_apic_ml2
2
+class cisco_aci::gbp_and_apic_ml2 (
3
+    $ha_prefix          = '',
4
+    $role               = 'compute',
5
+    $use_lldp           = true,
6
+    $apic_hosts         = '10.0.0.1',
7
+    $apic_username      = 'admin',
8
+    $apic_password      = 'password',
9
+    $static_config      = '',
10
+    $additional_config  = '',
11
+    $service_plugins    = 'neutron.services.l3_router.l3_apic.ApicL3ServicePlugin',
12
+    $mechanism_drivers  = 'openvswitch,cisco_apic',
13
+    $policy_drivers     = 'implicit_policy,apic',
14
+    $admin_username     = 'admin',
15
+    $admin_password     = 'admin',
16
+    $admin_tenant       = 'admin',
17
+    $ext_net_enable     = false,
18
+    $ext_net_name       = 'ext',
19
+    $ext_net_switch     = '101',
20
+    $ext_net_port       = '1/1',
21
+    $ext_net_subnet     = '10.0.0.0/24',
22
+    $ext_net_gateway    = '10.0.0.1',
23
+){
24
+    include 'apic::params'
25
+    include 'apic::api'
26
+
27
+    case $role {
28
+        /controller/: {
29
+            if $use_lldp {
30
+                include 'apic::svc_agent'
31
+            }
32
+            include 'neutron::services::apic_server'
33
+            include "neutron::services::${ha_prefix}agents"
34
+            include 'gbp::heat'
35
+            include "heat::${ha_prefix}services"
36
+            include 'gbp::horizon'
37
+            include 'gbp::client'
38
+            include 'gbp::manage'
39
+            class {'neutron::config_auth':
40
+                admin_username => $admin_username,
41
+                admin_password => $admin_password,
42
+                admin_tenant   => $admin_tenant,
43
+            }
44
+            if ($role == 'primary-controller' and $ext_net_enable == true){
45
+                class {'neutron::network':
46
+                    tenant_name     => $admin_tenant,
47
+                    ext_net_name    => $ext_net_name,
48
+                    ext_net_subnet  => $ext_net_subnet,
49
+                    ext_net_gateway => $ext_net_gateway,
50
+                }
51
+            }
52
+        }
53
+        'compute': {
54
+            include 'neutron::services::ovs_agent'
55
+        }
56
+        default: {
57
+        }
58
+    }
59
+
60
+    if $use_lldp {
61
+        include 'lldp'
62
+        include 'apic::host_agent'
63
+
64
+    }
65
+
66
+    class {'gbp::config':
67
+        policy_drivers => $policy_drivers,
68
+    }
69
+
70
+    class {'neutron::config':
71
+        service_plugins   => $service_plugins,
72
+        mechanism_drivers => $mechanism_drivers,
73
+    }
74
+
75
+    class {'neutron::config_apic':
76
+        apic_hosts        => $apic_hosts,
77
+        apic_username     => $apic_username,
78
+        apic_password     => $apic_password,
79
+        static_config     => $static_config,
80
+        additional_config => $additional_config,
81
+        ext_net_enable    => $ext_net_enable,
82
+        ext_net_name      => $ext_net_name,
83
+        ext_net_switch    => $ext_net_switch,
84
+        ext_net_port      => $ext_net_port,
85
+        ext_net_subnet    => $ext_net_subnet,
86
+        ext_net_gateway   => $ext_net_gateway,
87
+    }
88
+
89
+}

+ 37
- 0
deployment_scripts/puppet/modules/cisco_aci/manifests/gbp_and_mapping.pp View File

@@ -0,0 +1,37 @@
1
+#Class cisco_aci::gbp_and_mapping
2
+class cisco_aci::gbp_and_mapping (
3
+    $ha_prefix          = '',
4
+    $role               = 'compute',
5
+    $service_plugins    = 'neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,gbpservice.neutron.services.grouppolicy.plugin.GroupPolicyPlugin,gbpservice.neutron.services.servicechain.servicechain_plugin.ServiceChainPlugin',
6
+    $mechanism_drivers  = 'openvswitch',
7
+    $policy_drivers     = 'implicit_policy,resource_mapping',
8
+){
9
+    include 'apic::api'
10
+
11
+    case $role {
12
+        /controller/: {
13
+            include 'neutron::services::server'
14
+            include "neutron::services::${ha_prefix}agents"
15
+            include 'gbp::heat'
16
+            include "heat::${ha_prefix}services"
17
+            include 'gbp::horizon'
18
+            include 'gbp::client'
19
+            include 'gbp::manage'
20
+        }
21
+        'compute': {
22
+            include 'neutron::services::ovs_agent'
23
+        }
24
+        default: {
25
+        }
26
+    }
27
+
28
+    class {'gbp::config':
29
+        policy_drivers => $policy_drivers,
30
+    }
31
+
32
+    class {'neutron::config':
33
+        service_plugins   => $service_plugins,
34
+        mechanism_drivers => $mechanism_drivers,
35
+    }
36
+
37
+}

+ 79
- 0
deployment_scripts/puppet/modules/cisco_aci/manifests/generic_apic_ml2.pp View File

@@ -0,0 +1,79 @@
1
+#Class cisco_aci::generic_apic_ml2
2
+class cisco_aci::generic_apic_ml2 (
3
+    $ha_prefix          = '',
4
+    $role               = 'compute',
5
+    $use_lldp           = true,
6
+    $apic_hosts         = '10.0.0.1',
7
+    $apic_username      = 'admin',
8
+    $apic_password      = 'password',
9
+    $static_config      = '',
10
+    $additional_config  = '',
11
+    $service_plugins    = 'neutron.services.l3_router.l3_apic.ApicL3ServicePlugin',
12
+    $mechanism_drivers  = 'openvswitch,cisco_apic',
13
+    $admin_username     = 'admin',
14
+    $admin_password     = 'admin',
15
+    $admin_tenant       = 'admin',
16
+    $ext_net_enable     = false,
17
+    $ext_net_name       = 'ext',
18
+    $ext_net_switch     = '101',
19
+    $ext_net_port       = '1/1',
20
+    $ext_net_subnet     = '10.0.0.0/24',
21
+    $ext_net_gateway    = '10.0.0.1',
22
+){
23
+    include 'apic::params'
24
+    include 'apic::api'
25
+
26
+    case $role {
27
+        /controller/: {
28
+            if $use_lldp {
29
+                include 'apic::svc_agent'
30
+            }
31
+            include 'neutron::services::apic_server'
32
+            include "neutron::services::${ha_prefix}agents"
33
+            class {'neutron::config_auth':
34
+                admin_username => $admin_username,
35
+                admin_password => $admin_password,
36
+                admin_tenant   => $admin_tenant,
37
+            }
38
+            if ($role == 'primary-controller' and $ext_net_enable == true){
39
+                class {'neutron::network':
40
+                    tenant_name     => $admin_tenant,
41
+                    ext_net_name    => $ext_net_name,
42
+                    ext_net_subnet  => $ext_net_subnet,
43
+                    ext_net_gateway => $ext_net_gateway,
44
+                }
45
+            }
46
+        }
47
+        'compute': {
48
+            include 'neutron::services::ovs_agent'
49
+        }
50
+        default: {
51
+        }
52
+    }
53
+
54
+    if $use_lldp {
55
+        include 'lldp'
56
+        include 'apic::host_agent'
57
+
58
+    }
59
+
60
+    class {'neutron::config':
61
+        service_plugins   => $service_plugins,
62
+        mechanism_drivers => $mechanism_drivers,
63
+    }
64
+
65
+    class {'neutron::config_apic':
66
+        apic_hosts        => $apic_hosts,
67
+        apic_username     => $apic_username,
68
+        apic_password     => $apic_password,
69
+        static_config     => $static_config,
70
+        additional_config => $additional_config,
71
+        ext_net_enable    => $ext_net_enable,
72
+        ext_net_name      => $ext_net_name,
73
+        ext_net_switch    => $ext_net_switch,
74
+        ext_net_port      => $ext_net_port,
75
+        ext_net_subnet    => $ext_net_subnet,
76
+        ext_net_gateway   => $ext_net_gateway,
77
+    }
78
+
79
+}

+ 11
- 0
deployment_scripts/puppet/modules/gbp/manifests/client.pp View File

@@ -0,0 +1,11 @@
1
+#Class gbp::client
2
+class gbp::client (
3
+    $package_ensure = 'present',
4
+){
5
+    include gbp::params
6
+
7
+    package { 'gbp_client':
8
+        ensure => $package_ensure,
9
+        name   => $::gbp::params::package_gbp_client,
10
+    }
11
+}

+ 17
- 0
deployment_scripts/puppet/modules/gbp/manifests/config.pp View File

@@ -0,0 +1,17 @@
1
+#Class gbp::config
2
+class gbp::config (
3
+    $policy_drivers   = '',
4
+){
5
+    neutron_config {
6
+        'group_policy/policy_drivers':       value => $policy_drivers;
7
+        'servicechain/servicechain_drivers': value => 'simplechain_driver';
8
+        'quotas/default_quota':              value => '-1';
9
+        'quotas/quota_network':              value => '-1';
10
+        'quotas/quota_subnet':               value => '-1';
11
+        'quotas/quota_port':                 value => '-1';
12
+        'quotas/quota_security_group':       value => '-1';
13
+        'quotas/quota_security_group_rule':  value => '-1';
14
+        'quotas/quota_router':               value => '-1';
15
+        'quotas/quota_floatingip':           value => '-1';
16
+    }
17
+}

+ 18
- 0
deployment_scripts/puppet/modules/gbp/manifests/heat.pp View File

@@ -0,0 +1,18 @@
1
+#Class gbp::heat
2
+class gbp::heat (
3
+    $package_ensure = 'present',
4
+){
5
+    include gbp::params
6
+
7
+    Package['gbp_heat'] -> Heat_config<||>
8
+
9
+    package { 'gbp_heat':
10
+        ensure => $package_ensure,
11
+        name   => $::gbp::params::package_gbp_heat,
12
+    }
13
+
14
+    heat_config{
15
+        'DEFAULT/plugin_dirs'  : value => '/usr/lib/python2.7/dist-packages/gbpautomation/heat';
16
+    }
17
+
18
+}

+ 17
- 0
deployment_scripts/puppet/modules/gbp/manifests/horizon.pp View File

@@ -0,0 +1,17 @@
1
+#Class gbp::horizon
2
+class gbp::horizon (
3
+    $package_ensure = 'present',
4
+){
5
+    include gbp::params
6
+
7
+    $enable_project = ['_50_gbp_project_add_panel_group.py','_60_gbp_project_add_panel.py','_61_gbp_project_add_panel.py','_62_gbp_project_add_panel.py','_63_gbp_project_add_panel.py']
8
+
9
+    package { 'gbp_horizon':
10
+        ensure => $package_ensure,
11
+        name   => $::gbp::params::package_gbp_horizon,
12
+    }
13
+
14
+    horizon::project{$enable_project:
15
+        project_dir  => $::gbp::params::gbp_horizon_project,
16
+    }
17
+}

+ 22
- 0
deployment_scripts/puppet/modules/gbp/manifests/manage.pp View File

@@ -0,0 +1,22 @@
1
+#Class gbp::manage
2
+class gbp::manage (
3
+    $package_ensure = 'present',
4
+){
5
+    include gbp::params
6
+    include neutron::services::server
7
+
8
+    Exec['gbp_dbsync']  ~> Service['neutron-server']
9
+
10
+    package { 'gbp_manage':
11
+        ensure => $package_ensure,
12
+        name   => $::gbp::params::package_gbp_manage,
13
+    }
14
+
15
+    exec { 'gbp_dbsync':
16
+        command     => $::gbp::params::dbsync_command,
17
+        path        => '/usr/bin',
18
+        refreshonly => true,
19
+        logoutput   => on_failure,
20
+        require     => Package['gbp_manage'],
21
+    }
22
+}

+ 22
- 0
deployment_scripts/puppet/modules/gbp/manifests/params.pp View File

@@ -0,0 +1,22 @@
1
+#Class gbp::params
2
+class gbp::params {
3
+
4
+    $dbsync_command = 'gbp-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head'
5
+
6
+    case $::osfamily {
7
+        'RedHat': {
8
+        }
9
+
10
+        'Debian': {
11
+            $package_gbp_client     = 'python-python-group-based-policy-client'
12
+            $package_gbp_manage     = 'python-group-based-policy'
13
+            $package_gbp_heat       = 'python-group-based-policy-automation'
14
+            $package_gbp_horizon    = 'python-group-based-policy-ui'
15
+            $gbp_horizon_project    = '/usr/lib/python2.7/dist-packages/gbpui'
16
+        }
17
+
18
+        default: {
19
+            fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
20
+        }
21
+    }
22
+}

+ 49
- 0
deployment_scripts/puppet/modules/heat/manifests/ha_services.pp View File

@@ -0,0 +1,49 @@
1
+#Class heat::ha_services
2
+class heat::ha_services (
3
+  $enabled  = true,
4
+) {
5
+
6
+    include heat::params
7
+
8
+    if $enabled {
9
+        $service_ensure = 'running'
10
+    } else {
11
+        $service_ensure = 'stopped'
12
+    }
13
+
14
+    service { 'heat-api':
15
+        ensure     => $service_ensure,
16
+        name       => $::heat::params::api_service_name,
17
+        enable     => $enabled,
18
+        hasstatus  => true,
19
+        hasrestart => true,
20
+        tag        => 'heat',
21
+    }
22
+    service { 'heat-api-cloudwatch':
23
+        ensure     => $service_ensure,
24
+        name       => $::heat::params::api_cloudwatch_service_name,
25
+        enable     => $enabled,
26
+        hasstatus  => true,
27
+        hasrestart => true,
28
+        tag        => 'heat',
29
+    }
30
+    service { 'heat-api-cfn':
31
+        ensure     => $service_ensure,
32
+        name       => $::heat::params::api_cfn_service_name,
33
+        enable     => $enabled,
34
+        hasstatus  => true,
35
+        hasrestart => true,
36
+        tag        => 'heat',
37
+    }
38
+    service { 'heat-engine':
39
+        ensure     => $service_ensure,
40
+        name       => $::heat::params::engine_ha_service_name,
41
+        enable     => $enabled,
42
+        hasstatus  => true,
43
+        hasrestart => true,
44
+        provider   => 'pacemaker',
45
+        tag        => 'heat',
46
+    }
47
+
48
+    Heat_config<||> ~> Service<| tag == 'heat' |>
49
+}

+ 31
- 0
deployment_scripts/puppet/modules/heat/manifests/params.pp View File

@@ -0,0 +1,31 @@
1
+# Parameters for puppet-heat
2
+#
3
+class heat::params {
4
+
5
+  $dbsync_command =
6
+    'heat-manage --config-file /etc/heat/heat.conf db_sync'
7
+
8
+  case $::osfamily {
9
+    'RedHat': {
10
+      # service names
11
+      $api_service_name = 'openstack-heat-api'
12
+      $api_cloudwatch_service_name = 'openstack-heat-api-cloudwatch'
13
+      $api_cfn_service_name = 'openstack-heat-api-cfn'
14
+      $engine_service_name = 'openstack-heat-engine'
15
+      $engine_ha_service_name = 'p_openstack-heat-engine'
16
+    }
17
+    'Debian': {
18
+      # service names
19
+      $api_service_name = 'heat-api'
20
+      $api_cloudwatch_service_name = 'heat-api-cloudwatch'
21
+      $api_cfn_service_name = 'heat-api-cfn'
22
+      $engine_service_name = 'heat-engine'
23
+      $engine_ha_service_name = 'p_heat-engine'
24
+    }
25
+    default: {
26
+      fail("Unsupported osfamily: ${::osfamily} operatingsystem: \
27
+${::operatingsystem}, module ${module_name} only support osfamily \
28
+RedHat and Debian")
29
+    }
30
+  }
31
+}

+ 48
- 0
deployment_scripts/puppet/modules/heat/manifests/services.pp View File

@@ -0,0 +1,48 @@
1
+#Class heat::services
2
+class heat::services (
3
+  $enabled  = true,
4
+) {
5
+
6
+    include heat::params
7
+
8
+    if $enabled {
9
+        $service_ensure = 'running'
10
+    } else {
11
+        $service_ensure = 'stopped'
12
+    }
13
+
14
+    service { 'heat-api':
15
+        ensure     => $service_ensure,
16
+        name       => $::heat::params::api_service_name,
17
+        enable     => $enabled,
18
+        hasstatus  => true,
19
+        hasrestart => true,
20
+        tag        => 'heat',
21
+    }
22
+    service { 'heat-api-cloudwatch':
23
+        ensure     => $service_ensure,
24
+        name       => $::heat::params::api_cloudwatch_service_name,
25
+        enable     => $enabled,
26
+        hasstatus  => true,
27
+        hasrestart => true,
28
+        tag        => 'heat',
29
+    }
30
+    service { 'heat-api-cfn':
31
+        ensure     => $service_ensure,
32
+        name       => $::heat::params::api_cfn_service_name,
33
+        enable     => $enabled,
34
+        hasstatus  => true,
35
+        hasrestart => true,
36
+        tag        => 'heat',
37
+    }
38
+    service { 'heat-engine_service':
39
+        ensure     => $service_ensure,
40
+        name       => $::heat::params::engine_service_name,
41
+        enable     => $enabled,
42
+        hasstatus  => true,
43
+        hasrestart => true,
44
+        tag        => 'heat',
45
+    }
46
+
47
+    Heat_config<||> ~> Service<| tag == 'heat' |>
48
+}

+ 19
- 0
deployment_scripts/puppet/modules/horizon/manifests/params.pp View File

@@ -0,0 +1,19 @@
1
+# these parameters need to be accessed from several locations and
2
+# should be considered to be constant
3
+class horizon::params {
4
+
5
+    $dashboard_enabled  = '/usr/share/openstack-dashboard/openstack_dashboard/enabled'
6
+
7
+    case $::osfamily {
8
+        'RedHat': {
9
+            $http_service   = 'httpd'
10
+        }
11
+        'Debian': {
12
+            $http_service       = 'apache2'
13
+        }
14
+        default: {
15
+            fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
16
+        }
17
+    }
18
+
19
+}

+ 15
- 0
deployment_scripts/puppet/modules/horizon/manifests/project.pp View File

@@ -0,0 +1,15 @@
1
+#
2
+define horizon::project(
3
+    $project_dir = '/tmp',
4
+){
5
+    include horizon::params
6
+    include horizon::service
7
+
8
+    File[$name]   ~> Service['httpd']
9
+
10
+    file {$name:
11
+        ensure => link,
12
+        path   => "${::horizon::params::dashboard_enabled}/${name}",
13
+        target => "${project_dir}/${name}",
14
+    }
15
+}

+ 13
- 0
deployment_scripts/puppet/modules/horizon/manifests/service.pp View File

@@ -0,0 +1,13 @@
1
+#
2
+class horizon::service(
3
+    $package_ensure         = present,
4
+) {
5
+
6
+    include horizon::params
7
+
8
+    service { 'httpd':
9
+        ensure => 'running',
10
+        name   => $::horizon::params::http_service,
11
+        enable => true
12
+    }
13
+}

+ 58
- 0
deployment_scripts/puppet/modules/lldp/manifests/init.pp View File

@@ -0,0 +1,58 @@
1
+#Class lldp
2
+
3
+class lldp (
4
+        $ensure       = 'present',
5
+        $autoupdate   = true,
6
+        $package_name = 'lldpd',
7
+        $service_name = 'lldpd',
8
+    ){
9
+
10
+    include lldp::params
11
+    case $ensure {
12
+        'present': {
13
+            if $autoupdate {
14
+                $pkg_ensure = 'latest'
15
+            } else {
16
+                $pkg_ensure = 'present'
17
+            }
18
+            $svc_ensure   = 'running'
19
+            $svc_enable   = true
20
+            $file_ensure  = 'present'
21
+        }
22
+        'absent': {
23
+            $pkg_ensure   = 'absent'
24
+            $svc_ensure   = 'stopped'
25
+            $svc_enable   = false
26
+            $file_ensure  = 'absent'
27
+        }
28
+        'purged': {
29
+            $pkg_ensure   = 'purged'
30
+            $svc_ensure   = 'stopped'
31
+            $svc_enable   = false
32
+            $file_ensure  = 'absent'
33
+        }
34
+        default: {
35
+        }
36
+    }
37
+
38
+    package {$package_name:
39
+        ensure => $pkg_ensure,
40
+    }
41
+
42
+    file {$::lldp::params::config_file_path:
43
+        ensure  => $file_ensure,
44
+        content => inline_template($::lldp::params::config_file_data),
45
+        require => Package[$package_name],
46
+        notify  => Service[$service_name],
47
+    }
48
+
49
+    service {$service_name:
50
+        ensure     => $svc_ensure,
51
+        enable     => $svc_enable,
52
+        require    => File[$::lldp::params::config_file_path],
53
+        hasstatus  => false,
54
+        hasrestart => true,
55
+    }
56
+
57
+}
58
+

+ 20
- 0
deployment_scripts/puppet/modules/lldp/manifests/params.pp View File

@@ -0,0 +1,20 @@
1
+#Class lldp::params
2
+
3
+class lldp::params {
4
+
5
+    $autoupdate = false
6
+    $package_name = 'lldpd'
7
+    $service_name = 'lldpd'
8
+
9
+    case $::osfamily {
10
+        'Debian': {
11
+            $config_file_path = '/etc/default/lldpd'
12
+            $config_file_data = '#Generated by puppet <%= "\n" %>DAEMON_ARGS="-c -I eth*"<%= "\n" %>'
13
+        }
14
+        'RedHat': {
15
+            $config_file_path = '/etc/sysconfig/lldpd'
16
+            $config_file_data = '#Generated by puppet <%= "\n" %>LLDPD_OPTIONS="-c -I eth*"<%= "\n" %>'
17
+        }
18
+        default: { fail("lldp: unsuported OS family ${::osfamily}") }
19
+    }
20
+}

+ 3
- 0
deployment_scripts/puppet/modules/neutron/files/neutron View File

@@ -0,0 +1,3 @@
1
+configs+=(
2
+    "/etc/neutron/plugins/ml2/ml2_conf_cisco.ini" \
3
+)

+ 25
- 0
deployment_scripts/puppet/modules/neutron/files/neutron-server.conf View File

@@ -0,0 +1,25 @@
1
+# vim:set ft=upstart ts=2 et:
2
+description "Neutron API Server"
3
+author "Chuck Short <zulcss@ubuntu.com>"
4
+
5
+start on runlevel [2345]
6
+stop on runlevel [!2345]
7
+
8
+respawn
9
+
10
+chdir /var/run
11
+
12
+pre-start script
13
+  mkdir -p /var/run/neutron
14
+  chown neutron:root /var/run/neutron
15
+end script
16
+
17
+script
18
+  [ -r /etc/default/neutron-server ] && . /etc/default/neutron-server
19
+  [ -r "$NEUTRON_PLUGIN_CONFIG" ] && CONF_ARG="--config-file $NEUTRON_PLUGIN_CONFIG"
20
+  exec start-stop-daemon --start --chuid neutron --exec /usr/bin/neutron-server -- \
21
+    --config-file /etc/neutron/neutron.conf \
22
+    --config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
23
+    --config-file /etc/neutron/plugins/ml2/ml2_conf_cisco.ini \
24
+    --log-file /var/log/neutron/server.log $CONF_ARG
25
+end script

+ 26
- 0
deployment_scripts/puppet/modules/neutron/manifests/config.pp View File

@@ -0,0 +1,26 @@
1
+#Class neutron::config
2
+
3
+class neutron::config (
4
+    $service_plugins    = 'neutron.services.l3_router.l3_router_plugin.L3RouterPlugin',
5
+    $mechanism_drivers  = 'openvswitch',
6
+){
7
+
8
+    neutron_config {
9
+        'DEFAULT/service_plugins':  value => $service_plugins;
10
+        'DEFAULT/core_plugin':      value => 'neutron.plugins.ml2.plugin.Ml2Plugin';
11
+    }
12
+    neutron_plugin_ml2 {
13
+        'ml2/type_drivers':                     value => 'local,flat,vlan,gre,vxlan';
14
+        'ml2/tenant_network_types':             value => 'vlan';
15
+        'ml2/mechanism_drivers':                value => $mechanism_drivers;
16
+        #'ml2_type_vlan/network_vlan_ranges':    value => "$physnets_dev:$vlan_range";
17
+        'securitygroup/enable_security_group':  value => 'True';
18
+        'securitygroup/firewall_driver':        value => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver';
19
+        #'ovs/integration_bridge':               value => "$int_bridge";
20
+        #'ovs/bridge_mappings':                  value => "$physnets_dev:$int_bridge";
21
+        #'ovs/enable_tunneling':                 value => 'False';
22
+        'agent/polling_interval':               value => '2';
23
+        'agent/l2_population':                  value => 'False';
24
+        'agent/arp_responder':                  value => 'False';
25
+    }
26
+}

+ 45
- 0
deployment_scripts/puppet/modules/neutron/manifests/config_apic.pp View File

@@ -0,0 +1,45 @@
1
+#Class neutron::config_apic
2
+class neutron::config_apic (
3
+    $apic_hosts         = '10.0.0.1',
4
+    $apic_username      = 'admin',
5
+    $apic_password      = 'password',
6
+    $static_config      = '',
7
+    $additional_config  = '',
8
+    $ext_net_enable     = false,
9
+    $ext_net_name       = 'ext',
10
+    $ext_net_switch     = '101',
11
+    $ext_net_port       = '1/1',
12
+    $ext_net_subnet     = '10.0.0.0/24',
13
+    $ext_net_gateway    = '10.0.0.1',
14
+){
15
+
16
+    neutron_plugin_ml2_cisco {
17
+        'DEFAULT/apic_system_id':           value => 'openstack';
18
+        'ml2_cisco_apic/apic_hosts':        value => $apic_hosts;
19
+        'ml2_cisco_apic/apic_username':     value => $apic_username;
20
+        'ml2_cisco_apic/apic_password':     value => $apic_password;
21
+        'ml2_cisco_apic/apic_name_mapping': value => 'use_name' ;
22
+        'ml2_cisco_apic/root_helper':       value => 'sudo';
23
+    }
24
+    if !empty($additional_config) {
25
+        file_line{ 'additional_config':
26
+            path => '/etc/neutron/plugins/ml2/ml2_conf_cisco.ini',
27
+            line => $additional_config,
28
+        }
29
+    }
30
+    if !empty($static_config) {
31
+        file_line{ 'static_config':
32
+            path => '/etc/neutron/plugins/ml2/ml2_conf_cisco.ini',
33
+            line => $static_config,
34
+        }
35
+    }
36
+    if ($ext_net_enable == true){
37
+        neutron_plugin_ml2_cisco {
38
+            "apic_external_network:${ext_net_name}/switch":       value => $ext_net_switch;
39
+            "apic_external_network:${ext_net_name}/port":         value => $ext_net_port;
40
+            "apic_external_network:${ext_net_name}/cidr_exposed": value => $ext_net_subnet;
41
+            "apic_external_network:${ext_net_name}/gateway_ip":   value => $ext_net_gateway;
42
+
43
+        }
44
+    }
45
+}

+ 13
- 0
deployment_scripts/puppet/modules/neutron/manifests/config_auth.pp View File

@@ -0,0 +1,13 @@
1
+#Class neutron::config_auth
2
+class neutron::config_auth (
3
+    $admin_username   = 'admin',
4
+    $admin_password   = 'admin',
5
+    $admin_tenant     = 'admin',
6
+){
7
+
8
+    neutron_config {
9
+        'keystone_authtoken/admin_user':            value => $admin_username;
10
+        'keystone_authtoken/admin_password':        value => $admin_password;
11
+        'keystone_authtoken/admin_tenant_name':     value => $admin_tenant;
12
+    }
13
+}

+ 39
- 0
deployment_scripts/puppet/modules/neutron/manifests/network.pp View File

@@ -0,0 +1,39 @@
1
+#Class neutron::network
2
+class neutron::network (
3
+    $ensure             = 'present',
4
+    $ext_net_name       = 'extnet',
5
+    $ext_net_subnet     = '10.0.0.0/24',
6
+    $ext_net_gateway    = '10.0.0.1',
7
+    $shared             = true,
8
+    $tenant_name        = 'admin',
9
+) {
10
+
11
+    neutron_network { $ext_net_name:
12
+        ensure          => $ensure,
13
+        router_external => true,
14
+        tenant_name     => $tenant_name,
15
+        shared          => $shared,
16
+    }
17
+    ->
18
+    neutron_subnet { "${ext_net_name}__subnet":
19
+        ensure       => $ensure,
20
+        cidr         => $ext_net_subnet,
21
+        network_name => $ext_net_name,
22
+        tenant_name  => $tenant_name,
23
+        gateway_ip   => $ext_net_gateway,
24
+    }
25
+    ->
26
+    neutron_router { "${ext_net_name}__router":
27
+        ensure      => $ensure,
28
+        tenant_name => $tenant_name,
29
+    }
30
+    ->
31
+    neutron_router_interface { "${ext_net_name}__router:${ext_net_name}__subnet":
32
+        ensure => present,
33
+    }
34
+
35
+    Service<| title == 'neutron-server'|> -> Neutron_network<||>
36
+    Service<| title == 'neutron-server'|> -> Neutron_subnet<||>
37
+    Service<| title == 'neutron-server'|> -> Neutron_router<||>
38
+    Service<| title == 'neutron-server'|> -> Neutron_router_interface<||>
39
+}

+ 31
- 0
deployment_scripts/puppet/modules/neutron/manifests/params.pp View File

@@ -0,0 +1,31 @@
1
+#Class neutron::params
2
+class neutron::params {
3
+
4
+    $ha_metadata_agent      = 'p_neutron-metadata-agent'
5
+    $ha_dhcp_agent          = 'p_neutron-dhcp-agent'
6
+    $ha_l3_agent            = 'p_neutron-l3-agent'
7
+    $service_metadata_agent = 'neutron-metadata-agent'
8
+    $service_dhcp_agent     = 'neutron-dhcp-agent'
9
+    $service_l3_agent       = 'neutron-l3-agent'
10
+    $service_neutron_server = 'neutron-server'
11
+
12
+    case $::osfamily {
13
+        'RedHat': {
14
+            $service_ovs_agent      = 'neutron-openvswitch-agent'
15
+            $ha_ovs_agent           = 'p_neutron-openvswitch-agent'
16
+            $initd_file_path        = '/etc/sysconfig/neutron'
17
+            $initd_file_template    = 'puppet:///modules/neutron/neutron'
18
+        }
19
+
20
+        'Debian': {
21
+            $service_ovs_agent      = 'neutron-plugin-openvswitch-agent'
22
+            $ha_ovs_agent           = 'p_neutron-plugin-openvswitch-agent'
23
+            $initd_file_path        = '/etc/init/neutron-server.conf'
24
+            $initd_file_template    = 'puppet:///modules/neutron/neutron-server.conf'
25
+        }
26
+
27
+        default: {
28
+          fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")
29
+        }
30
+    }
31
+}

+ 57
- 0
deployment_scripts/puppet/modules/neutron/manifests/services/agents.pp View File

@@ -0,0 +1,57 @@
1
+#Class neutron::services::agents
2
+class neutron::services::agents (
3
+    $enabled        = true,
4
+    $manage_service = true,
5
+){
6
+    include neutron::params
7
+
8
+    if $manage_service {
9
+        if $enabled {
10
+            $service_ensure = 'running'
11
+        } else {
12
+            $service_ensure = 'stopped'
13
+        }
14
+    }
15
+
16
+    service { 'neutron-ovs-agent':
17
+        ensure     => $service_ensure,
18
+        name       => $::neutron::params::service_ovs_agent,
19
+        enable     => $enabled,
20
+        hasstatus  => true,
21
+        hasrestart => true,
22
+        tag        => 'neutron_agents'
23
+    }
24
+
25
+    service { 'neutron-metadata-agent':
26
+        ensure     => $service_ensure,
27
+        name       => $::neutron::params::service_metadata_agent,
28
+        enable     => $enabled,
29
+        hasstatus  => true,
30
+        hasrestart => true,
31
+        tag        => 'neutron_agents'
32
+    }
33
+
34
+    service { 'neutron-dhcp-agent':
35
+        ensure     => $service_ensure,
36
+        name       => $::neutron::params::service_dhcp_agent,
37
+        enable     => $enabled,
38
+        hasstatus  => true,
39
+        hasrestart => true,
40
+        tag        => 'neutron_agents'
41
+    }
42
+
43
+    service { 'neutron-l3-agent':
44
+        ensure     => $service_ensure,
45
+        name       => $::neutron::params::service_l3_agent,
46
+        enable     => $enabled,
47
+        hasstatus  => true,
48
+        hasrestart => true,
49
+        tag        => 'neutron_agents'
50
+    }
51
+
52
+    Neutron_config<||>              ~> Service<| tag == 'neutron_agents' |>
53
+    Neutron_plugin_ml2<||>          ~> Service<| tag == 'neutron_agents' |>
54
+    Neutron_plugin_ml2_cisco<||>    ~> Service<| tag == 'neutron_agents' |>
55
+    File_line<||>                   ~> Service<| tag == 'neutron_agents' |>
56
+
57
+}

+ 16
- 0
deployment_scripts/puppet/modules/neutron/manifests/services/apic_server.pp View File

@@ -0,0 +1,16 @@
1
+#Class neutron::services::apic_server
2
+class neutron::services::apic_server (
3
+    $enabled        = true,
4
+    $manage_service = true,
5
+){
6
+    include neutron::params
7
+    include neutron::services::server
8
+
9
+    File['neutron_initd']   ~> Service['neutron-server']
10
+
11
+    file {'neutron_initd':
12
+        ensure => 'present',
13
+        path   => $::neutron::params::initd_file_path,
14
+        source => $::neutron::params::initd_file_template,
15
+    }
16
+}

+ 62
- 0
deployment_scripts/puppet/modules/neutron/manifests/services/ha_agents.pp View File

@@ -0,0 +1,62 @@
1
+#Class neutron::services::ha_agents
2
+class neutron::services::ha_agents (
3
+    $enabled        = true,
4
+    $manage_service = true,
5
+){
6
+    include neutron::params
7
+
8
+    if $manage_service {
9
+        if $enabled {
10
+            $service_ensure = 'running'
11
+        } else {
12
+            $service_ensure = 'stopped'
13
+        }
14
+    }
15
+
16
+    service {'neutron-dhcp-agent':
17
+        ensure     => $service_ensure,
18
+        name       => $::neutron::params::ha_dhcp_agent,
19
+        enable     => $enabled,
20
+        hasstatus  => true,
21
+        hasrestart => false,
22
+        provider   => 'pacemaker',
23
+        tag        => 'ha_agents',
24
+    }
25
+
26
+    service {'neutron-metadata-agent':
27
+        ensure     => $service_ensure,
28
+        name       => $::neutron::params::ha_metadata_agent,
29
+        enable     => $enabled,
30
+        hasstatus  => true,
31
+        hasrestart => false,
32
+        provider   => 'pacemaker',
33
+        tag        => 'ha_agents',
34
+    }
35
+
36
+    service {'neutron-plugin-openvswitch-agent':
37
+        ensure     => $service_ensure,
38
+        name       => $::neutron::params::ha_ovs_agent,
39
+        enable     => $enabled,
40
+        hasstatus  => true,
41
+        hasrestart => false,
42
+        provider   => 'pacemaker',
43
+        tag        => 'ha_agents',
44
+    }
45
+
46
+    service {'neutron-l3-agent':
47
+        ensure     => $service_ensure,
48
+        name       => $::neutron::params::ha_l3_agent,
49
+        enable     => $enabled,
50
+        hasstatus  => true,
51
+        hasrestart => false,
52
+        provider   => 'pacemaker',
53
+        tag        => 'ha_agents',
54
+    }
55
+
56
+
57
+    Neutron_config<||>              ~> Service<| tag == 'ha_agents' |>
58
+    Neutron_plugin_ml2<||>          ~> Service<| tag == 'ha_agents' |>
59
+    Neutron_plugin_ml2_cisco<||>    ~> Service<| tag == 'ha_agents' |>
60
+    File_line<||>                   ~> Service<| tag == 'ha_agents' |>
61
+
62
+}

+ 29
- 0
deployment_scripts/puppet/modules/neutron/manifests/services/ovs_agent.pp View File

@@ -0,0 +1,29 @@
1
+#Class neutron::services::ovs_agent
2
+class neutron::services::ovs_agent (
3
+    $enabled        = true,
4
+    $manage_service = true,
5
+){
6
+    include neutron::params
7
+
8
+    if $manage_service {
9
+        if $enabled {
10
+            $service_ensure = 'running'
11
+        } else {
12
+            $service_ensure = 'stopped'
13
+        }
14
+    }
15
+
16
+    service { 'neutron-ovs-agent':
17
+        ensure     => $service_ensure,
18
+        name       => $::neutron::params::service_ovs_agent,
19
+        enable     => $enabled,
20
+        hasstatus  => true,
21
+        hasrestart => true,
22
+    }
23
+
24
+    Neutron_config<||>              ~> Service['neutron-ovs-agent']
25
+    Neutron_plugin_ml2<||>          ~> Service['neutron-ovs-agent']
26
+    Neutron_plugin_ml2_cisco<||>    ~> Service['neutron-ovs-agent']
27
+    File_line<||>                   ~> Service['neutron-ovs-agent']
28
+
29
+}

+ 35
- 0
deployment_scripts/puppet/modules/neutron/manifests/services/server.pp View File

@@ -0,0 +1,35 @@
1
+#Class neutron::services::server
2
+class neutron::services::server (
3
+    $enabled        = true,
4
+    $manage_service = true,
5
+){
6
+    include neutron::params
7
+
8
+    if $manage_service {
9
+        if $enabled {
10
+            $service_ensure = 'running'
11
+        } else {
12
+            $service_ensure = 'stopped'
13
+        }
14
+    }
15
+
16
+    File['rootwrap']                ~> Service['neutron-server']
17
+    Neutron_config<||>              ~> Service['neutron-server']
18
+    Neutron_plugin_ml2<||>          ~> Service['neutron-server']
19
+    Neutron_plugin_ml2_cisco<||>    ~> Service['neutron-server']
20
+    File_line<||>                   ~> Service['neutron-server']
21
+
22
+    file {'rootwrap':
23
+        ensure => link,
24
+        path   => '/usr/local/bin/neutron-rootwrap',
25
+        target => '/usr/bin/neutron-rootwrap',
26
+    }
27
+
28
+    service { 'neutron-server':
29
+        ensure     => $service_ensure,
30
+        name       => $::neutron::params::service_neutron_server,
31
+        enable     => $enabled,
32
+        hasstatus  => true,
33
+        hasrestart => true,
34
+    }
35
+}

+ 71
- 0
deployment_scripts/puppet/site.pp View File

@@ -0,0 +1,71 @@
1
+
2
+$role               = hiera('role')
3
+$deployment_mode    = hiera('deployment_mode')
4
+$cisco_aci_hash     = hiera('cisco_aci',{})
5
+$access_hash        = hiera('access',{})
6
+
7
+$ha_prefix = $deployment_mode ? {
8
+    'ha_compact'    => 'ha_',
9
+    default         => '',
10
+}
11
+
12
+if ($cisco_aci_hash['use_gbp'] == false and $cisco_aci_hash['use_apic'] == false){
13
+    fail('Wrong configuration')
14
+}
15
+
16
+if ($cisco_aci_hash['use_gbp'] == false and $cisco_aci_hash['use_apic'] == true){
17
+    if ($cisco_aci_hash['driver_type'] == 'ML2'){
18
+        $install_type   = 'US1'
19
+        $class_name     = 'generic_apic_ml2'
20
+    }else{
21
+        fail('Wrong configuration')
22
+    }
23
+}
24
+
25
+if ($cisco_aci_hash['use_gbp'] == true and $cisco_aci_hash['use_apic'] == false){
26
+    $install_type   = 'US2a'
27
+    $class_name     = 'gbp_and_mapping'
28
+}
29
+
30
+if ($cisco_aci_hash['use_gbp'] == true and $cisco_aci_hash['use_apic'] == true){
31
+    if ($cisco_aci_hash['driver_type'] == 'ML2'){
32
+        $install_type   = 'US2b'
33
+        $class_name     = 'gbp_and_apic_ml2'
34
+    }elsif ($cisco_aci_hash['driver_type'] == 'GBP'){
35
+        $install_type   = 'US3'
36
+        $class_name     = 'gbp_and_apic_gbp'
37
+    }
38
+}
39
+
40
+case $install_type {
41
+    'US1','US2b','US3': {
42
+        class {"cisco_aci::${class_name}":
43
+            ha_prefix         => $ha_prefix,
44
+            role              => $role,
45
+            admin_username    => $access_hash['user'],
46
+            admin_password    => $access_hash['password'],
47
+            admin_tenant      => $access_hash['tenant'],
48
+            use_lldp          => $cisco_aci_hash['use_lldp'],
49
+            apic_hosts        => $cisco_aci_hash['apic_hosts'],
50
+            apic_username     => $cisco_aci_hash['apic_username'],
51
+            apic_password     => $cisco_aci_hash['apic_password'],
52
+            static_config     => $cisco_aci_hash['static_config'],
53
+            additional_config => $cisco_aci_hash['additional_config'],
54
+            ext_net_enable    => $cisco_aci_hash['ext_net_enable'],
55
+            ext_net_name      => $cisco_aci_hash['ext_net_name'],
56
+            ext_net_switch    => $cisco_aci_hash['ext_net_switch'],
57
+            ext_net_port      => $cisco_aci_hash['ext_net_port'],
58
+            ext_net_subnet    => $cisco_aci_hash['ext_net_subnet'],
59
+            ext_net_gateway   => $cisco_aci_hash['ext_net_gateway'],
60
+        }
61
+    }
62
+    'US2a': {
63
+        class {"cisco_aci::${class_name}":
64
+            ha_prefix => $ha_prefix,
65
+            role      => $role,
66
+        }
67
+    }
68
+    default: {
69
+        fail("Wrong module ${module_name}")
70
+    }
71
+}

+ 19
- 5
metadata.yaml View File

@@ -1,21 +1,35 @@
1 1
 # Plugin name
2 2
 name: cisco_aci
3 3
 # Human-readable name for your plugin
4
-title: Cisco APIC Plugin support
4
+title: Cisco APIC Plugin
5 5
 # Plugin version
6
-version: 1.0.0
6
+version: 1.0.1
7 7
 # Description
8 8
 description: Enable to use Cisco SDN solutions for Neutron
9 9
 # Required fuel version
10
-fuel_version: ['6.0']
10
+fuel_version: ['6.1']
11
+# Specify license of your plugin
12
+licenses: ['Apache License Version 2.0']
13
+# Specify author or company name
14
+authors: ['Mirantis']
15
+# A link to the plugin's page
16
+homepage: 'https://github.com/noironetworks/fuel-plugin-cisco-aci'
17
+# Specify a group which your plugin implements, possible options:
18
+# # network, storage, storage::cinder, storage::glance, hypervisor
19
+groups: ['network']
11 20
 
12 21
 # The plugin is compatible with releases in the list
13 22
 releases:
23
+  - os: centos
24
+    version: 2014.2-6.1
25
+    mode: ['ha', 'multinode']
26
+    deployment_scripts_path: deployment_scripts/
27
+    repository_path: repositories/ubuntu
14 28
   - os: ubuntu
15
-    version: 2014.2-6.0
29
+    version: 2014.2-6.1
16 30
     mode: ['ha', 'multinode']
17 31
     deployment_scripts_path: deployment_scripts/
18 32
     repository_path: repositories/ubuntu
19 33
 
20 34
 # Version of plugin package
21
-package_version: '1.0.0'
35
+package_version: '2.0.0'

+ 13
- 0
pre_build_hook View File

@@ -0,0 +1,13 @@
1
+#!/bin/bash
2
+set -eux
3
+ROOT="$(dirname `readlink -f $0`)"
4
+MODULES="${ROOT}"/deployment_scripts/puppet/modules
5
+mkdir -p "${MODULES}"
6
+#REPO_PATH='https://github.com/stackforge/fuel-library/tarball/aded04f6b5d4dbc4b4e4cf904fc882879184d097'
7
+REPO_PATH='https://api.github.com/repos/stackforge/fuel-library/tarball/a478b8c6180af33612b19d09785bd63f2b6673c6'
8
+RPM_REPO="${ROOT}"/repositories/centos/
9
+DEB_REPO="${ROOT}"/repositories/ubuntu/
10
+
11
+wget -qO- "${REPO_PATH}" | \
12
+    tar -C "${MODULES}" --strip-components=3 -zxvf - \
13
+    stackforge-fuel-library-a478b8c/deployment/puppet/{inifile,stdlib,pacemaker}

+ 2
- 2
tasks.yaml View File

@@ -2,10 +2,10 @@
2 2
 # here you can also specify several roles, for example
3 3
 # ['cinder', 'compute'] will be applied only on
4 4
 # cinder and compute nodes
5
-- role: ['controller','compute']
5
+- role: ['primary-controller','controller','compute']
6 6
   stage: post_deployment
7 7
   type: puppet
8 8
   parameters:
9 9
     puppet_manifest: puppet/site.pp
10 10
     puppet_modules: puppet/modules/
11
-    timeout: 42
11
+    timeout: 3600

Loading…
Cancel
Save