Browse Source

Initial Commit - Fuel PLUMgrid Plugin

- Supports MOS 7.0 deployment

Change-Id: I3f6a17ba3b8720e22d3d1be29e45b13077879210
Signed-off-by: Javeria Khan <javeriak@plumgrid.com>
Javeria Khan 3 years ago
parent
commit
6ec9f25b1a
37 changed files with 1980 additions and 0 deletions
  1. 202
    0
      LICENSE
  2. 61
    0
      README.md
  3. 35
    0
      deployment_scripts/cleanup_os.sh
  4. 30
    0
      deployment_scripts/pg_os_version.sh
  5. 48
    0
      deployment_scripts/plumgrid_fabric.sh
  6. 60
    0
      deployment_scripts/post_pg_license.sh
  7. 167
    0
      deployment_scripts/puppet/manifests/director.pp
  8. 34
    0
      deployment_scripts/puppet/manifests/director_fixes.pp
  9. 159
    0
      deployment_scripts/puppet/manifests/edge.pp
  10. 63
    0
      deployment_scripts/puppet/manifests/gateway.pp
  11. 85
    0
      deployment_scripts/puppet/manifests/pg_common.pp
  12. 23
    0
      deployment_scripts/puppet/manifests/pre_deployment.pp
  13. 51
    0
      deployment_scripts/puppet/manifests/tools.pp
  14. 92
    0
      deployment_scripts/puppet/modules/plumgrid/files/network.filters
  15. 26
    0
      deployment_scripts/puppet/modules/plumgrid/files/plumgrid_plugin.py
  16. 51
    0
      deployment_scripts/puppet/modules/plumgrid/manifests/firewall.pp
  17. 105
    0
      deployment_scripts/puppet/modules/plumgrid/manifests/init.pp
  18. 34
    0
      deployment_scripts/puppet/modules/plumgrid/manifests/params.pp
  19. 62
    0
      deployment_scripts/puppet/modules/plumgrid/manifests/repo.pp
  20. 10
    0
      deployment_scripts/puppet/modules/plumgrid/templates/hosts.erb
  21. 7
    0
      deployment_scripts/puppet/modules/plumgrid/templates/ifcs.conf.erb
  22. 13
    0
      deployment_scripts/puppet/modules/plumgrid/templates/plumgrid.conf.erb
  23. 40
    0
      deployment_scripts/puppet/modules/sal/manifests/init.pp
  24. 50
    0
      deployment_scripts/puppet/modules/sal/manifests/keepalived.pp
  25. 56
    0
      deployment_scripts/puppet/modules/sal/manifests/nginx.pp
  26. 139
    0
      deployment_scripts/puppet/modules/sal/templates/default.conf.erb
  27. 30
    0
      deployment_scripts/puppet/modules/sal/templates/keepalived.conf.erb
  28. 115
    0
      deployment_tasks.yaml
  29. 77
    0
      environment_config.yaml
  30. 26
    0
      metadata.yaml
  31. 6
    0
      network_roles.yaml
  32. 7
    0
      node_roles.yaml
  33. 5
    0
      pre_build_hook
  34. 0
    0
      repositories/centos/.gitkeep
  35. 0
    0
      repositories/ubuntu/.gitkeep
  36. 6
    0
      tasks.yaml
  37. 5
    0
      volumes.yaml

+ 202
- 0
LICENSE View File

