Browse Source

LBaaS plugin for fuel, multinode

Works for multinode only

DocImpact
Closes-Bug: #1392413
Implements: blueprint cinder-neutron-plugins-in-fuel
Change-Id: I57e85dba161983c6d1408fe31cebd22b4030da6c
changes/99/157299/1
Stanislaw Bogatkin 4 years ago
commit
751ebb1c0c

+ 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
+

+ 4
- 0
README.md View File

@@ -0,0 +1,4 @@
1
+LBaaS plugin for fuel
2
+============
3
+
4
+Plugin description

+ 1
- 0
deployment_scripts/puppet/manifests/site.pp View File

@@ -0,0 +1 @@
1
+include lbaas

+ 7
- 0
deployment_scripts/puppet/modules/lbaas/Gemfile View File

@@ -0,0 +1,7 @@
1
+source 'https://rubygems.org'
2
+
3
+puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
4
+gem 'puppet', puppetversion
5
+gem 'puppetlabs_spec_helper', '>= 0.1.0'
6
+gem 'puppet-lint', '>= 0.3.2'
7
+gem 'facter', '>= 1.7.0'

+ 79
- 0
deployment_scripts/puppet/modules/lbaas/README.md View File

@@ -0,0 +1,79 @@
1
+# lbaas
2
+
3
+#### Table of Contents
4
+
5
+1. [Overview](#overview)
6
+2. [Module Description - What the module does and why it is useful](#module-description)
7
+3. [Setup - The basics of getting started with lbaas](#setup)
8
+    * [What lbaas affects](#what-lbaas-affects)
9
+    * [Setup requirements](#setup-requirements)
10
+    * [Beginning with lbaas](#beginning-with-lbaas)
11
+4. [Usage - Configuration options and additional functionality](#usage)
12
+5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
13
+5. [Limitations - OS compatibility, etc.](#limitations)
14
+6. [Development - Guide for contributing to the module](#development)
15
+
16
+## Overview
17
+
18
+A one-maybe-two sentence summary of what the module does/what problem it solves.
19
+This is your 30 second elevator pitch for your module. Consider including
20
+OS/Puppet version it works with.
21
+
22
+## Module Description
23
+
24
+If applicable, this section should have a brief description of the technology
25
+the module integrates with and what that integration enables. This section
26
+should answer the questions: "What does this module *do*?" and "Why would I use
27
+it?"
28
+
29
+If your module has a range of functionality (installation, configuration,
30
+management, etc.) this is the time to mention it.
31
+
32
+## Setup
33
+
34
+### What lbaas affects
35
+
36
+* A list of files, packages, services, or operations that the module will alter,
37
+  impact, or execute on the system it's installed on.
38
+* This is a great place to stick any warnings.
39
+* Can be in list or paragraph form.
40
+
41
+### Setup Requirements **OPTIONAL**
42
+
43
+If your module requires anything extra before setting up (pluginsync enabled,
44
+etc.), mention it here.
45
+
46
+### Beginning with lbaas
47
+
48
+The very basic steps needed for a user to get the module up and running.
49
+
50
+If your most recent release breaks compatibility or requires particular steps
51
+for upgrading, you may wish to include an additional section here: Upgrading
52
+(For an example, see http://forge.puppetlabs.com/puppetlabs/firewall).
53
+
54
+## Usage
55
+
56
+Put the classes, types, and resources for customizing, configuring, and doing
57
+the fancy stuff with your module here.
58
+
59
+## Reference
60
+
61
+Here, list the classes, types, providers, facts, etc contained in your module.
62
+This section should include all of the under-the-hood workings of your module so
63
+people know what the module is touching on their system but don't need to mess
64
+with things. (We are working on automating this section!)
65
+
66
+## Limitations
67
+
68
+This is where you list OS compatibility, version compatibility, etc.
69
+
70
+## Development
71
+
72
+Since your module is awesome, other users will want to play with it. Let them
73
+know what the ground rules for contributing are.
74
+
75
+## Release Notes/Contributors/Etc **Optional**
76
+
77
+If you aren't using changelog, put your release notes here (though you should
78
+consider using changelog). You may also add any additional sections you feel are
79
+necessary or important to include here. Please use the `## ` header.

+ 18
- 0
deployment_scripts/puppet/modules/lbaas/Rakefile View File

@@ -0,0 +1,18 @@
1
+require 'rubygems'
2
+require 'puppetlabs_spec_helper/rake_tasks'
3
+require 'puppet-lint/tasks/puppet-lint'
4
+PuppetLint.configuration.send('disable_80chars')
5
+PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"]
6
+
7
+desc "Validate manifests, templates, and ruby files"
8
+task :validate do
9
+  Dir['manifests/**/*.pp'].each do |manifest|
10
+    sh "puppet parser validate --noop #{manifest}"
11
+  end
12
+  Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file|
13
+    sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/
14
+  end
15
+  Dir['templates/**/*.erb'].each do |template|
16
+    sh "erb -P -x -T '-' #{template} | ruby -c"
17
+  end
18
+end

+ 27
- 0
deployment_scripts/puppet/modules/lbaas/lib/puppet/provider/lbaas_config/ini_setting.rb View File

@@ -0,0 +1,27 @@
1
+Puppet::Type.type(:lbaas_config).provide(
2
+  :ini_setting,
3
+  :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
4
+) do
5
+
6
+  def section
7
+    resource[:name].split('/', 2).first
8
+  end
9
+
10
+  def setting
11
+    resource[:name].split('/', 2).last
12
+  end
13
+
14
+  def separator
15
+    '='
16
+  end
17
+
18
+  def self.file_path
19
+    '/etc/neutron/lbaas_agent.ini'
20
+  end
21
+
22
+  # added for backwards compatibility with older versions of inifile
23
+  def file_path
24
+    self.class.file_path
25
+  end
26
+
27
+end

+ 27
- 0
deployment_scripts/puppet/modules/lbaas/lib/puppet/provider/neutron_config/ini_setting.rb View File

@@ -0,0 +1,27 @@
1
+Puppet::Type.type(:neutron_config).provide(
2
+  :ini_setting,
3
+  :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
4
+) do
5
+
6
+  def section
7
+    resource[:name].split('/', 2).first
8
+  end
9
+
10
+  def setting
11
+    resource[:name].split('/', 2).last
12
+  end
13
+
14
+  def separator
15
+    '='
16
+  end
17
+
18
+  def self.file_path
19
+    '/etc/neutron/neutron.conf'
20
+  end
21
+
22
+  # added for backwards compatibility with older versions of inifile
23
+  def file_path
24
+    self.class.file_path
25
+  end
26
+
27
+end

+ 42
- 0
deployment_scripts/puppet/modules/lbaas/lib/puppet/type/lbaas_config.rb View File

@@ -0,0 +1,42 @@
1
+Puppet::Type.newtype(:lbaas_config) do
2
+
3
+  ensurable
4
+
5
+  newparam(:name, :namevar => true) do
6
+    desc 'Section/setting name to manage from /etc/neutron/lbaas_agent.ini'
7
+    newvalues(/\S+\/\S+/)
8
+  end
9
+
10
+  newproperty(:value) do
11
+    desc 'The value of the setting to be defined.'
12
+    munge do |value|
13
+      value = value.to_s.strip
14
+      value.capitalize! if value =~ /^(true|false)$/i
15
+      value
16
+    end
17
+
18
+    def is_to_s( currentvalue )
19
+      if resource.secret?
20
+        return '[old secret redacted]'
21
+      else
22
+        return currentvalue
23
+      end
24
+    end
25
+
26
+    def should_to_s( newvalue )
27
+      if resource.secret?
28
+        return '[new secret redacted]'
29
+      else
30
+        return newvalue
31
+      end
32
+    end
33
+  end
34
+
35
+  newparam(:secret, :boolean => true) do
36
+    desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
37
+
38
+    newvalues(:true, :false)
39
+
40
+    defaultto false
41
+  end
42
+end

+ 42
- 0
deployment_scripts/puppet/modules/lbaas/lib/puppet/type/neutron_config.rb View File

@@ -0,0 +1,42 @@
1
+Puppet::Type.newtype(:neutron_config) do
2
+
3
+  ensurable
4
+
5
+  newparam(:name, :namevar => true) do
6
+    desc 'Section/setting name to manage from /etc/neutron/neutron.conf'
7
+    newvalues(/\S+\/\S+/)
8
+  end
9
+
10
+  newproperty(:value) do
11
+    desc 'The value of the setting to be defined.'
12
+    munge do |value|
13
+      value = value.to_s.strip
14
+      value.capitalize! if value =~ /^(true|false)$/i
15
+      value
16
+    end
17
+
18
+    def is_to_s( currentvalue )
19
+      if resource.secret?
20
+        return '[old secret redacted]'
21
+      else
22
+        return currentvalue
23
+      end
24
+    end
25
+
26
+    def should_to_s( newvalue )
27
+      if resource.secret?
28
+        return '[new secret redacted]'
29
+      else
30
+        return newvalue
31
+      end
32
+    end
33
+  end
34
+
35
+  newparam(:secret, :boolean => true) do
36
+    desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
37
+
38
+    newvalues(:true, :false)
39
+
40
+    defaultto false
41
+  end
42
+end

+ 95
- 0
deployment_scripts/puppet/modules/lbaas/manifests/init.pp View File

@@ -0,0 +1,95 @@
1
+# == Class: lbaas
2
+#
3
+# Full description of class lbaas here.
4
+#
5
+# === Parameters
6
+#
7
+# Document parameters here.
8
+#
9
+# [*sample_parameter*]
10
+#   Explanation of what this parameter affects and what it defaults to.
11
+#   e.g. "Specify one or more upstream ntp servers as an array."
12
+#
13
+# === Variables
14
+#
15
+# Here you should define a list of variables that this module would require.
16
+#
17
+# [*sample_variable*]
18
+#   Explanation of how this variable affects the funtion of this class and if
19
+#   it has a default. e.g. "The parameter enc_ntp_servers must be set by the
20
+#   External Node Classifier as a comma separated list of hostnames." (Note,
21
+#   global variables should be avoided in favor of class parameters as
22
+#   of Puppet 2.6.)
23
+#
24
+# === Examples
25
+#
26
+#  class { 'lbaas':
27
+#    servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
28
+#  }
29
+#
30
+# === Authors
31
+#
32
+# Author Name <author@domain.com>
33
+#
34
+# === Copyright
35
+#
36
+# Copyright 2014 Your name here, unless otherwise noted.
37
+#
38
+class lbaas {
39
+  include lbaas::params
40
+
41
+  package { $lbaas::params::lbaas_package_name:
42
+    ensure => present,
43
+  }
44
+
45
+# Actually, we need to define some resource, where we will do this configs and then we will call this resource from here. It need to better split
46
+# configuration part (we will try that package with neutron is anstalled in that defined resource) and we can notify something from resource - e.g.
47
+# we can create notify from that resource to neutron-server service. But now it good in that view.
48
+# if $::osfamily == 'Debian'{
49
+#   neutron_config {
50
+#     "service_providers/service_provider": value => 'LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default';
51
+#   }
52
+# }
53
+
54
+# Sorry, that needs to rework, obviously, but I haven't so much time to do it.
55
+  exec { "add_lbaas_plugin":
56
+    command => "/bin/sed -i \"/`egrep -v \'(^#|^$)\' $lbaas::params::neutron_conf_file | egrep \'.*service_plugins.*\'`/ s/$/,lbaas/\" $lbaas::params::neutron_conf_file",
57
+    unless  => "/bin/egrep -v '(^#|^$)' $lbaas::params::neutron_conf_file | egrep '.*service_plugins.*lbaas.*'",
58
+    notify  => Service['neutron-server']
59
+  }
60
+
61
+  lbaas_config {
62
+    "DEFAULT/device_driver": value => 'neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver';
63
+    "DEFAULT/interface_driver": value => 'neutron.agent.linux.interface.OVSInterfaceDriver';
64
+    "haproxy/user_group": value => $lbaas::params::usergroup;
65
+  }
66
+
67
+# That too should be redesigned, but I'm not sure that I need to write whole new provider to change one string of code.
68
+  exec { "enable_lbaas":
69
+    command => "/bin/sed -i \"s/'enable_lb': False/'enable_lb': True/\" $lbaas::params::horizon_settings_file",
70
+    unless  => "/bin/egrep \"'enable_lb': True\" $lbaas::params::horizon_settings_file",
71
+    notify  => Service[$lbaas::params::httpd_service_name],
72
+  }
73
+
74
+  service { 'neutron-server':
75
+    ensure  => running,
76
+    enable  => true,
77
+    require => Package[$lbaas::params::lbaas_package_name],
78
+  }
79
+
80
+  service { 'neutron-lbaas-agent':
81
+    ensure  => running,
82
+    enable  => true,
83
+    require => Package[$lbaas::params::lbaas_package_name],
84
+  }
85
+
86
+  package { $lbaas::params::haproxy_pkg:
87
+    ensure  => present,
88
+  }
89
+
90
+  service { $lbaas::params::httpd_service_name:
91
+    enable  => true,
92
+    ensure  => running,
93
+  }
94
+
95
+}

+ 21
- 0
deployment_scripts/puppet/modules/lbaas/manifests/params.pp View File

@@ -0,0 +1,21 @@
1
+class lbaas::params {
2
+  $neutron_conf_file = '/etc/neutron/neutron.conf'
3
+  $lbaas_conf_file = '/etc/neutron/lbaas_agent.ini'
4
+  $haproxy_pkg = 'haproxy'
5
+
6
+  if $::osfamily == 'Debian' {
7
+    $httpd_service_name = 'apache2'
8
+    $horizon_settings_file = '/etc/openstack-dashboard/local_settings.py'
9
+    $lbaas_package_name = 'neutron-lbaas-agent'
10
+    $usergroup = 'nogroup'
11
+
12
+  } elsif($::osfamily == 'RedHat') {
13
+    $httpd_service_name = 'httpd'
14
+    $horizon_settings_file = '/etc/openstack-dashboard/local_settings'
15
+    $lbaas_package_name = 'openstack-neutron'
16
+    $usergroup = 'nobody'
17
+
18
+  } else {
19
+    fail("unsupported family ${::osfamily}")
20
+  }
21
+}

+ 14
- 0
deployment_scripts/puppet/modules/lbaas/metadata.json View File

@@ -0,0 +1,14 @@
1
+{
2
+  "name": "sbog-lbaas",
3
+  "version": "0.1.0",
4
+  "author": "sbog",
5
+  "summary": "Module to manage lbaas",
6
+  "license": "Apache 2.0",
7
+  "source": "",
8
+  "project_page": "sbogatkin@mirantis.com",
9
+  "issues_url": "sbogatkin@mirantis.com",
10
+  "dependencies": [
11
+    {"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"}
12
+  ]
13
+}
14
+

+ 7
- 0
deployment_scripts/puppet/modules/lbaas/spec/classes/init_spec.rb View File

@@ -0,0 +1,7 @@
1
+require 'spec_helper'
2
+describe 'lbaas' do
3
+
4
+  context 'with defaults for all parameters' do
5
+    it { should contain_class('lbaas') }
6
+  end
7
+end

+ 1
- 0
deployment_scripts/puppet/modules/lbaas/spec/spec_helper.rb View File

@@ -0,0 +1 @@
1
+require 'puppetlabs_spec_helper/module_spec_helper'

+ 12
- 0
deployment_scripts/puppet/modules/lbaas/tests/init.pp View File

@@ -0,0 +1,12 @@
1
+# The baseline for module testing used by Puppet Labs is that each manifest
2
+# should have a corresponding test manifest that declares that class or defined
3
+# type.
4
+#
5
+# Tests are then run by using puppet apply --noop (to check for compilation
6
+# errors and view a log of events) or by fully applying the test in a virtual
7
+# environment (to compare the resulting system state to the desired state).
8
+#
9
+# Learn more about module testing here:
10
+# http://docs.puppetlabs.com/guides/tests_smoke.html
11
+#
12
+include lbaas

+ 6
- 0
environment_config.yaml View File

@@ -0,0 +1,6 @@
1
+attributes:
2
+  # Show lbaas only for neutron
3
+  metadata:
4
+    restrictions:
5
+      - condition: cluster:net_provider != 'neutron'
6
+        action: hide

+ 25
- 0
metadata.yaml View File

@@ -0,0 +1,25 @@
1
+# Plugin name
2
+name: lbaas
3
+title: LBaaS plugin for Neutron
4
+# Plugin version
5
+version: 1.0.0
6
+# Description
7
+description: Enables LBaaS for Neutron, works in multinode mode only
8
+# Required fuel version
9
+fuel_version: ['6.0']
10
+
11
+# The plugin is compatible with releases in the list
12
+releases:
13
+  - os: ubuntu
14
+    version: 2014.2-6.0
15
+    mode: ['multinode']
16
+    deployment_scripts_path: deployment_scripts/
17
+    repository_path: repositories/ubuntu
18
+  - os: centos
19
+    version: 2014.2-6.0
20
+    mode: ['multinode']
21
+    deployment_scripts_path: deployment_scripts/
22
+    repository_path: repositories/centos
23
+
24
+# Version of plugin package
25
+package_version: '1.0.0'

+ 14
- 0
pre_build_hook View File

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+set -eux
4
+
5
+ROOT="$(dirname `readlink -f $0`)"
6
+MODULES="${ROOT}"/deployment_scripts/puppet/modules/
7
+TMP_DIR="${ROOT}"/tmp
8
+mkdir -p "${MODULES}"
9
+mkdir -p "${TMP_DIR}"
10
+REPO_PATH='https://github.com/stackforge/fuel-library/tarball/f43d885914d74fbd062096763222f350f47480e1'
11
+
12
+wget -qO- "${REPO_PATH}" | \
13
+    tar -C "${MODULES}" --strip-components=3 -zxvf - \
14
+    stackforge-fuel-library-f43d885/deployment/puppet/inifile

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


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


+ 8
- 0
tasks.yaml View File

@@ -0,0 +1,8 @@
1
+# Deployment is required for controllers
2
+- role: ['controller']
3
+  stage: post_deployment
4
+  type: puppet
5
+  parameters:
6
+    puppet_manifest: puppet/manifests/site.pp
7
+    puppet_modules: puppet/modules
8
+    timeout: 360

Loading…
Cancel
Save