@@ -0,0 +1,202 @@
1
+Apache License
2
+                           Version 2.0, January 2004
3
+                        http://www.apache.org/licenses/
4
+
5
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+   1. Definitions.
8
+
9
+      "License" shall mean the terms and conditions for use, reproduction,
10
+      and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+      "Licensor" shall mean the copyright owner or entity authorized by
13
+      the copyright owner that is granting the License.
14
+
15
+      "Legal Entity" shall mean the union of the acting entity and all
16
+      other entities that control, are controlled by, or are under common
17
+      control with that entity. For the purposes of this definition,
18
+      "control" means (i) the power, direct or indirect, to cause the
19
+      direction or management of such entity, whether by contract or
20
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+      outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+      "You" (or "Your") shall mean an individual or Legal Entity
24
+      exercising permissions granted by this License.
25
+
26
+      "Source" form shall mean the preferred form for making modifications,
27
+      including but not limited to software source code, documentation
28
+      source, and configuration files.
29
+
30
+      "Object" form shall mean any form resulting from mechanical
31
+      transformation or translation of a Source form, including but
32
+      not limited to compiled object code, generated documentation,
33
+      and conversions to other media types.
34
+
35
+      "Work" shall mean the work of authorship, whether in Source or
36
+      Object form, made available under the License, as indicated by a
37
+      copyright notice that is included in or attached to the work
38
+      (an example is provided in the Appendix below).
39
+
40
+      "Derivative Works" shall mean any work, whether in Source or Object
41
+      form, that is based on (or derived from) the Work and for which the
42
+      editorial revisions, annotations, elaborations, or other modifications
43
+      represent, as a whole, an original work of authorship. For the purposes
44
+      of this License, Derivative Works shall not include works that remain
45
+      separable from, or merely link (or bind by name) to the interfaces of,
46
+      the Work and Derivative Works thereof.
47
+
48
+      "Contribution" shall mean any work of authorship, including
49
+      the original version of the Work and any modifications or additions
50
+      to that Work or Derivative Works thereof, that is intentionally
51
+      submitted to Licensor for inclusion in the Work by the copyright owner
52
+      or by an individual or Legal Entity authorized to submit on behalf of
53
+      the copyright owner. For the purposes of this definition, "submitted"
54
+      means any form of electronic, verbal, or written communication sent
55
+      to the Licensor or its representatives, including but not limited to
56
+      communication on electronic mailing lists, source code control systems,
57
+      and issue tracking systems that are managed by, or on behalf of, the
58
+      Licensor for the purpose of discussing and improving the Work, but
59
+      excluding communication that is conspicuously marked or otherwise
60
+      designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+      "Contributor" shall mean Licensor and any individual or Legal Entity
63
+      on behalf of whom a Contribution has been received by Licensor and
64
+      subsequently incorporated within the Work.
65
+
66
+   2. Grant of Copyright License. Subject to the terms and conditions of
67
+      this License, each Contributor hereby grants to You a perpetual,
68
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+      copyright license to reproduce, prepare Derivative Works of,
70
+      publicly display, publicly perform, sublicense, and distribute the
71
+      Work and such Derivative Works in Source or Object form.
72
+
73
+   3. Grant of Patent License. Subject to the terms and conditions of
74
+      this License, each Contributor hereby grants to You a perpetual,
75
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+      (except as stated in this section) patent license to make, have made,
77
+      use, offer to sell, sell, import, and otherwise transfer the Work,
78
+      where such license applies only to those patent claims licensable
79
+      by such Contributor that are necessarily infringed by their
80
+      Contribution(s) alone or by combination of their Contribution(s)
81
+      with the Work to which such Contribution(s) was submitted. If You
82
+      institute patent litigation against any entity (including a
83
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+      or a Contribution incorporated within the Work constitutes direct
85
+      or contributory patent infringement, then any patent licenses
86
+      granted to You under this License for that Work shall terminate
87
+      as of the date such litigation is filed.
88
+
89
+   4. Redistribution. You may reproduce and distribute copies of the
90
+      Work or Derivative Works thereof in any medium, with or without
91
+      modifications, and in Source or Object form, provided that You
92
+      meet the following conditions:
93
+
94
+      (a) You must give any other recipients of the Work or
95
+          Derivative Works a copy of this License; and
96
+
97
+      (b) You must cause any modified files to carry prominent notices
98
+          stating that You changed the files; and
99
+
100
+      (c) You must retain, in the Source form of any Derivative Works
101
+          that You distribute, all copyright, patent, trademark, and
102
+          attribution notices from the Source form of the Work,
103
+          excluding those notices that do not pertain to any part of
104
+          the Derivative Works; and
105
+
106
+      (d) If the Work includes a "NOTICE" text file as part of its
107
+          distribution, then any Derivative Works that You distribute must
108
+          include a readable copy of the attribution notices contained
109
+          within such NOTICE file, excluding those notices that do not
110
+          pertain to any part of the Derivative Works, in at least one
111
+          of the following places: within a NOTICE text file distributed
112
+          as part of the Derivative Works; within the Source form or
113
+          documentation, if provided along with the Derivative Works; or,
114
+          within a display generated by the Derivative Works, if and
115
+          wherever such third-party notices normally appear. The contents
116
+          of the NOTICE file are for informational purposes only and
117
+          do not modify the License. You may add Your own attribution
118
+          notices within Derivative Works that You distribute, alongside
119
+          or as an addendum to the NOTICE text from the Work, provided
120
+          that such additional attribution notices cannot be construed
121
+          as modifying the License.
122
+
123
+      You may add Your own copyright statement to Your modifications and
124
+      may provide additional or different license terms and conditions
125
+      for use, reproduction, or distribution of Your modifications, or
126
+      for any such Derivative Works as a whole, provided Your use,
127
+      reproduction, and distribution of the Work otherwise complies with
128
+      the conditions stated in this License.
129
+
130
+   5. Submission of Contributions. Unless You explicitly state otherwise,
131
+      any Contribution intentionally submitted for inclusion in the Work
132
+      by You to the Licensor shall be under the terms and conditions of
133
+      this License, without any additional terms or conditions.
134
+      Notwithstanding the above, nothing herein shall supersede or modify
135
+      the terms of any separate license agreement you may have executed
136
+      with Licensor regarding such Contributions.
137
+
138
+   6. Trademarks. This License does not grant permission to use the trade
139
+      names, trademarks, service marks, or product names of the Licensor,
140
+      except as required for reasonable and customary use in describing the
141
+      origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+   7. Disclaimer of Warranty. Unless required by applicable law or
144
+      agreed to in writing, Licensor provides the Work (and each
145
+      Contributor provides its Contributions) on an "AS IS" BASIS,
146
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+      implied, including, without limitation, any warranties or conditions
148
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+      PARTICULAR PURPOSE. You are solely responsible for determining the
150
+      appropriateness of using or redistributing the Work and assume any
151
+      risks associated with Your exercise of permissions under this License.
152
+
153
+   8. Limitation of Liability. In no event and under no legal theory,
154
+      whether in tort (including negligence), contract, or otherwise,
155
+      unless required by applicable law (such as deliberate and grossly
156
+      negligent acts) or agreed to in writing, shall any Contributor be
157
+      liable to You for damages, including any direct, indirect, special,
158
+      incidental, or consequential damages of any character arising as a
159
+      result of this License or out of the use or inability to use the
160
+      Work (including but not limited to damages for loss of goodwill,
161
+      work stoppage, computer failure or malfunction, or any and all
162
+      other commercial damages or losses), even if such Contributor
163
+      has been advised of the possibility of such damages.
164
+
165
+   9. Accepting Warranty or Additional Liability. While redistributing
166
+      the Work or Derivative Works thereof, You may choose to offer,
167
+      and charge a fee for, acceptance of support, warranty, indemnity,
168
+      or other liability obligations and/or rights consistent with this
169
+      License. However, in accepting such obligations, You may act only
170
+      on Your own behalf and on Your sole responsibility, not on behalf
171
+      of any other Contributor, and only if You agree to indemnify,
172
+      defend, and hold each Contributor harmless for any liability
173
+      incurred by, or claims asserted against, such Contributor by reason
174
+      of your accepting any such warranty or additional liability.
175
+
176
+   END OF TERMS AND CONDITIONS
177
+
178
+   APPENDIX: How to apply the Apache License to your work.
179
+
180
+      To apply the Apache License to your work, attach the following
181
+      boilerplate notice, with the fields enclosed by brackets "{}"
182
+      replaced with your own identifying information. (Don't include
183
+      the brackets!)  The text should be enclosed in the appropriate
184
+      comment syntax for the file format. We also recommend that a
185
+      file or class name and description of purpose be included on the
186
+      same "printed page" as the copyright notice for easier
187
+      identification within third-party archives.
188
+
189
+   Copyright {yyyy} {name of copyright owner}
190
+
191
+   Licensed under the Apache License, Version 2.0 (the "License");
192
+   you may not use this file except in compliance with the License.
193
+   You may obtain a copy of the License at
194
+
195
+       http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+   Unless required by applicable law or agreed to in writing, software
198
+   distributed under the License is distributed on an "AS IS" BASIS,
199
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+   See the License for the specific language governing permissions and
201
+   limitations under the License.
202
+

+ 61
- 0
README.md View File

@@ -0,0 +1,61 @@
1
+PLUMgrid plugin for Mirantis Fuel
2
+=================================
3
+
4
+License
5
+-------
6
+Copyright 2016 PLUMgrid Inc.
7
+
8
+Licensed under the Apache License, Version 2.0 (the "License");
9
+you may not use this file except in compliance with the License.
10
+You may obtain a copy of the License at:
11
+
12
+http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+Unless required by applicable law or agreed to in writing, software
15
+distributed under the License is distributed on an "AS IS" BASIS,
16
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+See the License for the specific language governing permissions and
18
+limitations under the License.
19
+
20
+PLUMgrid Plugin
21
+---------------
22
+PLUMgrid is a core neutron networking plugin that has been a part of OpenStack
23
+neutron since Grizzly. It offers a Network Virtualization Platform that uses
24
+direct communication with the Hypervisor layer to provide all the networking
25
+functionality requested through Neutron APIs. It implements Neutron v2 APIs
26
+and helps configure L2/L3 virtual networks created through the PLUMgrid Platform.
27
+It also implements External Networks and Port Binding Extensions.
28
+
29
+Building the plugin
30
+-------------------
31
+1. Clone the PLUMgrid Fuel plugin repository:
32
+
33
+ ``# git clone https://github.com/openstack/fuel-plugin-plumgrid``
34
+
35
+2. Install Fuel Plugin Builder:
36
+
37
+ ``pip install fuel-plugin-builder``
38
+
39
+3. Navigate to the cloned PLUMgrid Fuel plugin folder and build the plugin:
40
+
41
+ ``cd plumgrid-fuel-plugin/``
42
+
43
+ ``fpb --build .``
44
+
45
+3. The plumgrid-<x.x.x>.rpm plugin file will be created.
46
+
47
+4. Copy this file to the Fuel Master node with secure copy (scp):
48
+
49
+ ``scp plumgrid-<x.x.x>.rpm root@:<the_Fuel_Master_node_IP address>:/tmp``
50
+
51
+5. On the Fuel Master node, Install the PLUMgrid plugin with:
52
+
53
+ ``cd /tmp``
54
+ ``fuel plugins --install plumgrid-<x.x.x>.rpm``
55
+
56
+6. The plugin is now ready for use and can be enabled on the Settings tab, PLUMgrid Plugin section
57
+   of the Fuel web UI.
58
+
59
+Note: Contact PLUMgrid for an Installation Pack info@plumgrid.com
60
+(includes full/trial license, packages and deployment documentation)
61
+

+ 35
- 0
deployment_scripts/cleanup_os.sh View File

@@ -0,0 +1,35 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+#!/bin/bash
17
+
18
+if [[ ! -f "/root/cleanup_os" ]];then
19
+  source /root/openrc
20
+  router_id=`neutron router-list | grep "network_id" | awk '{print $2}'`
21
+  neutron router-gateway-clear $router_id
22
+  subnet_id=`neutron router-port-list $router_id | grep "subnet_id" | awk '{print $8}' | awk -F '\"' '{print $2}'`
23
+  neutron router-interface-delete $router_id $subnet_id
24
+  neutron router-delete $router_id
25
+  neutron subnet-delete $subnet_id
26
+  neutron net-delete net04
27
+  neutron net-delete net04_ext
28
+  admin_id=`keystone tenant-list|grep admin|awk -F '|' '{ print $2 }'`
29
+  neutron security-group-delete --tenant-id $admin_id
30
+  neutron security-group-delete default
31
+  touch /root/cleanup_os
32
+
33
+else
34
+  echo "Cleanup already preformed before, skipping."
35
+fi

+ 30
- 0
deployment_scripts/pg_os_version.sh View File

@@ -0,0 +1,30 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+#!/bin/bash
17
+
18
+. /tmp/plumgrid_config
19
+
20
+curl -Lks http://$pg_repo:81/files/lvm-installer.sh  -o /tmp/lvm-installer.sh
21
+
22
+curl -Lks http://$pg_repo:81/files/pg_os_version.yaml  -o /tmp/pg_os_version.yaml
23
+
24
+pg_version=$(cat /tmp/lvm-installer.sh | grep pg_ver= | awk 'NR==1 {print}'| cut -c9-| sed 's/-.*//')
25
+
26
+os_version=$(cat /tmp/pg_os_version.yaml | grep $pg_version-k | cut -d ' ' -f2)
27
+
28
+if [ -n "$os_version" ]; then
29
+  grep -q -F "networking_pg_version: $os_version" /etc/astute.yaml || echo "networking_pg_version: $os_version" >> /etc/astute.yaml
30
+fi

+ 48
- 0
deployment_scripts/plumgrid_fabric.sh View File

@@ -0,0 +1,48 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+#!/bin/bash
17
+
18
+. /tmp/plumgrid_config
19
+
20
+fabric_ip=$(ip addr show br-mgmt | awk '$1=="inet" {print $2}' | awk -F '/' '{print $1}' | awk -F '.' '{print $4}' | head -1)
21
+fabric_dev=$(brctl show br-mgmt | awk -F ' ' '{print $4}' | awk 'FNR == 2 {print}' | awk -F '.' '{print $1}')
22
+
23
+# remove the default bridge, if it exists
24
+BRIDGE_AUX=$(brctl show | grep br-aux || true)
25
+
26
+if [[ ! -z "${BRIDGE_AUX}" ]];then
27
+
28
+  brctl delif br-aux $fabric_dev
29
+  ifconfig br-aux down
30
+  brctl delbr br-aux
31
+  rm -f /etc/network/interfaces.d/ifcfg-br-aux
32
+
33
+fi
34
+
35
+fabric_netmask=$(ifconfig br-mgmt | grep Mask | sed s/^.*Mask://)
36
+fabric_net=$(echo $fabric_network | cut -f2 -d: | cut -f1-3 -d.)
37
+
38
+ifconfig $fabric_dev $fabric_net.$fabric_ip netmask $fabric_netmask
39
+ifconfig $fabric_dev mtu 1580
40
+
41
+if [[ -f "/etc/network/interfaces.d/ifcfg-$fabric_dev" ]];then
42
+  rm /etc/network/interfaces.d/ifcfg-$fabric_dev
43
+fi
44
+
45
+echo -e "auto $fabric_dev\niface $fabric_dev inet static\naddress $fabric_net.$fabric_ip/24\nmtu 1580" >> /etc/network/interfaces.d/ifcfg-$fabric_dev
46
+
47
+grep -q -F "fabric_dev: $fabric_dev" /etc/astute.yaml || echo "fabric_dev: $fabric_dev" >> /etc/astute.yaml
48
+

+ 60
- 0
deployment_scripts/post_pg_license.sh View File

@@ -0,0 +1,60 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+#!/bin/bash
17
+
18
+. /tmp/plumgrid_config
19
+
20
+if [[ ! -f "/root/post_director" ]];then
21
+
22
+  #Wait for the platform to come up
23
+  sleep 5
24
+  retry_cnt=0
25
+  http_status=""
26
+
27
+  while [[ "$http_status" != "200" ]]; do
28
+    if [[ $retry_cnt -ge 30 ]]; then
29
+      echo "Failed to login to platform for 60 seconds, exiting..."
30
+      exit 1
31
+    fi
32
+
33
+    #Login to PLUMgrid
34
+    http_status=$(curl -H "Accept: application/json" -H "Content-Type: application/json" -k -X \
35
+    POST https://$vip/0/login -d '{"userName":"plumgrid","password":"plumgrid"}' \
36
+    -c /tmp/cookie -i | grep HTTP | awk '{print $2}')
37
+
38
+    echo $http_status
39
+
40
+    let "retry_cnt= $retry_cnt + 1"
41
+    sleep 2
42
+  done
43
+
44
+  #Install License
45
+  install_status=$(curl -H "Accept: application/json" -H "Content-Type: application/json" \
46
+  https://$vip/0/tenant_manager/license_key/key1 -k -X PUT -d '{"license": '\"$license\"'}' \
47
+  -i -b /tmp/cookie -k| grep HTTP | awk '{print $2}')
48
+
49
+  echo $install_status
50
+
51
+  if [[ $install_status -ne 200 ]]; then
52
+    echo "Error installing license, exiting..."
53
+    exit 1
54
+  fi
55
+
56
+  touch /root/post_director
57
+
58
+else
59
+  echo "This Director has already been configured, skipping."
60
+fi

+ 167
- 0
deployment_scripts/puppet/manifests/director.pp View File

@@ -0,0 +1,167 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/director.pp')
17
+
18
+# Fuel settings
19
+$fuel_hash              = hiera_hash('public_ssl', {})
20
+$fuel_hostname          = pick($fuel_hash['hostname'])
21
+
22
+# PLUMgrid settings
23
+$plumgrid_hash          = hiera_hash('plumgrid', {})
24
+$plumgrid_pkg_repo      = pick($plumgrid_hash['plumgrid_package_repo'])
25
+$plumgrid_lic           = pick($plumgrid_hash['plumgrid_license'])
26
+$plumgrid_vip           = pick($plumgrid_hash['plumgrid_virtual_ip'])
27
+$plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
28
+$plumgrid_username      = pick($plumgrid_hash['plumgrid_username'])
29
+$plumgrid_password      = pick($plumgrid_hash['plumgrid_password'])
30
+$networking_pg_version  = hiera('networking_pg_version', '2015.1.1.1')
31
+
32
+# PLUMgrid Zone settings
33
+$network_metadata       = hiera_hash('network_metadata')
34
+$haproxy_vip            = pick($network_metadata['vips']['public']['ipaddr'])
35
+$controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
36
+$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
37
+$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
38
+$mgmt_net               = hiera('management_network_range')
39
+$fabric_dev             = hiera('fabric_dev')
40
+
41
+# Neutron settings
42
+$neutron_config         = hiera_hash('quantum_settings', {})
43
+$metadata_secret        = pick($neutron_config['metadata']['metadata_proxy_shared_secret'], 'root')
44
+$service_endpoint       = hiera('service_endpoint')
45
+
46
+# Neutron DB settings
47
+$neutron_db_password    = $neutron_config['database']['passwd']
48
+$neutron_db_user        = pick($neutron_config['database']['user'], 'neutron')
49
+$neutron_db_name        = pick($neutron_config['database']['name'], 'neutron')
50
+$neutron_db_host        = pick($neutron_config['database']['host'], hiera('database_vip'))
51
+
52
+$neutron_db_uri = "mysql://${neutron_db_user}:${neutron_db_password}@${neutron_db_host}/${neutron_db_name}?&read_timeout=60"
53
+
54
+# OpenStack Access settings
55
+$access_hash              = hiera_hash('access', {})
56
+$admin_password           = pick($access_hash['password'])
57
+
58
+# Add fuel node fqdn to /etc/hosts
59
+host { 'fuel':
60
+    ip => $haproxy_vip,
61
+    host_aliases => $fuel_hostname,
62
+}
63
+
64
+class { 'plumgrid':
65
+  plumgrid_ip  => $controller_ipaddresses,
66
+  mgmt_dev     => 'br-mgmt',
67
+  fabric_dev   => $fabric_dev,
68
+  lvm_keypath   => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub",
69
+}
70
+
71
+class { 'sal':
72
+  plumgrid_ip => $controller_ipaddresses,
73
+  virtual_ip  => $plumgrid_vip,
74
+}
75
+
76
+class { plumgrid::firewall:
77
+  source_net => $mgmt_net,
78
+  dest_net   => $mgmt_net,
79
+}
80
+
81
+# Setup Neutron PLUMgrid Configurations
82
+
83
+package { 'neutron-server':
84
+  ensure => 'present',
85
+  name   => 'neutron-server',
86
+}
87
+
88
+service { 'neutron-server':
89
+  ensure     => 'running',
90
+  name       => 'neutron-server',
91
+  enable     => true,
92
+}
93
+
94
+file { '/etc/neutron/neutron.conf':
95
+  ensure => present,
96
+  notify => Service['neutron-server'],
97
+}
98
+
99
+file_line { 'Enable PLUMgrid core plugin':
100
+  path => '/etc/neutron/neutron.conf',
101
+  line => 'core_plugin=neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2',
102
+  match => '^core_plugin.*$',
103
+  require => File['/etc/neutron/neutron.conf'],
104
+}
105
+
106
+file_line { 'Disable service plugins':
107
+  path => '/etc/neutron/neutron.conf',
108
+  line => 'service_plugins = ""',
109
+  match => '^service_plugins.*$',
110
+  require => File['/etc/neutron/neutron.conf'],
111
+}
112
+
113
+file { '/etc/nova/nova.conf':
114
+  ensure => present,
115
+  notify => Service['neutron-server'],
116
+}
117
+
118
+file_line { 'Set libvirt vif':
119
+  path => '/etc/nova/nova.conf',
120
+  line => 'libvirt_vif_type=ethernet',
121
+  match => '^libvirt_vif_type.*$',
122
+  require => File['/etc/nova/nova.conf']
123
+}
124
+
125
+file_line { 'Set libvirt cpu mode':
126
+  path => '/etc/nova/nova.conf',
127
+  line => 'libvirt_cpu_mode=none',
128
+  match => '^libvirt_cpu_mode.*$',
129
+  require => File['/etc/nova/nova.conf']
130
+}
131
+
132
+# Setting PLUMgrid Config Files
133
+
134
+class { '::neutron::plugins::plumgrid':
135
+  director_server              => $plumgrid_vip,
136
+  username                     => $plumgrid_username,
137
+  password                     => $plumgrid_password,
138
+  admin_password               => $admin_password,
139
+  controller_priv_host         => $service_endpoint,
140
+  connection                   => $neutron_db_uri,
141
+  nova_metadata_ip             => '169.254.169.254',
142
+  nova_metadata_port           => '8775',
143
+  metadata_proxy_shared_secret => $metadata_secret,
144
+}->
145
+package { 'networking-plumgrid':
146
+  ensure   => $networking_pg_version,
147
+  provider => 'pip',
148
+  notify   => Service["$::neutron::params::server_service"],
149
+}
150
+
151
+if ($networking_pg_version != '2015.1.1.1'){
152
+  exec { "plumgrid-db-manage upgrade heads":
153
+    command => "/usr/local/bin/plumgrid-db-manage upgrade heads",
154
+    notify  => Service["$::neutron::params::server_service"],
155
+    require => Package['networking-plumgrid']
156
+  }
157
+}
158
+
159
+# Update PLUMgrid plugin file
160
+
161
+file { 'plumgrid_plugin.py':
162
+  path => '/usr/lib/python2.7/dist-packages/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py',
163
+  ensure => present,
164
+  mode   => '0644',
165
+  source => 'puppet:///modules/plumgrid/plumgrid_plugin.py',
166
+  notify   => Service["$::neutron::params::server_service"]
167
+}

+ 34
- 0
deployment_scripts/puppet/manifests/director_fixes.pp View File

@@ -0,0 +1,34 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/director_fixes.pp')
17
+
18
+file { '/etc/apache2/ports.conf':
19
+  ensure => present,
20
+}
21
+
22
+file_line { 'ensure no port conflict between apache and keystone':
23
+  path    => '/etc/apache2/ports.conf',
24
+  line   => 'NameVirtualHost *:35357',
25
+  ensure  => 'absent',
26
+  require => File['/etc/apache2/ports.conf']
27
+}
28
+
29
+file_line { 'ensure no port conflict between apache-keystone':
30
+  path    => '/etc/apache2/ports.conf',
31
+  line   => 'NameVirtualHost *:5000',
32
+  ensure  => 'absent',
33
+  require => File['/etc/apache2/ports.conf']
34
+}

+ 159
- 0
deployment_scripts/puppet/manifests/edge.pp View File

@@ -0,0 +1,159 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/edge.pp')
17
+
18
+# Metadata settings
19
+$metadata_hash     = hiera_hash('quantum_settings', {})
20
+$metadata_secret   = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
21
+
22
+# PLUMgrid settings
23
+$plumgrid_hash     = hiera_hash('plumgrid', {})
24
+$plumgrid_pkg_repo = pick($plumgrid_hash['plumgrid_package_repo'])
25
+$plumgrid_vip      = pick($plumgrid_hash['plumgrid_virtual_ip'])
26
+
27
+# PLUMgrid Zone settings
28
+$network_metadata       = hiera_hash('network_metadata')
29
+$controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
30
+$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
31
+$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
32
+$mgmt_net               = hiera('management_network_range')
33
+$fabric_dev             = hiera('fabric_dev')
34
+$plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
35
+
36
+class { 'plumgrid':
37
+  plumgrid_ip => $controller_ipaddresses,
38
+  mgmt_dev => 'br-mgmt',
39
+  fabric_dev => $fabric_dev,
40
+  lvm_keypath => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub",
41
+}
42
+
43
+class { plumgrid::firewall:
44
+  source_net=> $mgmt_net,
45
+  dest_net=> $mgmt_net,
46
+}
47
+
48
+package { 'nova-api':
49
+  ensure => present,
50
+  name   => 'nova-api',
51
+}
52
+
53
+package { 'nova-compute':
54
+  ensure => present,
55
+  name   => 'nova-compute',
56
+}
57
+
58
+file { '/etc/nova/nova.conf':
59
+  ensure  => present,
60
+  notify  => [ Service['nova-compute'], Service['nova-api'] ]
61
+}
62
+
63
+file_line { 'Set libvirt vif':
64
+  path => '/etc/nova/nova.conf',
65
+  line => 'libvirt_vif_type=ethernet',
66
+  match => '^libvirt_vif_type.*$',
67
+  require => File['/etc/nova/nova.conf']
68
+}
69
+
70
+file_line { 'Set libvirt cpu mode':
71
+  path => '/etc/nova/nova.conf',
72
+  line => 'libvirt_cpu_mode=none',
73
+  match => '^libvirt_cpu_mode.*$',
74
+  require => File['/etc/nova/nova.conf']
75
+}
76
+
77
+# Enabling Metadata on Computes
78
+file_line { 'Enable Metadata Proxy':
79
+  path => '/etc/nova/nova.conf',
80
+  line => 'service_metadata_proxy=True',
81
+  match => '^#service_metadata_proxy=false',
82
+  require => File['/etc/nova/nova.conf']
83
+}
84
+
85
+file_line { 'Set Metadata Shared Secret':
86
+  path => '/etc/nova/nova.conf',
87
+  line => "metadata_proxy_shared_secret=$metadata_secret",
88
+  match => '^#metadata_proxy_shared_secret=',
89
+  require => File['/etc/nova/nova.conf']
90
+}
91
+
92
+service { 'libvirt-bin':
93
+  ensure => running,
94
+  name   => 'libvirt-bin',
95
+  enable => true,
96
+}
97
+
98
+service { 'nova-api':
99
+  ensure  => running,
100
+  name    => 'nova-api',
101
+  require => Package['nova-api'],
102
+  enable => true,
103
+}
104
+
105
+service { 'nova-compute':
106
+  ensure => running,
107
+  name   => 'nova-compute',
108
+  require => Package['nova-compute'],
109
+  enable => true,
110
+}
111
+
112
+file { '/etc/libvirt/qemu.conf':
113
+  ensure => present,
114
+  notify => Service['libvirt-bin'],
115
+}
116
+
117
+file_line { 'Libvirt QEMU settings':
118
+  path => '/etc/libvirt/qemu.conf',
119
+  line => 'cgroup_device_acl = ["/dev/null", "/dev/full", "/dev/zero", "/dev/random", "/dev/urandom", "/dev/ptmx", "/dev/kvm", "/dev/kqemu", "/dev/rtc", "/dev/hpet", "/dev/net/tun"]',
120
+  require => File['/etc/libvirt/qemu.conf'],
121
+}
122
+
123
+# Enable packet forwarding for IPv4
124
+exec { 'sysctl -w net.ipv4.ip_forward=1':
125
+  command => '/sbin/sysctl -w net.ipv4.ip_forward=1'
126
+}
127
+
128
+file { '/etc/sysctl.conf':
129
+  ensure => present
130
+}
131
+
132
+file_line { 'Enable IP4 packet forwarding':
133
+  path    => '/etc/sysctl.conf',
134
+  line    => 'net.ipv4.ip_forward=1',
135
+  match   => '^#net.ipv4.ip_forward=1',
136
+  require => File['/etc/sysctl.conf']
137
+}
138
+
139
+Package['nova-api'] -> File['/etc/nova/rootwrap.d/network.filters'] ~> Service['nova-compute']
140
+
141
+file { '/etc/nova/rootwrap.d/network.filters':
142
+  ensure => present,
143
+  mode   => '0644',
144
+  source => 'puppet:///modules/plumgrid/network.filters'
145
+}
146
+
147
+file_line { 'unmount plumgrid.fuse post-stop':
148
+  path    => '/etc/init/plumgrid.conf',
149
+  line    => '  umount --fake /run/libvirt/lxc/plumgrid.fuse',
150
+  after   => 'virsh -c lxc: destroy plumgrid',
151
+  require => Package[$plumgrid::params::plumgrid_package]
152
+}
153
+
154
+file_line { 'unmount plumgrid.fuse pre-start':
155
+  path    => '/etc/init/plumgrid.conf',
156
+  line    => '  umount --fake /run/libvirt/lxc/plumgrid.fuse',
157
+  after   => '/opt/pg/scripts/systemd_pre_start.sh',
158
+  require => Package[$plumgrid::params::plumgrid_package]
159
+}

+ 63
- 0
deployment_scripts/puppet/manifests/gateway.pp View File

@@ -0,0 +1,63 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/gateway.pp')
17
+
18
+# PLUMgrid settings
19
+$plumgrid_hash          = hiera_hash('plumgrid', {})
20
+$plumgrid_gw_devs       = pick($plumgrid_hash['gateway_devs'])
21
+
22
+# PLUMgrid Zone settings
23
+$network_metadata       = hiera_hash('network_metadata')
24
+$controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
25
+$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
26
+$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
27
+$mgmt_net               = hiera('management_network_range')
28
+$fabric_dev             = hiera('fabric_dev')
29
+$plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
30
+
31
+class { 'plumgrid':
32
+  plumgrid_ip  => $controller_ipaddresses,
33
+  mgmt_dev     => 'br-mgmt',
34
+  fabric_dev   => $fabric_dev,
35
+  gateway_devs => split($plumgrid_gw_devs, ','),
36
+  lvm_keypath  => "/var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub",
37
+}
38
+
39
+class { plumgrid::firewall:
40
+  source_net => $mgmt_net,
41
+  dest_net   => $mgmt_net,
42
+}
43
+
44
+package { 'iptables-persistent':
45
+  ensure => present,
46
+  name   => 'iptables-persistent'
47
+}
48
+
49
+# Enable packet forwarding for IPv4
50
+exec { 'sysctl -w net.ipv4.ip_forward=1':
51
+  command => '/sbin/sysctl -w net.ipv4.ip_forward=1'
52
+}
53
+
54
+file { '/etc/sysctl.conf':
55
+  ensure => present
56
+}
57
+
58
+file_line { 'Enable IP4 packet forwarding':
59
+  path    => '/etc/sysctl.conf',
60
+  line    => 'net.ipv4.ip_forward=1',
61
+  match   => '^#net.ipv4.ip_forward=1',
62
+  require => File['/etc/sysctl.conf']
63
+}

+ 85
- 0
deployment_scripts/puppet/manifests/pg_common.pp View File

@@ -0,0 +1,85 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/pre_node.pp')
17
+
18
+$fuel_hash = hiera_hash('public_ssl', {})
19
+$fuel_hostname = pick($fuel_hash['hostname'])
20
+
21
+$metadata_hash = hiera_hash('quantum_settings', {})
22
+$metadata = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
23
+
24
+$plumgrid_hash = hiera_hash('plumgrid', {})
25
+$plumgrid_pkg_repo = pick($plumgrid_hash['plumgrid_package_repo'])
26
+$plumgrid_lic = pick($plumgrid_hash['plumgrid_license'])
27
+$plumgrid_vip = pick($plumgrid_hash['plumgrid_virtual_ip'])
28
+$plumgrid_zone = pick($plumgrid_hash['plumgrid_zone'])
29
+$fabric_network = pick($plumgrid_hash['plumgrid_fabric_network'])
30
+
31
+$network_metadata = hiera_hash('network_metadata')
32
+$haproxy_vip = pick($network_metadata['vips']['public']['ipaddr'])
33
+$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
34
+$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
35
+$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ',')
36
+
37
+$pg_packages = [ 'python-pip', 'apparmor-utils' ]
38
+
39
+package { $pg_packages:
40
+  ensure  => present,
41
+  require => Exec['apt-get update']
42
+}
43
+
44
+exec { 'aa-disable':
45
+  command   => 'aa-disable /sbin/dhclient',
46
+  path      => ['/usr/sbin', '/bin/'],
47
+  onlyif    => 'aa-status | grep /sbin/dhclient',
48
+  subscribe => Package['apparmor-utils']
49
+}
50
+
51
+exec { "apt-get update":
52
+  command => "/usr/bin/apt-get update"
53
+}
54
+
55
+file { '/tmp/plumgrid_config':
56
+  ensure  => file,
57
+  content => "fuel_hostname=$fuel_hostname\nhaproxy_vip=$haproxy_vip\ndirector_ip=$controller_ipaddresses\nedge_ip=$compute_ipaddresses\nmetadata_secret=$metadata\nlicense=$plumgrid_lic\nvip=$plumgrid_vip\npg_repo=$plumgrid_pkg_repo\nzone_name=$plumgrid_zone\nfabric_network=$fabric_network",
58
+}
59
+
60
+exec { 'ovs_rmmod':
61
+  command => 'rmmod openvswitch',
62
+  path    => '/sbin',
63
+  onlyif  => 'lsmod | /bin/grep openvswitch'
64
+}
65
+
66
+package { 'openvswitch-*':
67
+  ensure => absent
68
+}
69
+
70
+file { ['/var/lib/plumgrid', '/var/lib/plumgrid/zones', "/var/lib/plumgrid/zones/$plumgrid_zone"]:
71
+  ensure  =>  directory,
72
+  mode    =>  0755,
73
+}->
74
+exec { "lcm_key":
75
+  command => "/usr/bin/curl -Lks http://$plumgrid_pkg_repo:81/files/ssh_keys/zones/$plumgrid_zone/id_rsa.pub -o /var/lib/plumgrid/zones/$plumgrid_zone/id_rsa.pub",
76
+}
77
+
78
+exec { "get_GPG":
79
+  command => "/usr/bin/curl -Lks http://$plumgrid_pkg_repo:81/plumgrid/GPG-KEY -o /tmp/GPG-KEY",
80
+}->
81
+exec { "apt-key":
82
+  path        => '/bin:/usr/bin',
83
+  environment => 'HOME=/root',
84
+  command     => 'apt-key add /tmp/GPG-KEY',
85
+}

+ 23
- 0
deployment_scripts/puppet/manifests/pre_deployment.pp View File

@@ -0,0 +1,23 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/pre_deployment.pp')
17
+
18
+package { 'libvirt0' :
19
+  ensure => '1.2.2-0ubuntu13.1.16',
20
+} ->
21
+package { 'libvirt-bin' :
22
+  ensure => '1.2.2-0ubuntu13.1.16',
23
+}

+ 51
- 0
deployment_scripts/puppet/manifests/tools.pp View File

@@ -0,0 +1,51 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+notice('MODULAR: plumgrid/tools.pp')
17
+
18
+# PLUMgrid settings
19
+$metadata_hash          = hiera_hash('quantum_settings', {})
20
+$metadata               = pick($metadata_hash['metadata']['metadata_proxy_shared_secret'], 'root')
21
+$plumgrid_hash          = hiera_hash('plumgrid', {})
22
+$plumgrid_pkg_repo      = pick($plumgrid_hash['plumgrid_package_repo'])
23
+$plumgrid_vip           = pick($plumgrid_hash['plumgrid_virtual_ip'])
24
+$plumgrid_gw_devs       = pick($plumgrid_hash['gateway_devs'])
25
+$plumgrid_zone          = pick($plumgrid_hash['plumgrid_zone'])
26
+$fabric_network         = pick($plumgrid_hash['plumgrid_fabric_network'])
27
+
28
+# PLUMgrid Zone settings
29
+$network_metadata       = hiera_hash('network_metadata')
30
+$controller_nodes       = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
31
+$controller_address_map = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/vip')
32
+$controller_ipaddresses = join(hiera_array('controller_ipaddresses', values($controller_address_map)), ' ')
33
+
34
+$compute_nodes          = get_nodes_hash_by_roles($network_metadata, ['compute'])
35
+$compute_address_map    = get_node_to_ipaddr_map_by_network_role($compute_nodes, 'mgmt/vip')
36
+$compute_ipaddresses    = join(hiera_array('compute_ipaddresses', values($compute_address_map)), ' ')
37
+
38
+$gateway_nodes          = get_nodes_hash_by_roles($network_metadata, ['PLUMgrid-Gateway'])
39
+$gateway_address_map    = get_node_to_ipaddr_map_by_network_role($gateway_nodes, 'mgmt/vip')
40
+$gateway_ipaddresses    = join(hiera_array('gateway_ipaddresses', values($gateway_address_map)), ' ')
41
+
42
+file { '/etc/plumgrid':
43
+  ensure  =>  directory,
44
+  mode    =>  0755,
45
+}
46
+
47
+file { '/etc/plumgrid/plumgrid.conf':
48
+  ensure  => file,
49
+  mode    =>  0755,
50
+  content => "zone_name=\"$plumgrid_zone\"\npg_director_ips=\"$controller_ipaddresses\"\npg_virt_ip=\"$plumgrid_vip\"\nplumgrid_repo_url=\"$plumgrid_pkg_repo\"\ncontrollers=\"$controller_ipaddresses\"\ncomputes=\"$compute_ipaddresses\"\nfabric_net=\"$fabric_network\"\nadd_gateway=\"yes\"\ngateway_devs=\"$plumgrid_gw_devs\"\ngateway_ips=\"$gateway_ipaddresses\""
51
+}

+ 92
- 0
deployment_scripts/puppet/modules/plumgrid/files/network.filters View File

@@ -0,0 +1,92 @@
1
+# nova-rootwrap command filters for network nodes
2
+# This file should be owned by (and only-writeable by) the root user
3
+
4
+[Filters]
5
+# nova/virt/libvirt/vif.py: 'ip', 'tuntap', 'add', dev, 'mode', 'tap'
6
+# nova/virt/libvirt/vif.py: 'ip', 'link', 'set', dev, 'up'
7
+# nova/virt/libvirt/vif.py: 'ip', 'link', 'delete', dev
8
+# nova/network/linux_net.py: 'ip', 'addr', 'add', str(floating_ip)+'/32'i..
9
+# nova/network/linux_net.py: 'ip', 'addr', 'del', str(floating_ip)+'/32'..
10
+# nova/network/linux_net.py: 'ip', 'addr', 'add', '169.254.169.254/32',..
11
+# nova/network/linux_net.py: 'ip', 'addr', 'show', 'dev', dev, 'scope',..
12
+# nova/network/linux_net.py: 'ip', 'addr', 'del/add', ip_params, dev)
13
+# nova/network/linux_net.py: 'ip', 'addr', 'del', params, fields[-1]
14
+# nova/network/linux_net.py: 'ip', 'addr', 'add', params, bridge
15
+# nova/network/linux_net.py: 'ip', '-f', 'inet6', 'addr', 'change', ..
16
+# nova/network/linux_net.py: 'ip', 'link', 'set', 'dev', dev, 'promisc',..
17
+# nova/network/linux_net.py: 'ip', 'link', 'add', 'link', bridge_if ...
18
+# nova/network/linux_net.py: 'ip', 'link', 'set', interface, address,..
19
+# nova/network/linux_net.py: 'ip', 'link', 'set', interface, 'up'
20
+# nova/network/linux_net.py: 'ip', 'link', 'set', bridge, 'up'
21
+# nova/network/linux_net.py: 'ip', 'addr', 'show', 'dev', interface, ..
22
+# nova/network/linux_net.py: 'ip', 'link', 'set', dev, address, ..
23
+# nova/network/linux_net.py: 'ip', 'link', 'set', dev, 'up'
24
+# nova/network/linux_net.py: 'ip', 'route', 'add', ..
25
+# nova/network/linux_net.py: 'ip', 'route', 'del', .
26
+# nova/network/linux_net.py: 'ip', 'route', 'show', 'dev', dev
27
+ip: CommandFilter, ip, root
28
+
29
+# nova/virt/libvirt/vif.py: 'ovs-vsctl', ...
30
+# nova/virt/libvirt/vif.py: 'ovs-vsctl', 'del-port', ...
31
+# nova/network/linux_net.py: 'ovs-vsctl', ....
32
+ovs-vsctl: CommandFilter, ovs-vsctl, root
33
+
34
+# nova/network/linux_net.py: 'ovs-ofctl', ....
35
+ovs-ofctl: CommandFilter, ovs-ofctl, root
36
+
37
+# nova/virt/libvirt/vif.py: 'ivs-ctl', ...
38
+# nova/virt/libvirt/vif.py: 'ivs-ctl', 'del-port', ...
39
+# nova/network/linux_net.py: 'ivs-ctl', ....
40
+ivs-ctl: CommandFilter, ivs-ctl, root
41
+
42
+# nova/virt/libvirt/vif.py: 'ifc_ctl', ...
43
+ifc_ctl: CommandFilter, /opt/pg/bin/ifc_ctl, root
44
+ifc_ctl_pp: CommandFilter, /opt/pg/bin/ifc_ctl_pp, root
45
+
46
+# nova/virt/libvirt/vif.py: 'mm-ctl', ...
47
+mm-ctl: CommandFilter, mm-ctl, root
48
+
49
+# nova/network/linux_net.py: 'ebtables', '-D' ...
50
+# nova/network/linux_net.py: 'ebtables', '-I' ...
51
+ebtables: CommandFilter, ebtables, root
52
+ebtables_usr: CommandFilter, ebtables, root
53
+
54
+# nova/network/linux_net.py: 'ip[6]tables-save' % (cmd, '-t', ...
55
+iptables-save: CommandFilter, iptables-save, root
56
+ip6tables-save: CommandFilter, ip6tables-save, root
57
+
58
+# nova/network/linux_net.py: 'ip[6]tables-restore' % (cmd,)
59
+iptables-restore: CommandFilter, iptables-restore, root
60
+ip6tables-restore: CommandFilter, ip6tables-restore, root
61
+
62
+# nova/network/linux_net.py: 'arping', '-U', floating_ip, '-A', '-I', ...
63
+# nova/network/linux_net.py: 'arping', '-U', network_ref['dhcp_server'],..
64
+arping: CommandFilter, arping, root
65
+
66
+# nova/network/linux_net.py: 'dhcp_release', dev, address, mac_address
67
+dhcp_release: CommandFilter, dhcp_release, root
68
+
69
+# nova/network/linux_net.py: 'kill', '-9', pid
70
+# nova/network/linux_net.py: 'kill', '-HUP', pid
71
+kill_dnsmasq: KillFilter, root, /usr/sbin/dnsmasq, -9, -HUP
72
+
73
+# nova/network/linux_net.py: 'kill', pid
74
+kill_radvd: KillFilter, root, /usr/sbin/radvd
75
+
76
+# nova/network/linux_net.py: dnsmasq call
77
+dnsmasq: EnvFilter, env, root, CONFIG_FILE=, NETWORK_ID=, dnsmasq
78
+
79
+# nova/network/linux_net.py: 'radvd', '-C', '%s' % _ra_file(dev, 'conf'..
80
+radvd: CommandFilter, radvd, root
81
+
82
+# nova/network/linux_net.py: 'brctl', 'addbr', bridge
83
+# nova/network/linux_net.py: 'brctl', 'setfd', bridge, 0
84
+# nova/network/linux_net.py: 'brctl', 'stp', bridge, 'off'
85
+# nova/network/linux_net.py: 'brctl', 'addif', bridge, interface
86
+brctl: CommandFilter, brctl, root
87
+
88
+# nova/network/linux_net.py: 'sysctl', ....
89
+sysctl: CommandFilter, sysctl, root
90
+
91
+# nova/network/linux_net.py: 'conntrack'
92
+conntrack: CommandFilter, conntrack, root

+ 26
- 0
deployment_scripts/puppet/modules/plumgrid/files/plumgrid_plugin.py View File

@@ -0,0 +1,26 @@
1
+# Copyright 2016 PLUMgrid, Inc. All Rights Reserved.
2
+#
3
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+#    not use this file except in compliance with the License. You may obtain
5
+#    a copy of the License at
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    Unless required by applicable law or agreed to in writing, software
10
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+#    License for the specific language governing permissions and limitations
13
+#    under the License.
14
+
15
+from networking_plumgrid.neutron.plugins import plugin
16
+
17
+
18
+class NeutronPluginPLUMgridV2(plugin.NeutronPluginPLUMgridV2):
19
+
20
+    vndr_exts = plugin.NeutronPluginPLUMgridV2.supported_extension_aliases
21
+    supported_extension_aliases = ["binding", "external-net", "extraroute",
22
+                                   "provider", "quotas", "router",
23
+                                   "security-group"] + vndr_exts
24
+
25
+    def __init__(self):
26
+        super(NeutronPluginPLUMgridV2, self).__init__()

+ 51
- 0
deployment_scripts/puppet/modules/plumgrid/manifests/firewall.pp View File

@@ -0,0 +1,51 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class plumgrid::firewall (
17
+  $source_net = undef,
18
+  $dest_net = undef,
19
+) {
20
+
21
+  if $source_net != undef {
22
+    firewall { '001 plumgrid udp':
23
+      proto       => 'udp',
24
+      action      => 'accept',
25
+      state       => ['NEW'],
26
+      destination => $dest_net,
27
+      source      => $source_net,
28
+      before      => Class['plumgrid'],
29
+    }
30
+    firewall { '001 plumgrid rpc':
31
+      proto       => 'tcp',
32
+      action      => 'accept',
33
+      state       => ['NEW'],
34
+      destination => $dest_net,
35
+      source      => $source_net,
36
+      before      => Class['plumgrid'],
37
+    }
38
+    firewall { '040 allow vrrp':
39
+      proto       => 'vrrp',
40
+      action      => 'accept',
41
+      before      => Class['plumgrid'],
42
+    }
43
+    firewall { '040 keepalived':
44
+      proto       => 'all',
45
+      action      => 'accept',
46
+      destination => '224.0.0.18/32',
47
+      source      => $source_net,
48
+      before      => Class['plumgrid'],
49
+    }
50
+  }
51
+}

+ 105
- 0
deployment_scripts/puppet/modules/plumgrid/manifests/init.pp View File

@@ -0,0 +1,105 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class plumgrid (
17
+  $plumgrid_ip = '',
18
+  $plumgrid_port = 8001,
19
+  $rest_ip = '0.0.0.0',
20
+  $rest_port = '9180',
21
+  $mgmt_dev = 'br-mgmt',
22
+  $fabric_dev = 'bond0',
23
+  $fabric_mode = 'host',
24
+  $gateway_devs = [],
25
+  $demux_devs = [],
26
+  $license = '',
27
+  $lvm_keypath = '',
28
+  $mcollective = false,
29
+  $manage_repo = $plumgrid::params::manage_repo,
30
+  $repo_baseurl = '',
31
+  $repo_component = '',
32
+  $physical_location = '',
33
+) inherits plumgrid::params {
34
+  Exec { path => [ '/bin', '/sbin' , '/usr/bin', '/usr/sbin', '/usr/local/bin', ] }
35
+
36
+  $pg_package = $plumgrid::params::plumgrid_package
37
+  $lxc_root_path = '/var/lib/libvirt/filesystems/plumgrid'
38
+  $lxc_data_path = '/var/lib/libvirt/filesystems/plumgrid-data'
39
+
40
+  $ips = split($plumgrid_ip, ',')
41
+  $firstip = $ips[0]
42
+  $ips_awk = join($ips, '|')
43
+
44
+  package { "iovisor-dkms":
45
+    ensure => "latest",
46
+  }->
47
+  package { $pg_package:
48
+    ensure => "latest",
49
+  }
50
+  if $lvm_keypath != ''  {
51
+    ssh_authorized_key { "root@lvm":
52
+      key => regsubst(chomp(file($lvm_keypath)), '^\S* (\S*) \S*$', '\1'),
53
+      type => 'ssh-rsa',
54
+      user => 'root',
55
+      target => "${lxc_data_path}/root/.ssh/authorized_keys",
56
+      require => Package[$pg_package],
57
+      before => Service['plumgrid'],
58
+    }
59
+  }
60
+  file { "${lxc_data_path}/conf/etc/hostname":
61
+    content => $hostname,
62
+    require => Package[$pg_package],
63
+    before => Service['plumgrid'],
64
+  }
65
+  file { "${lxc_data_path}/conf/etc/hosts":
66
+    content => template('plumgrid/hosts.erb'),
67
+    require => Package[$pg_package],
68
+    before => Service['plumgrid'],
69
+  }
70
+  exec { 'pick-fabric_dev-by-route':
71
+    creates => "${lxc_data_path}/conf/pg/.auto_dev-fabric",
72
+    command => "ip route get ${firstip} | awk 'NR==1 && \$2==\"dev\" {print \$3; exit 0} NR==1 && \$2==\"via\" {print \$5; exit 0} NR>1 { exit 1 }' > ${lxc_data_path}/conf/pg/.auto_dev-fabric || ip addr show | awk '/(${ips_awk})\\// {print \$NF}' > ${lxc_data_path}/conf/pg/.auto_dev-fabric",
73
+    require => Package[$pg_package],
74
+  }->
75
+  exec { 'check-fabric_dev-by-route':
76
+    command => 'echo "Please provide \"mgmt_dev\" and \"fabric_dev\" parameters for \"plumgrid\" class using foreman UI" && exit 1',
77
+    unless => "test -s ${lxc_data_path}/conf/pg/.auto_dev-fabric",
78
+  }
79
+  file { "${lxc_data_path}/conf/pg/.plumgrid.conf":
80
+    ensure => file,
81
+    content => template('plumgrid/plumgrid.conf.erb'),
82
+    require => Package[$pg_package],
83
+  }~>
84
+  exec { 'generate-plumgrid.conf':
85
+    refreshonly => true,
86
+    command => "sed \"s/%AUTO_DEV%/`head -n1 ${lxc_data_path}/conf/pg/.auto_dev-fabric`/g\" ${lxc_data_path}/conf/pg/.plumgrid.conf > ${lxc_data_path}/conf/pg/plumgrid.conf",
87
+    subscribe => Exec['pick-fabric_dev-by-route'],
88
+    notify => Service['plumgrid'],
89
+  }
90
+  file { "${lxc_data_path}/conf/pg/.ifcs.conf":
91
+    content => template("${module_name}/ifcs.conf.erb"),
92
+    require => Package[$pg_package],
93
+  }~>
94
+  exec { 'generate-ifcs.conf':
95
+    refreshonly => true,
96
+    command => "sed \"s/%AUTO_DEV%/`head -n1 ${lxc_data_path}/conf/pg/.auto_dev-fabric`/g\" ${lxc_data_path}/conf/pg/.ifcs.conf > ${lxc_data_path}/conf/pg/ifcs.conf",
97
+    subscribe => Exec['pick-fabric_dev-by-route'],
98
+    notify => Service['plumgrid'],
99
+  }
100
+
101
+  service { 'plumgrid':
102
+    ensure => running,
103
+    enable => true,
104
+  }
105
+}

+ 34
- 0
deployment_scripts/puppet/modules/plumgrid/manifests/params.pp View File

@@ -0,0 +1,34 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class plumgrid::params {
17
+  $plumgrid_package = 'plumgrid-lxc'
18
+  case $::osfamily {
19
+    'RedHat', 'Linux': {
20
+      $manage_repo = false
21
+      $libvirt_package = 'libvirt-daemon-driver-lxc'
22
+      $libvirt_service = 'libvirtd'
23
+      $kernel_header_package = 'kernel-devel'
24
+    }
25
+    'Debian': {
26
+      $manage_repo = true
27
+      $libvirt_package = 'libvirt-bin'
28
+      $libvirt_service = 'libvirt-bin'
29
+      $kernel_header_package = "linux-headers-${kernelrelease}"
30
+    }
31
+  }
32
+  $fabric_dev = '%AUTO_DEV%'
33
+  $mgmt_dev = '%AUTO_DEV%'
34
+}

+ 62
- 0
deployment_scripts/puppet/modules/plumgrid/manifests/repo.pp View File

@@ -0,0 +1,62 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class plumgrid::repo (
17
+  $ensure = 'present',
18
+  $os_release = 'icehouse',
19
+  $repo_baseurl,
20
+  $repo_component,
21
+) {
22
+  if $ensure == 'present' {
23
+    case $::osfamily {
24
+      'RedHat', 'Linux': {
25
+        if $repo_baseurl and $repo_baseurl != '' {
26
+          yumrepo { 'plumgrid':
27
+            baseurl => "${repo_baseurl}/${repo_component}/el${operatingsystemmajrelease}/${architecture}",
28
+            descr => "PLUMgrid Repo",
29
+            enabled => 1,
30
+            gpgcheck => 1,
31
+            gpgkey => "${repo_baseurl}/GPG-KEY",
32
+          }
33
+        }
34
+      }
35
+      'Debian': {
36
+        apt::source { 'openstack':
37
+          location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
38
+          release => "${::lsbdistcodename}-updates/${os_release}",
39
+          repos => 'main',
40
+          key => 'ECD76E3E',
41
+          key_server => 'keyserver.ubuntu.com',
42
+          include_src => false,
43
+        }
44
+        Apt::Source['openstack'] -> Package['plumgrid-lxc']
45
+      }
46
+      default: {
47
+        fail("Unsupported repository for osfamily: ${::osfamily}, OS: ${::operatingsystem}, module ${module_name}")
48
+      }
49
+    }
50
+  } else {
51
+    case $::osfamily {
52
+      'RedHat', 'Linux': {
53
+        if $repo_baseurl and $repo_baseurl != '' {
54
+          yumrepo { 'plumgrid': ensure => absent, }
55
+        }
56
+      }
57
+      'Debian': {
58
+        apt::source { 'openstack': ensure => absent, }
59
+      }
60
+    }
61
+  }
62
+}

+ 10
- 0
deployment_scripts/puppet/modules/plumgrid/templates/hosts.erb View File

@@ -0,0 +1,10 @@
1
+# File created by puppet
2
+127.0.0.1   localhost
3
+127.0.1.1   <%= @fqdn %> <%= @hostname %>
4
+
5
+# The following lines are desirable for IPv6 capable hosts
6
+::1     ip6-localhost ip6-loopback
7
+fe00::0 ip6-localnet
8
+ff00::0 ip6-mcastprefix
9
+ff02::1 ip6-allnodes
10
+ff02::2 ip6-allrouters

+ 7
- 0
deployment_scripts/puppet/modules/plumgrid/templates/ifcs.conf.erb View File

@@ -0,0 +1,7 @@
1
+<%= @fabric_dev %> = fabric_core host
2
+<%- @gateway_devs.uniq.each do |entry| -%>
3
+<%= entry %> = access_phys
4
+<%- end -%>
5
+<%- @demux_devs.uniq.each do |entry| -%>
6
+<%= entry %> = trunk_ifc
7
+<%- end -%>

+ 13
- 0
deployment_scripts/puppet/modules/plumgrid/templates/plumgrid.conf.erb View File

@@ -0,0 +1,13 @@
1
+plumgrid_ip=<%= @plumgrid_ip %>
2
+plumgrid_port=<%= @plumgrid_port %>
3
+mgmt_dev=<%= @mgmt_dev %>
4
+label=<%= @hostname %>
5
+plumgrid_rsync_port=2222
6
+plumgrid_rest_addr=<%= @rest_ip %>:<%= @rest_port %>
7
+fabric_mode=<%= @fabric_mode %>
8
+plumgrid_syslog_ng_ip=<%= @plumgrid_syslog_ng_ip %>
9
+plumgrid_syslog_ng_port=<%= @plumgrid_syslog_ng_port %>
10
+plumgrid_monitor_interval=<%= @plumgrid_monitor_interval %>
11
+start_plumgrid_iovisor=yes
12
+start_plumgrid=`/opt/pg/scripts/pg_is_director.sh $plumgrid_ip`
13
+location=<%= @physical_location %>

+ 40
- 0
deployment_scripts/puppet/modules/sal/manifests/init.pp View File

@@ -0,0 +1,40 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class sal ($plumgrid_ip = '',
17
+           $virtual_ip = '',
18
+           $rest_port = '9180',
19
+           $mgmt_dev = '%AUTO_DEV%',
20
+           ) {
21
+  $lxc_root_path = '/var/lib/libvirt/filesystems/plumgrid'
22
+  $lxc_data_path = '/var/lib/libvirt/filesystems/plumgrid-data'
23
+
24
+  firewall { '001 allow PG Console access':
25
+    destination => $virtual_ip,
26
+    dport  => 443,
27
+    proto  => tcp,
28
+    action => accept,
29
+    before => [ Class['sal::nginx'], Class['sal::keepalived'] ],
30
+  }
31
+
32
+  class { 'sal::nginx':
33
+    plumgrid_ip => $plumgrid_ip,
34
+    virtual_ip => $virtual_ip,
35
+  }
36
+  class { 'sal::keepalived':
37
+    virtual_ip => $virtual_ip,
38
+    mgmt_dev => $mgmt_dev,
39
+  }
40
+}

+ 50
- 0
deployment_scripts/puppet/modules/sal/manifests/keepalived.pp View File

@@ -0,0 +1,50 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class sal::keepalived ($virtual_ip,
17
+                       $mgmt_dev,
18
+                       $keepalived_password = 'keepaliv',
19
+                       ) {
20
+Exec { path => [ '/bin', '/sbin' , '/usr/bin', '/usr/sbin', '/usr/local/bin', ] }
21
+
22
+$keepalived_priority = 100
23
+$keepalived_router_id = regsubst($virtual_ip, '^\d+\.\d+\.\d+\.(\d+)$', '\1')
24
+
25
+if $keepalived_router_id == '' {
26
+    fail('invalid virtual_ip, use x.x.x.x notation')
27
+  }
28
+
29
+exec { 'pick-vip_dev-by-route':
30
+    creates => "${::sal::lxc_data_path}/conf/pg/.auto_dev-vip",
31
+    command => "ip route get ${virtual_ip} | awk 'NR==1 && \$2==\"dev\" {print \$3; exit 0} NR==1 && \$2==\"via\" {print \$5; exit 0} NR>1 { exit 1 }' > ${::sal::lxc_data_path}/conf/pg/.auto_dev-vip || ip addr show | awk '/(${virtual_ip})\\// {print \$NF}' > ${::sal::lxc_data_path}/conf/pg/.auto_dev-vip",
32
+    require => Package['plumgrid-lxc'],
33
+}->
34
+exec { 'check-vip_dev-by-route':
35
+    command => 'echo "Please provide \"mgmt_dev\" parameter for \"sal\" class using foreman UI" && exit 1',
36
+    unless  => "test -s ${::sal::lxc_data_path}/conf/pg/.auto_dev-vip",
37
+}
38
+
39
+file { "${::sal::lxc_data_path}/conf/etc/.keepalived.conf":
40
+    ensure  => file,
41
+    content => template('sal/keepalived.conf.erb'),
42
+    require => Package['plumgrid-lxc'],
43
+}~>
44
+exec { 'generate-keepalived.conf':
45
+    refreshonly => true,
46
+    command     => "sed \"s/%AUTO_DEV%/`head -n1 ${::sal::lxc_data_path}/conf/pg/.auto_dev-vip`/g\" ${::sal::lxc_data_path}/conf/etc/.keepalived.conf > ${::sal::lxc_data_path}/conf/etc/keepalived.conf",
47
+    subscribe   => Exec['pick-vip_dev-by-route'],
48
+    notify      => Service['plumgrid'],
49
+}
50
+}

+ 56
- 0
deployment_scripts/puppet/modules/sal/manifests/nginx.pp View File

@@ -0,0 +1,56 @@
1
+#
2
+# Copyright (c) 2016, PLUMgrid Inc, http://plumgrid.com
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+
16
+class sal::nginx ($plumgrid_ip = '',
17
+                  $virtual_ip = '',
18
+                  $use_default_cert = true,
19
+                  ) {
20
+  if ($use_default_cert) {
21
+    $nginx_cert = "${::sal::lxc_data_path}/ssl/nginx/default.crt"
22
+    $nginx_key = "${::sal::lxc_data_path}/ssl/nginx/default.key"
23
+  } else {
24
+    # update with your parameters to generate a self-signed certificate
25
+    $location = "Sunnyvale"
26
+    $country = "US"
27
+    $state = "CA"
28
+    $organization = "ACME"
29
+    $unit = "IT"
30
+    $commonname = "www.example.com"
31
+    $keyname = "www_example_com"
32
+
33
+    $nginx_cert = "${::sal::lxc_data_path}/ssl/nginx/${keyname}.crt"
34
+    $nginx_key = "${::sal::lxc_data_path}/ssl/nginx/${keyname}.key"
35
+
36
+    $subject = "/C=${country}/ST=${state}/L=${location}/O=${organization}/OU=${unit}/CN=${commonname}"
37
+    $createcertificate = "/usr/bin/openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -out ${nginx_cert} -keyout ${nginx_key} -subj \"${subject}\""
38
+
39
+    exec { "openssl-csr":
40
+      command => $createcertificate,
41
+      creates => [$nginx_cert, $nginx_key],
42
+      require => Package['plumgrid-lxc'],
43
+    }
44
+  }
45
+
46
+  $nginx_virtual_ip = regsubst($virtual_ip, '^(\d+\.\d+\.\d+\.\d+)$', '\1')
47
+  if $nginx_virtual_ip == '' {
48
+    fail('invalid virtual_ip, use x.x.x.x notation')
49
+  }
50
+  $nginx_real_ips = split($plumgrid_ip, ',')
51
+  file { "${::sal::lxc_data_path}/conf/pg/nginx.conf":
52
+    ensure => file,
53
+    content => template('sal/default.conf.erb'),
54
+    require => Package['plumgrid-lxc'],
55
+  }
56
+}

+ 139
- 0
deployment_scripts/puppet/modules/sal/templates/default.conf.erb View File

@@ -0,0 +1,139 @@
1
+upstream sal {
2
+  server unix:/opt/pg/tmp/sal-web.socket;
3
+  keepalive 16;
4
+}
5
+
6
+upstream websocket {
7
+  server unix:/opt/pg/tmp/sal-ws.socket;
8
+  keepalive 16;
9
+}
10
+
11
+upstream pgCli {
12
+  server <%= @nginx_virtual_ip %>:3000;
13
+}
14
+
15
+map $http_upgrade $connection_upgrade {
16
+  default upgrade;
17
+  '' close;
18
+}
19
+
20
+lua_socket_log_errors off;
21
+#lua_code_cache off;
22
+lua_shared_dict rest_servers 16K;
23
+lua_shared_dict apache_servers 16K;
24
+lua_shared_dict tc_servers 16K;
25
+init_by_lua 'lb = require "lb"
26
+init_servers = {
27
+<%- @nginx_real_ips.each do |real| -%>
28
+  ["<%= real %>"] = true,
29
+<%- end -%>
30
+}';
31
+
32
+# Redirect http to https
33
+server {
34
+  listen <%= @nginx_virtual_ip %>:9080;
35
+  server_name $hostname;
36
+  return 301 https://$host$request_uri;
37
+}
38
+
39
+server {
40
+  listen <%= @nginx_virtual_ip %>:443 ssl;
41
+  ssl_protocols       SSLv3 TLSv1 TLSv1.1 TLSv1.2;
42
+  ssl_ciphers         AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
43
+  ssl_certificate     /opt/pg/sal/nginx/ssl/default.crt;
44
+  ssl_certificate_key /opt/pg/sal/nginx/ssl/default.key;
45
+  #ssl_session_cache   shared:SSL:10m;
46
+  #ssl_session_timeout 10m;
47
+
48
+  server_name $hostname;
49
+  root /opt/pg/web;
50
+  index login.html;
51
+
52
+  location /cli/ {
53
+    proxy_pass http://pgCli/;
54
+    proxy_redirect off;
55
+    proxy_http_version 1.1;
56
+    proxy_set_header Upgrade $http_upgrade;
57
+    proxy_set_header Connection "upgrade";
58
+    proxy_set_header Host $host;
59
+  }
60
+
61
+  location /vtap/ {
62
+    alias /opt/pg/vtap;
63
+  }
64
+
65
+  # REST API calls start with /v[0-9]/, a keyword, or a capital letter.
66
+  # Note: Regular expressions have higher precedence than prefix matches
67
+  # so don't combine with /0/...
68
+  location ~ ^/(v[0-9]/|pg/|docs|api-docs|[A-Z]) {
69
+    set $active_upstream "http://sal";
70
+    access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
71
+                       if ngx.req.get_uri_args()["server"]~=ngx.var.host then
72
+                           ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
73
+                       end
74
+                   end';
75
+
76
+    proxy_pass $active_upstream;
77
+    proxy_http_version 1.1;
78
+    proxy_set_header Connection "";
79
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
80
+  }
81
+
82
+  location /0/ {
83
+    set $active_upstream "http://sal";
84
+    access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
85
+                       if ngx.req.get_uri_args()["server"]~=ngx.var.host then
86
+                           ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
87
+                       end
88
+                   end';
89
+
90
+    proxy_pass $active_upstream;
91
+    proxy_http_version 1.1;
92
+    proxy_set_header Connection "";
93
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
94
+  }
95
+
96
+  location /0/websocket {
97
+    set $active_upstream "http://websocket";
98
+    access_by_lua 'if ngx.req.get_uri_args()["server"]~=nil then
99
+                       if ngx.req.get_uri_args()["server"]~=ngx.var.host then
100
+                           ngx.var.active_upstream = "https://"..ngx.req.get_uri_args()["server"]..ngx.var.request_uri
101
+                       end
102
+                   end';
103
+    proxy_pass $active_upstream;
104
+    proxy_http_version 1.1;
105
+    proxy_set_header Upgrade $http_upgrade;
106
+    proxy_set_header Connection $connection_upgrade;
107
+  }
108
+}
109
+
110
+server {
111
+  listen unix:/opt/pg/tmp/sal-rest.socket;
112
+
113
+  # debug socket
114
+  listen 127.0.0.1:9080;
115
+
116
+  location / {
117
+    set $active_upstream "";
118
+    access_by_lua 'ngx.var.active_upstream = find_next(ngx.shared.rest_servers, <%= @rest_port %>)';
119
+    proxy_pass http://$active_upstream:<%= @rest_port %>;
120
+  }
121
+
122
+  location /_debug/rest_servers {
123
+    access_by_lua 'find_next(ngx.shared.rest_servers, <%= @rest_port %>)';
124
+    content_by_lua '
125
+      for _, ip in pairs(ngx.shared.rest_servers:get_keys()) do
126
+        ngx.say(ip.."="..ngx.shared.rest_servers:get(ip))
127
+      end
128
+    ';
129
+  }
130
+
131
+  location /_debug/tc_servers {
132
+    access_by_lua 'find_next(ngx.shared.tc_servers, 12349)';
133
+    content_by_lua '
134
+      for _, ip in pairs(ngx.shared.tc_servers:get_keys()) do
135
+        ngx.say(ip.."="..ngx.shared.tc_servers:get(ip))
136
+      end
137
+    ';
138
+  }
139
+}

+ 30
- 0
deployment_scripts/puppet/modules/sal/templates/keepalived.conf.erb View File

@@ -0,0 +1,30 @@
1
+global_defs {
2
+  router_id <%= @hostname %>
3
+}
4
+
5
+vrrp_script chk_nginx {
6
+  script "killall -0 nginx"
7
+  interval 2
8
+}
9
+
10
+vrrp_instance nos {
11
+  virtual_router_id <%= @keepalived_router_id %>
12
+
13
+  # for electing MASTER, highest priority wins.
14
+  priority  <%= @keepalived_priority %>
15
+  state     BACKUP
16
+  nopreempt
17
+
18
+  interface <%= @mgmt_dev %>
19
+
20
+  virtual_ipaddress {
21
+    <%= @virtual_ip %> dev <%= @mgmt_dev %> label <%= @mgmt_dev %>:1
22
+  }
23
+  track_script {
24
+    chk_nginx
25
+  }
26
+  authentication {
27
+    auth_type PASS
28
+    auth_pass <%= @keepalived_password %>
29
+  }
30
+}

+ 115
- 0
deployment_tasks.yaml View File

@@ -0,0 +1,115 @@
1
+- id: PLUMgrid-Gateway
2
+  type: group
3
+  role: [PLUMgrid-Gateway]
4
+  tasks: [hiera, globals, logging, tools, netconfig]
5
+  required_for: [deploy_end]
6
+  requires: [deploy_start]
7
+  parameters:
8
+    strategy:
9
+      type: parallel
10
+
11
+- id: pgtools-support
12
+  role: ['controller', 'primary-controller']
13
+  required_for: [post_deployment_end]
14
+  requires: [post_deployment_start]
15
+  type: puppet
16
+  parameters:
17
+    puppet_manifest: puppet/manifests/tools.pp
18
+    puppet_modules: puppet/modules:/etc/puppet/modules
19
+    timeout: 3000
20
+
21
+- id: check-pgzone
22
+  role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
23
+  required_for: [post_deployment_end, pg_common]
24
+  requires: [post_deployment_start]
25
+  type: puppet
26
+  parameters:
27
+    puppet_manifest: puppet/manifests/pre_deployment.pp
28
+    puppet_modules: puppet/modules:/etc/puppet/modules
29
+    timeout: 720
30
+
31
+- id: pg_common
32
+  role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
33
+  required_for: [post_deployment_end, pg_fabric]
34
+  requires: [post_deployment_start, check-pgzone]
35
+  type: puppet
36
+  parameters:
37
+    puppet_manifest: puppet/manifests/pg_common.pp
38
+    puppet_modules: puppet/modules:/etc/puppet/modules
39
+    timeout: 3000
40
+
41
+- id: pg_os_version
42
+  role: ['controller', 'primary-controller']
43
+  required_for: [post_deployment_end, setup-director]
44
+  requires: [post_deployment_start, pg_common]
45
+  type: shell
46
+  parameters:
47
+    cmd: bash pg_os_version.sh
48
+    timeout: 3000
49
+
50
+- id: pg_fabric
51
+  role: ['controller', 'compute', 'PLUMgrid-Gateway', 'primary-controller']
52
+  required_for: [post_deployment_end, setup-director]
53
+  requires: [post_deployment_start, pg_common]
54
+  type: shell
55
+  parameters:
56
+    cmd: bash plumgrid_fabric.sh
57
+    timeout: 3000
58
+
59
+- id: setup-director
60
+  role: ['controller', 'primary-controller']
61
+  required_for: [post_deployment_end, director-fixes]
62
+  requires: [post_deployment_start, pg_os_version, pg_fabric]
63
+  type: puppet
64
+  parameters:
65
+    puppet_manifest: puppet/manifests/director.pp
66
+    puppet_modules: puppet/modules:/etc/puppet/modules
67
+    timeout: 3000
68
+
69
+- id: director-fixes
70
+  role: ['controller', 'primary-controller']
71
+  required_for: [post_deployment_end, post_pg_license]
72
+  requires: [post_deployment_start, setup-director]
73
+  type: puppet
74
+  parameters:
75
+    puppet_manifest: puppet/manifests/director_fixes.pp
76
+    puppet_modules: puppet/modules:/etc/puppet/modules
77
+    timeout: 3000
78
+
79
+- id: post_pg_license
80
+  role: ['primary-controller']
81
+  required_for: [post_deployment_end, setup-edge, setup-gateway]
82
+  requires: [post_deployment_start, director-fixes]
83
+  type: shell
84
+  parameters:
85
+    cmd: bash post_pg_license.sh
86
+    timeout: 3000
87
+
88
+- id: setup-edge
89
+  role: ['compute']
90
+  required_for: [post_deployment_end]
91
+  requires: [post_deployment_start, post_pg_license]
92
+  type: puppet
93
+  parameters:
94
+    puppet_manifest: puppet/manifests/edge.pp
95
+    puppet_modules: puppet/modules:/etc/puppet/modules
96
+    timeout: 3000
97
+
98
+- id: setup-gateway
99
+  role: ['PLUMgrid-Gateway']
100
+  required_for: [post_deployment_end, cleanup_os]
101
+  requires: [post_deployment_start, post_pg_license]
102
+  type: puppet
103
+  parameters:
104
+    puppet_manifest: puppet/manifests/gateway.pp
105
+    puppet_modules: puppet/modules:/etc/puppet/modules
106
+    timeout: 3000
107
+
108
+- id: cleanup_os
109
+  role: ['primary-controller']
110
+  required_for: [post_deployment_end]
111
+  requires: [post_deployment_start, setup-gateway]
112
+  type: shell
113
+  parameters:
114
+    cmd: bash cleanup_os.sh
115
+    timeout: 3000

+ 77
- 0
environment_config.yaml View File

@@ -0,0 +1,77 @@
1
+attributes:
2
+  metadata:
3
+    restrictions:
4
+      - condition: "not (cluster:net_provider == 'neutron' and networking_parameters:segmentation_type == 'vlan')"
5
+        message: "Please use Neutron with VLAN segmentation, the only network type supported with PLUMgrid plugin."
6
+  plumgrid_username:
7
+    value: "plumgrid"
8
+    label: "Enter the username for PLUMgrid"
9
+    description: "Enter the default username for accessing PLUMgrid"
10
+    weight: 25
11
+    type: "text"
12
+    regex:
13
+      source: '^\S+$'
14
+      error: "username cannot be empty or contain spaces"
15
+  plumgrid_password:
16
+    value: "plumgrid"
17
+    label: "Enter the password for PLUMgrid"
18
+    description: "Enter the default password for accessing PLUMgrid"
19
+    weight: 26
20
+    type: "password"
21
+    regex:
22
+      source: '^\S+$'
23
+      error: "password cannot be empty or contain spaces"
24
+  plumgrid_package_repo:
25
+    value: ''
26
+    label: 'Repository for PLUMgrid packages'
27
+    description: 'The IP address for PLUMgrid LCM'
28
+    weight: 45
29
+    type: "text"
30
+    regex:
31
+      source: '^((?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})|(?:^)$'
32
+      error: "Invalid IP address"
33
+  plumgrid_zone:
34
+    value: ""
35
+    label: "Enter the zone name for PLUMgrid LCM"
36
+    description: "Enter the zone name configured on the PLUMgrid LCM"
37
+    weight: 55
38
+    type: "text"
39
+    regex:
40
+      source: '^\S+$'
41
+      error: "Zone name cannot be empty or contain spaces"
42
+  plumgrid_license:
43
+    value: ""
44
+    label: "Enter the license for PLUMgrid"
45
+    description: "Enter the license that will be used by the PLUMgrid platform"
46
+    weight: 65
47
+    type: "text"
48
+    regex:
49
+      source: '^\S+$'
50
+      error: "License field cannot be empty or contain spaces"
51
+  gateway_devs:
52
+    value: ""
53
+    label: "Enter the interface(s) to be used by GW"
54
+    description: "Provide comma separated interfaces that will be used for external connectivity by the PLUMgrid gateway (eg. eth3,eth4)"
55
+    weight: 75
56
+    type: "text"
57
+    regex:
58
+      source: '^(\S+,?\s*)+$'
59
+      error: "One or more comma seperated gateway interfaces must be entered (eg. eth3,eth4)"
60
+  plumgrid_virtual_ip:
61
+    value: ''
62
+    label: 'PLUMgrid VIP to access the PLUMgrid console'
63
+    description: 'The IP address for PLUMgrid console'
64
+    weight: 30
65
+    type: "text"
66
+    regex:
67
+      source: '^((?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})|(?:^)$'
68
+      error: "Invalid IP address"
69
+  plumgrid_fabric_network:
70
+    value: ''
71
+    label: 'Enter the PLUMgrid Fabric Network'
72
+    description: 'Enter the network that will be used by PLUMgrid Fabric (no need to enter subnet)'
73
+    weight: 32
74
+    type: "text"
75
+    regex:
76
+      source: '^((?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})|(?:^)$'
77
+      error: "Invalid IP address"

+ 26
- 0
metadata.yaml View File

@@ -0,0 +1,26 @@
1
+# Plugin name
2
+name: plumgrid
3
+# Human-readable name for your plugin
4
+title: PLUMgrid plugin
5
+# Plugin version
6
+version: '1.0.0'
7
+# Description
8
+description: This plugin enables the usage of PLUMgrid ONS as the network backend.
9
+# Required fuel version
10
+fuel_version: ['7.0']
11
+# Specify license of your plugin
12
+licenses: ['Apache License Version 2.0']
13
+authors: ['javeriak@plumgrid.com', 'abdullah.khan@plumgrid.com']
14
+homepage: 'https://github.com/openstack/fuel-plugin-plumgrid'
15
+groups: ['network']
16
+
17
+# The plugin is compatible with releases in the list
18
+releases:
19
+  - os: ubuntu
20
+    version: 2015.1.0-7.0
21
+    mode: ['ha', 'multinode']
22
+    deployment_scripts_path: deployment_scripts/
23
+    repository_path: repositories/ubuntu
24
+
25
+# Version of plugin package
26
+package_version: '3.0.0'

+ 6
- 0
network_roles.yaml View File

@@ -0,0 +1,6 @@
1
+- id: "fabric"
2
+  default_mapping: "management"
3
+  properties:
4
+    subnet: true
5
+    gateway: false
6
+    vip: []

+ 7
- 0
node_roles.yaml View File

@@ -0,0 +1,7 @@
1
+PLUMgrid-Gateway:
2
+  name: "PLUMgrid-Gateway"
3
+  description: "External Connectivity using PLUMgrid"
4
+  conflicts:
5
+    - compute
6
+  limits:
7
+    min: 1

+ 5
- 0
pre_build_hook View File

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+
3
+# Add here any the actions which are required before plugin build
4
+# like packages building, packages downloading from mirrors and so on.
5
+# The script should return 0 if there were no errors.

+ 0
- 0
repositories/centos/.gitkeep View File


+ 0
- 0
repositories/ubuntu/.gitkeep View File


+ 6
- 0
tasks.yaml View File

@@ -0,0 +1,6 @@
1
+- role: '*'
2
+  stage: pre_deployment
3
+  type: shell
4
+  parameters:
5
+    cmd: echo OK
6
+    timeout: 30

+ 5
- 0
volumes.yaml View File

@@ -0,0 +1,5 @@
1
+volumes_roles_mapping:
2
+  PG-GW:
3
+    - {allocate_size: "min", id: "os"}
4
+    - {allocate_size: "all", id: "vm"}
5
+volumes: []

Loading…
Cancel
Save