Adapt Murano for Liberty
- update Murano modular to use puppets for liberty Change-Id: I6e89f00c90f58fc374f160d31ae07b2b05052182 Related-Bug: #1496397
This commit is contained in:
parent
ada7efc036
commit
684ba7960f
|
@ -34,3 +34,4 @@ puppet/monit
|
|||
puppet/filemapper
|
||||
puppet/tftp
|
||||
puppet/ironic
|
||||
puppet/murano
|
||||
|
|
|
@ -180,3 +180,8 @@ mod 'tftp',
|
|||
mod 'ironic',
|
||||
:git => 'https://review.fuel-infra.org/p/puppet-modules/puppet-ironic.git',
|
||||
:ref => '6.0.0'
|
||||
|
||||
# Pull in puppet-murano
|
||||
mod 'murano',
|
||||
:git => 'https://review.fuel-infra.org/p/puppet-modules/puppet-murano.git',
|
||||
:ref => '7.0.0-mos-rc1'
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
fixtures:
|
||||
repositories:
|
||||
'inifile': 'git://github.com/puppetlabs/puppetlabs-inifile'
|
||||
'concat':
|
||||
repo: 'git://github.com/puppetlabs/puppetlabs-concat.git'
|
||||
ref: '1.2.1'
|
||||
'stdlib': 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
|
||||
'sysctl': 'git://github.com/duritong/puppet-sysctl.git'
|
||||
'keystone': 'git://github.com/openstack/puppet-keystone.git'
|
||||
'openstacklib': 'git://github.com/openstack/puppet-openstacklib.git'
|
||||
symlinks:
|
||||
'murano': "#{source_dir}"
|
|
@ -1,28 +0,0 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => false
|
||||
gem 'rspec-puppet', '~> 2.1.0', :require => false
|
||||
|
||||
gem 'metadata-json-lint'
|
||||
gem 'puppet-lint-param-docs'
|
||||
gem 'puppet-lint-absolute_classname-check'
|
||||
gem 'puppet-lint-absolute_template_path'
|
||||
gem 'puppet-lint-trailing_newline-check'
|
||||
|
||||
# Puppet 4.x related lint checks
|
||||
gem 'puppet-lint-unquoted_string-check'
|
||||
gem 'puppet-lint-leading_zero-check'
|
||||
gem 'puppet-lint-variable_contains_upcase'
|
||||
gem 'puppet-lint-numericvariable'
|
||||
|
||||
gem 'beaker-rspec', :require => false
|
||||
end
|
||||
|
||||
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||
gem 'puppet', puppetversion, :require => false
|
||||
else
|
||||
gem 'puppet', :require => false
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
|
@ -1,175 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
|
@ -1,80 +0,0 @@
|
|||
murano
|
||||
======
|
||||
|
||||
#### Table of Contents
|
||||
|
||||
1. [Overview - What is the murano module?](#overview)
|
||||
2. [Module Description - What does the module do?](#module-description)
|
||||
3. [Setup - The basics of getting started with murano](#setup)
|
||||
4. [Implementation - An under-the-hood peek at what the module is doing](#implementation)
|
||||
5. [Limitations - OS compatibility, etc.](#limitations)
|
||||
6. [Development - Guide for contributing to the module](#development)
|
||||
7. [Contributors - Those with commits](#contributors)
|
||||
8. [Release Notes - Notes on the most recent updates to the module](#release-notes)
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The Murano module itself is used to flexibly configure and manage the
|
||||
application catalog service for OpenStack.
|
||||
|
||||
Module Description
|
||||
------------------
|
||||
|
||||
The murano module is an attempt to make Puppet capable of managing the
|
||||
entirety of murano.
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
**What the murano module affects:**
|
||||
|
||||
* murano, the application catalog service for OpenStack.
|
||||
|
||||
### Beginning with murano
|
||||
|
||||
To use the murano module's functionality you will need to declare multiple
|
||||
resources. This is not an exhaustive list of all the components needed; we
|
||||
recommend you consult and understand the
|
||||
[core of openstack](http://docs.openstack.org) documentation.
|
||||
|
||||
Examples of usage can be found in the *examples* directory.
|
||||
|
||||
Implementation
|
||||
--------------
|
||||
|
||||
### murano
|
||||
|
||||
puppet-murano is a combination of Puppet manifests and ruby code to deliver
|
||||
configuration and extra functionality through types and providers.
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
None.
|
||||
|
||||
Beaker-Rspec
|
||||
------------
|
||||
|
||||
This module has beaker-rspec tests
|
||||
|
||||
To run:
|
||||
|
||||
``shell
|
||||
bundle install
|
||||
bundle exec rspec spec/acceptance
|
||||
``
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
Developer documentation for the entire puppet-openstack project.
|
||||
|
||||
* https://wiki.openstack.org/wiki/Puppet-openstack#Developer_documentation
|
||||
|
||||
Release Notes
|
||||
-------------
|
||||
|
||||
**1.0.0**
|
||||
|
||||
* Initial
|
|
@ -1,6 +0,0 @@
|
|||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
|
@ -1,38 +0,0 @@
|
|||
# First, install a mysql server
|
||||
class { '::mysql::server':
|
||||
# if you're installing into an existing openstack
|
||||
manage_config_file => false,
|
||||
purge_conf_dir => false,
|
||||
}
|
||||
|
||||
class { '::murano::db::mysql':
|
||||
password => 'a_big_secret',
|
||||
}
|
||||
|
||||
# Then the common class
|
||||
class { '::murano':
|
||||
package_ensure => 'latest',
|
||||
database_connection => 'mysql://murano:a_big_secret@127.0.0.1:3306/murano',
|
||||
verbose => true,
|
||||
debug => true,
|
||||
keystone_username => 'admin',
|
||||
keystone_password => 'secrets_everywhere',
|
||||
keystone_tenant => 'admin',
|
||||
keystone_url => 'http://127.0.0.1:5000/v2.0/',
|
||||
identity_host => '127.0.0.1',
|
||||
identity_port => '35357',
|
||||
identity_protocol => 'http',
|
||||
}
|
||||
|
||||
# Finally, make it accessible
|
||||
class { '::murano::keystone::auth':
|
||||
password => 'secrete',
|
||||
}
|
||||
|
||||
class { '::murano:api':
|
||||
package_ensure => 'latest',
|
||||
}
|
||||
|
||||
class { '::murano::engine':
|
||||
package_ensure => 'latest',
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
module Puppet::Parser::Functions
|
||||
newfunction(:get_ext_net_name, :type => :rvalue) do |args|
|
||||
networks = args.first
|
||||
fail 'No network data provided!' unless networks.is_a? Hash
|
||||
ext_net_array = networks.find { |_, value| value.fetch('L2', {})['router_ext'] }
|
||||
break unless ext_net_array
|
||||
ext_net_array.first
|
||||
end
|
||||
end
|
|
@ -1,22 +0,0 @@
|
|||
Puppet::Type.type(:murano_config).provide(
|
||||
:ini_setting,
|
||||
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
|
||||
) do
|
||||
|
||||
def section
|
||||
resource[:name].split('/', 2).first
|
||||
end
|
||||
|
||||
def setting
|
||||
resource[:name].split('/', 2).last
|
||||
end
|
||||
|
||||
def separator
|
||||
'='
|
||||
end
|
||||
|
||||
def file_path
|
||||
'/etc/murano/murano.conf'
|
||||
end
|
||||
|
||||
end
|
|
@ -1,22 +0,0 @@
|
|||
Puppet::Type.type(:murano_paste_ini_config).provide(
|
||||
:ini_setting,
|
||||
:parent => Puppet::Type.type(:ini_setting).provider(:ruby)
|
||||
) do
|
||||
|
||||
def section
|
||||
resource[:name].split('/', 2).first
|
||||
end
|
||||
|
||||
def setting
|
||||
resource[:name].split('/', 2).last
|
||||
end
|
||||
|
||||
def separator
|
||||
'='
|
||||
end
|
||||
|
||||
def file_path
|
||||
'/etc/murano/murano-paste.ini'
|
||||
end
|
||||
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
Puppet::Type.newtype(:murano_config) do
|
||||
|
||||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
desc 'Section/setting name to manage from murano.conf'
|
||||
newvalues(/\S+\/\S+/)
|
||||
end
|
||||
|
||||
newproperty(:value) do
|
||||
desc 'The value of the setting to be defined.'
|
||||
munge do |value|
|
||||
value = value.to_s.strip
|
||||
value.capitalize! if value =~ /^(true|false)$/i
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -1,19 +0,0 @@
|
|||
Puppet::Type.newtype(:murano_paste_ini_config) do
|
||||
|
||||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
desc 'Section/setting name to manage from murano-paste.ini'
|
||||
newvalues(/\S+\/\S+/)
|
||||
end
|
||||
|
||||
newproperty(:value) do
|
||||
desc 'The value of the setting to be defined.'
|
||||
munge do |value|
|
||||
value = value.to_s.strip
|
||||
value.capitalize! if value =~ /^(true|false)$/i
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
|
@ -1,71 +0,0 @@
|
|||
# == Class: murano::api
|
||||
#
|
||||
# murano api package & service
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (Optional) Should the service be enabled
|
||||
# Defaults to true
|
||||
#
|
||||
# [*enabled*]
|
||||
# (Optional) Whether the service should be managed by Puppet
|
||||
# Defaults to true
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*host*]
|
||||
# (Optional) Host on which murano api should listen
|
||||
# Defaults to '127.0.0.1'
|
||||
#
|
||||
# [*port*]
|
||||
# (Optional) Port on which murano api should listen
|
||||
# Defaults to 8082
|
||||
#
|
||||
class murano::api(
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$package_ensure = 'present',
|
||||
$host = '127.0.0.1',
|
||||
$port = 8082,
|
||||
) {
|
||||
|
||||
include ::murano
|
||||
include ::murano::params
|
||||
include ::murano::policy
|
||||
|
||||
Murano_config<||> ~> Service['murano-api']
|
||||
Package<| title == 'murano-common' |> -> Package['murano-api']
|
||||
Exec['murano-dbmanage'] -> Service['murano-api']
|
||||
Class['murano::policy'] -> Service['murano-api']
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
}
|
||||
|
||||
murano_config {
|
||||
'DEFAULT/bind_host' : value => $host;
|
||||
'DEFAULT/bind_port' : value => $port;
|
||||
}
|
||||
|
||||
package { 'murano-api':
|
||||
ensure => $package_ensure,
|
||||
name => $::murano::params::api_package_name,
|
||||
}
|
||||
|
||||
service { 'murano-api':
|
||||
ensure => $service_ensure,
|
||||
name => $::murano::params::api_service_name,
|
||||
enable => $enabled,
|
||||
require => Package['murano-api'],
|
||||
}
|
||||
|
||||
Package['murano-api'] ~> Service['murano-api']
|
||||
Murano_paste_ini_config<||> ~> Service['murano-api']
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
# == Resource: murano::application
|
||||
#
|
||||
# murano application importer
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_name*]
|
||||
# (Optional) Application package name
|
||||
# Defaults to $title
|
||||
#
|
||||
# [*package_category*]
|
||||
# (Optional) Application category
|
||||
# Defaults to ''
|
||||
#
|
||||
# [*murano_cli*]
|
||||
# (Optional) Executable name for murano CLI
|
||||
# Defaults to 'murano'
|
||||
#
|
||||
# [*runas_user*]
|
||||
# (Optional) User to execute murano CLI
|
||||
# Defaults to 'root'
|
||||
#
|
||||
# [*os_tenant_name*]
|
||||
# (Optional) Keystone tenant for murano
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*os_username*]
|
||||
# (Optional) Keystone username for murano
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*os_password*]
|
||||
# (Optional) Keystone password for murano
|
||||
# Defaults to 'ChangeMe'
|
||||
#
|
||||
# [*os_region*]
|
||||
# (Optional) Keystone region for murano
|
||||
# Defaults to 'RegionOne'
|
||||
#
|
||||
# [*os_auth_url*]
|
||||
# (Optional) Keystone public identity URL
|
||||
# Defaults to 'http://127.0.0.1:5000/v2.0/'
|
||||
#
|
||||
# [*mandatory*]
|
||||
# (Optional) Is this package mandatory
|
||||
# Defaults to false
|
||||
#
|
||||
define murano::application (
|
||||
$package_name = $title,
|
||||
$package_category = '',
|
||||
$murano_cli = 'murano',
|
||||
$runas_user = 'root',
|
||||
$os_tenant_name = 'admin',
|
||||
$os_username = 'admin',
|
||||
$os_password = 'ChangeMe',
|
||||
$os_region = 'RegionOne',
|
||||
$os_auth_url = 'http://127.0.0.1:5000/v2.0/',
|
||||
$mandatory = false,
|
||||
) {
|
||||
|
||||
$package_path="/var/cache/murano/meta/${package_name}.zip"
|
||||
|
||||
if $package_category {
|
||||
$murano_cli_cmd = "${murano_cli} package-import '${package_path}' -c '${package_category}' --is-public --exists-action u"
|
||||
} else {
|
||||
$murano_cli_cmd = "${murano_cli} package-import '${package_path}' --is-public --exists-action u"
|
||||
}
|
||||
|
||||
$murano_cli_pkgcheck = "${murano_cli} package-list 2>&1 | grep -q ' ${package_name} '"
|
||||
|
||||
exec { "murano_import_package_${package_name}":
|
||||
path => '/sbin:/usr/sbin:/bin:/usr/bin',
|
||||
environment => [
|
||||
"OS_TENANT_NAME=${os_tenant_name}",
|
||||
"OS_USERNAME=${os_username}",
|
||||
"OS_PASSWORD=${os_password}",
|
||||
"OS_AUTH_URL=${os_auth_url}",
|
||||
'OS_ENDPOINT_TYPE=internalURL',
|
||||
"OS_REGION_NAME=${os_region}"
|
||||
],
|
||||
command => $murano_cli_cmd,
|
||||
user => $runas_user,
|
||||
group => $runas_user,
|
||||
tries => 3,
|
||||
try_sleep => 10,
|
||||
unless => $murano_cli_pkgcheck,
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
# == Class: murano::client
|
||||
#
|
||||
# murano client package
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
class murano::client(
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include ::murano::params
|
||||
|
||||
package { 'python-muranoclient':
|
||||
ensure => $package_ensure,
|
||||
name => $::murano::params::pythonclient_package_name,
|
||||
}
|
||||
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
# == Class: murano::dashboard
|
||||
#
|
||||
# murano dashboard package
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*api_url*]
|
||||
# (Optional) API url for murano-dashboard
|
||||
# Defaults to 'http://127.0.0.1:8082'
|
||||
#
|
||||
# [*repo_url*]
|
||||
# (Optional) Application repository URL for murano-dashboard
|
||||
# Defaults to 'http://storage.apps.openstack.org'
|
||||
#
|
||||
# [*settings_py*]
|
||||
# (Optional) Path to horizon settings
|
||||
# Defaults to '/usr/share/openstack-dashboard/openstack_dashboard/settings.py'
|
||||
#
|
||||
# [*modify_config*]
|
||||
# (Optional) Path to modify-horizon-config script
|
||||
# Defaults to '/usr/bin/modify-horizon-config.sh'
|
||||
#
|
||||
# [*collect_static_script*]
|
||||
# (Optional) Path to horizon manage utility
|
||||
# Defaults to '/usr/share/openstack-dashboard/manage.py'
|
||||
#
|
||||
# [*metadata_dir*]
|
||||
# (Optional) Directory to store murano dashboard metadata cache
|
||||
# Defaults to '/var/cache/muranodashboard-cache'
|
||||
#
|
||||
# [*max_file_size*]
|
||||
# (Optional) Maximum allowed filesize to upload
|
||||
# Defaults to '5'
|
||||
#
|
||||
class murano::dashboard(
|
||||
$package_ensure = 'present',
|
||||
$api_url = 'http://127.0.0.1:8082',
|
||||
$repo_url = 'http://storage.apps.openstack.org',
|
||||
$settings_py = '/usr/share/openstack-dashboard/openstack_dashboard/settings.py',
|
||||
$modify_config = '/usr/bin/modify-horizon-config.sh',
|
||||
$collect_static_script = '/usr/share/openstack-dashboard/manage.py',
|
||||
$metadata_dir = '/var/cache/muranodashboard-cache',
|
||||
$max_file_size = '5',
|
||||
) {
|
||||
|
||||
include ::murano::params
|
||||
|
||||
$apache_user = $::osfamily ? {
|
||||
'RedHat' => 'apache',
|
||||
'Debian' => 'horizon',
|
||||
default => 'www-data',
|
||||
}
|
||||
|
||||
package { 'murano-dashboard':
|
||||
ensure => $package_ensure,
|
||||
name => $::murano::params::dashboard_package_name,
|
||||
}
|
||||
|
||||
File_line {
|
||||
ensure => 'present',
|
||||
}
|
||||
|
||||
file_line { 'murano_url' :
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "MURANO_API_URL = '${api_url}'",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
file_line { 'murano_repo_url':
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "MURANO_REPO_URL = '${repo_url}'",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
file_line { 'murano_max_file_size':
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "MAX_FILE_SIZE_MB = '${max_file_size}'",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
file_line { 'murano_metadata_dir':
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "METADATA_CACHE_DIR = '${metadata_dir}'",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
file_line { 'murano_dashboard_logging':
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "LOGGING['loggers']['muranodashboard'] = {'handlers': ['syslog'], 'level': 'DEBUG'}",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
file_line { 'murano_client_logging':
|
||||
path => $::murano::params::local_settings_path,
|
||||
line => "LOGGING['loggers']['muranoclient'] = {'handlers': ['syslog'], 'level': 'ERROR'}",
|
||||
tag => 'patch-horizon-config',
|
||||
}
|
||||
|
||||
exec { 'clean_horizon_config':
|
||||
command => "${modify_config} uninstall",
|
||||
onlyif => [
|
||||
"test -f ${modify_config}",
|
||||
"grep MURANO_CONFIG_SECTION_BEGIN ${settings_py}",
|
||||
],
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
}
|
||||
|
||||
exec { 'django_collectstatic':
|
||||
command => "${collect_static_script} collectstatic --noinput",
|
||||
environment => [
|
||||
"APACHE_USER=${apache_user}",
|
||||
"APACHE_GROUP=${apache_user}",
|
||||
],
|
||||
refreshonly => true,
|
||||
}
|
||||
|
||||
File_line <| tag == 'patch-horizon-config' |> -> Service <| title == 'httpd' |>
|
||||
|
||||
Package['murano-dashboard'] ->
|
||||
Exec['clean_horizon_config'] ->
|
||||
Service <| title == 'httpd' |>
|
||||
|
||||
Package['murano-dashboard'] ~>
|
||||
Exec['django_collectstatic'] ~>
|
||||
Service <| title == 'httpd' |>
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
# == Class: murano::db::mysql
|
||||
#
|
||||
# The murano::db::mysql class creates a MySQL database for murano.
|
||||
# It must be used on the MySQL server.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*password*]
|
||||
# (Required) Password to connect to the database.
|
||||
#
|
||||
# [*dbname*]
|
||||
# (Optional) Name of the database.
|
||||
# Defaults to 'murano'.
|
||||
#
|
||||
# [*user*]
|
||||
# (Optional) User to connect to the database.
|
||||
# Defaults to 'murano'.
|
||||
#
|
||||
# [*host*]
|
||||
# (Optional) The default source host user is allowed to connect from.
|
||||
# Defaults to '127.0.0.1'
|
||||
#
|
||||
# [*allowed_hosts*]
|
||||
# (Optional) Other hosts the user is allowed to connect from.
|
||||
# Defaults to 'undef'.
|
||||
#
|
||||
# [*charset*]
|
||||
# (Optional) The database charset.
|
||||
# Defaults to 'utf8'.
|
||||
#
|
||||
# [*collate*]
|
||||
# (Optional) Charset collate of murano database.
|
||||
# Defaults to 'utf8_general_ci'.
|
||||
#
|
||||
class murano::db::mysql(
|
||||
$password,
|
||||
$dbname = 'murano',
|
||||
$user = 'murano',
|
||||
$host = '127.0.0.1',
|
||||
$allowed_hosts = undef,
|
||||
$charset = 'utf8',
|
||||
$collate = 'utf8_general_ci',
|
||||
) {
|
||||
|
||||
validate_string($password)
|
||||
|
||||
::openstacklib::db::mysql{ 'murano':
|
||||
user => $user,
|
||||
password_hash => mysql_password($password),
|
||||
dbname => $dbname,
|
||||
host => $host,
|
||||
charset => $charset,
|
||||
collate => $collate,
|
||||
allowed_hosts => $allowed_hosts,
|
||||
}
|
||||
|
||||
::Openstacklib::Db::Mysql['murano'] ~> Exec<| title == 'murano-dbmanage' |>
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
# == Class: murano::db::postgresql
|
||||
#
|
||||
# The murano::db::postgresql creates a PostgreSQL database for murano.
|
||||
# It must be used on the PostgreSQL server.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*password*]
|
||||
# (Required) Password to connect to the database.
|
||||
#
|
||||
# [*dbname*]
|
||||
# (Optional) Name of the database.
|
||||
# Defaults to 'murano'.
|
||||
#
|
||||
# [*user*]
|
||||
# (Optional) User to connect to the database.
|
||||
# Defaults to 'murano'.
|
||||
#
|
||||
# [*encoding*]
|
||||
# (Optional) The charset to use for the database.
|
||||
# Default to undef.
|
||||
#
|
||||
# [*privileges*]
|
||||
# (Optional) Privileges given to the database user.
|
||||
# Default to 'ALL'
|
||||
#
|
||||
class murano::db::postgresql(
|
||||
$password,
|
||||
$dbname = 'murano',
|
||||
$user = 'murano',
|
||||
$encoding = undef,
|
||||
$privileges = 'ALL',
|
||||
) {
|
||||
|
||||
Class['murano::db::postgresql'] -> Service<| title == 'murano' |>
|
||||
|
||||
::openstacklib::db::postgresql { 'murano':
|
||||
password_hash => postgresql_password($user, $password),
|
||||
dbname => $dbname,
|
||||
user => $user,
|
||||
encoding => $encoding,
|
||||
privileges => $privileges,
|
||||
}
|
||||
|
||||
::Openstacklib::Db::Postgresql['murano'] ~> Exec<| title == 'murano-dbmanage' |>
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
# == Class: murano::engine
|
||||
#
|
||||
# murano engine package & service
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (Optional) Should the service be enabled
|
||||
# Defaults to true
|
||||
#
|
||||
# [*enabled*]
|
||||
# (Optional) Whether the service should be managed by Puppet
|
||||
# Defaults to true
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
class murano::engine(
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include ::murano
|
||||
include ::murano::params
|
||||
include ::murano::policy
|
||||
|
||||
Murano_config<||> ~> Service['murano-engine']
|
||||
Exec['murano-dbmanage'] -> Service['murano-engine']
|
||||
Class['murano::policy'] -> Service['murano-engine']
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
}
|
||||
|
||||
package { 'murano-engine':
|
||||
ensure => $package_ensure,
|
||||
name => $::murano::params::engine_package_name,
|
||||
}
|
||||
|
||||
service { 'murano-engine':
|
||||
ensure => $service_ensure,
|
||||
name => $::murano::params::engine_service_name,
|
||||
enable => $enabled,
|
||||
require => Package['murano-engine'],
|
||||
}
|
||||
|
||||
Package['murano-engine'] ~> Service['murano-engine']
|
||||
Murano_paste_ini_config<||> ~> Service['murano-engine']
|
||||
|
||||
}
|
|
@ -1,259 +0,0 @@
|
|||
# == Class: murano
|
||||
#
|
||||
# murano base package & configuration
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*verbose*]
|
||||
# (Optional) Should the service log verbose messages
|
||||
# Defaults to false
|
||||
#
|
||||
# [*debug*]
|
||||
# (Optional) Should the service log debug messages
|
||||
# Defaults to false
|
||||
#
|
||||
# [*use_syslog*]
|
||||
# (Optional) Should the service use Syslog
|
||||
# Defaults to false
|
||||
#
|
||||
# [*use_stderr*]
|
||||
# (Optional) Log output to standard error
|
||||
# Defaults to true
|
||||
#
|
||||
# [*log_facility*]
|
||||
# (Optional) Syslog facility to recieve logs
|
||||
# Defaults to 'LOG_LOCAL0'
|
||||
#
|
||||
# [*log_dir*]
|
||||
# (Optional) Directory to store logs
|
||||
# Defaults to '/var/log/murano'
|
||||
#
|
||||
# [*data_dir*]
|
||||
# (Optional) Directory to store data
|
||||
# Defaults to '/var/cache/murano'
|
||||
#
|
||||
# [*notification_driver*]
|
||||
# (Optional) Notification driver to use
|
||||
# Defaults to 'messagingv2'
|
||||
#
|
||||
# [*rabbit_os_hosts*]
|
||||
# (Optional) List of clustered rabbit servers.
|
||||
# Defaults to '['127.0.0.1:5672']'
|
||||
#
|
||||
# [*rabbit_os_port*]
|
||||
# (Optional) Port for openstack rabbit server
|
||||
# Defaults to '5672'
|
||||
#
|
||||
# [*rabbit_os_user*]
|
||||
# (Optional) Username for openstack rabbit server
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*rabbit_os_password*]
|
||||
# (Optional) Password for openstack rabbit server
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*rabbit_ha_queues*]
|
||||
# (Optional) Should murano api use ha queues
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*rabbit_own_host*]
|
||||
# (Optional) Host for murano rabbit server
|
||||
# Defaults to '127.0.0.1'
|
||||
#
|
||||
# [*rabbit_own_port*]
|
||||
# (Optional) Port for murano rabbit server
|
||||
# Defaults to '5672'
|
||||
#
|
||||
# [*rabbit_own_user*]
|
||||
# (Optional) Username for murano rabbit server
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*rabbit_own_password*]
|
||||
# (Optional) Password for murano rabbit server
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*service_host*]
|
||||
# (Optional) Host for murano to listen on
|
||||
# Defaults to '0.0.0.0'
|
||||
#
|
||||
# [*service_port*]
|
||||
# (Optional) Port for murano to listen on
|
||||
# Defaults to 8082
|
||||
#
|
||||
# [*database_connection*]
|
||||
# (Optional) Database for murano
|
||||
# Defaults to 'mysql://murano:secrete@localhost:3306/murano'
|
||||
#
|
||||
# == keystone authentication options
|
||||
#
|
||||
# [*keystone_username*]
|
||||
# (Optional) Username for murano credentials
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (Required) Password for murano credentials
|
||||
# Defaults to false
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (Optional) Tenant for keystone_username
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*keystone_region*]
|
||||
# (Optional) Region for keystone
|
||||
# Defaults to 'RegionOne'
|
||||
#
|
||||
# [*keystone_uri*]
|
||||
# (Optional) Public identity endpoint
|
||||
# Defaults to 'http://127.0.0.1:5000/v2.0/'
|
||||
#
|
||||
# [*keystone_signing_dir*]
|
||||
# (Optional) Directory used to cache files related to PKI tokens
|
||||
# Defaults to '/tmp/keystone-signing-muranoapi'
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (Optional) Admin identity endpoint
|
||||
# Defaults to 'http://127.0.0.1:35357/'#
|
||||
#
|
||||
# [*use_neutron*]
|
||||
# (Optional) Whether to use neutron
|
||||
# Defaults to false
|
||||
#
|
||||
# [*external_network*]
|
||||
# (Optional) Name of the external Neutron network
|
||||
# which will be use by Murano
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*default_router*]
|
||||
# (Optional) Router name for Murano networks
|
||||
# Defaults to 'murano-default-router'
|
||||
#
|
||||
class murano(
|
||||
$keystone_password,
|
||||
$package_ensure = 'present',
|
||||
$verbose = false,
|
||||
$debug = false,
|
||||
$use_syslog = false,
|
||||
$use_stderr = true,
|
||||
$log_facility = 'LOG_LOCAL0',
|
||||
$log_dir = '/var/log/murano',
|
||||
$data_dir = '/var/cache/murano',
|
||||
$notification_driver = 'messagingv2',
|
||||
$rabbit_os_hosts = ['127.0.0.1:5672'],
|
||||
$rabbit_os_port = '5672',
|
||||
$rabbit_os_user = 'guest',
|
||||
$rabbit_os_password = 'guest',
|
||||
$rabbit_ha_queues = false,
|
||||
$rabbit_own_host = '127.0.0.1',
|
||||
$rabbit_own_port = '5672',
|
||||
$rabbit_own_user = 'guest',
|
||||
$rabbit_own_password = 'guest',
|
||||
$service_host = '127.0.0.1',
|
||||
$service_port = '8082',
|
||||
$database_connection = 'mysql://murano:secrete@localhost:3306/murano',
|
||||
$keystone_username = 'admin',
|
||||
$keystone_tenant = 'admin',
|
||||
$keystone_region = 'RegionOne',
|
||||
$keystone_uri = 'http://127.0.0.1:5000/v2.0/',
|
||||
$keystone_signing_dir = '/tmp/keystone-signing-muranoapi',
|
||||
$identity_uri = 'http://127.0.0.1:35357/',
|
||||
$use_neutron = false,
|
||||
$external_network = undef,
|
||||
$default_router = 'murano-default-router',
|
||||
) {
|
||||
|
||||
include ::murano::params
|
||||
include ::murano::policy
|
||||
|
||||
validate_string($keystone_password)
|
||||
|
||||
package { 'murano-common':
|
||||
ensure => $package_ensure,
|
||||
name => $::murano::params::common_package_name,
|
||||
tag => ['openstack'],
|
||||
}
|
||||
|
||||
validate_re($database_connection, '(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
case $database_connection {
|
||||
/^mysql:\/\//: {
|
||||
require mysql::bindings
|
||||
require mysql::bindings::python
|
||||
}
|
||||
/^postgresql:\/\//: {
|
||||
require postgresql::lib::python
|
||||
}
|
||||
/^sqlite:\/\//: {
|
||||
fail('murano does not support sqlite!')
|
||||
}
|
||||
default: {
|
||||
fail('Unsupported db backend configured')
|
||||
}
|
||||
}
|
||||
|
||||
if $use_syslog {
|
||||
murano_config {
|
||||
'DEFAULT/use_syslog' : value => true;
|
||||
'DEFAULT/use_syslog_rfc_format': value => true;
|
||||
'DEFAULT/syslog_log_facility' : value => $log_facility;
|
||||
}
|
||||
}
|
||||
|
||||
if $use_neutron {
|
||||
if $external_network {
|
||||
$neutron_external_network = $external_network
|
||||
} else {
|
||||
$neutron_external_network = $::murano::params::default_external_network
|
||||
}
|
||||
|
||||
murano_config {
|
||||
'networking/external_network' : value => $neutron_external_network;
|
||||
'networking/router_name' : value => $default_router;
|
||||
'networking/create_router' : value => true;
|
||||
}
|
||||
}
|
||||
|
||||
murano_config {
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/log_dir' : value => $log_dir;
|
||||
'DEFAULT/notification_driver' : value => $notification_driver;
|
||||
|
||||
'murano/url' : value => "http://${service_host}:${service_port}";
|
||||
|
||||
'database/connection' : value => $database_connection;
|
||||
|
||||
'oslo_messaging_rabbit/rabbit_userid' : value => $rabbit_os_user;
|
||||
'oslo_messaging_rabbit/rabbit_password' : value => $rabbit_os_password;
|
||||
'oslo_messaging_rabbit/rabbit_hosts' : value => join($rabbit_os_hosts, ',');
|
||||
'oslo_messaging_rabbit/rabbit_port' : value => $rabbit_os_port;
|
||||
'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues;
|
||||
|
||||
'rabbitmq/login' : value => $rabbit_own_user;
|
||||
'rabbitmq/password' : value => $rabbit_own_password;
|
||||
'rabbitmq/host' : value => $rabbit_own_host;
|
||||
'rabbitmq/port' : value => $rabbit_own_port;
|
||||
}
|
||||
|
||||
murano_config {
|
||||
'keystone_authtoken/auth_uri' : value => $keystone_uri;
|
||||
'keystone_authtoken/admin_user' : value => $keystone_username;
|
||||
'keystone_authtoken/admin_tenant_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/admin_password' : value => $keystone_password;
|
||||
'keystone_authtoken/signing_dir' : value => $keystone_signing_dir;
|
||||
'keystone_authtoken/identity_uri' : value => $identity_uri;
|
||||
}
|
||||
|
||||
exec { 'murano-dbmanage':
|
||||
command => $::murano::params::dbmanage_command,
|
||||
path => '/usr/bin',
|
||||
user => 'murano',
|
||||
refreshonly => true,
|
||||
subscribe => [Package['murano-common'], Murano_config['database/connection']],
|
||||
logoutput => on_failure,
|
||||
}
|
||||
}
|
|
@ -1,217 +0,0 @@
|
|||
# == Class: murano::keystone::auth
|
||||
#
|
||||
# Configures murano service and endpoint in Keystone.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*password*]
|
||||
# (required) Password for murano user.
|
||||
#
|
||||
# [*service_name*]
|
||||
# (Optional) Name of the service.
|
||||
# Defaults to the value of auth_name.
|
||||
#
|
||||
# [*auth_name*]
|
||||
# (Optional) Username for murano service.
|
||||
# Defaults to 'murano'.
|
||||
#
|
||||
# [*email*]
|
||||
# (Optional) Email for murano user.
|
||||
# Defaults to 'murano@localhost'.
|
||||
#
|
||||
# [*tenant*]
|
||||
# (Optional) Tenant for murano user.
|
||||
# Defaults to 'services'.
|
||||
#
|
||||
# [*configure_endpoint*]
|
||||
# (Optional) Should murano endpoint be configured?
|
||||
# Defaults to 'true'.
|
||||
#
|
||||
# [*service_type*]
|
||||
# (Optional) Type of service.
|
||||
# Defaults to 'application-catalog'.
|
||||
#
|
||||
# [*service_description*]
|
||||
# (Optional) Description of service.
|
||||
# Defaults to 'Murano Application Catalog'.
|
||||
#
|
||||
# [*region*]
|
||||
# (Optional) Region for endpoint.
|
||||
# Defaults to 'RegionOne'.
|
||||
#
|
||||
# [*public_url*]
|
||||
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:8082
|
||||
# This url should *not* contain any trailing '/'.
|
||||
#
|
||||
# [*admin_url*]
|
||||
# (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:8082
|
||||
# This url should *not* contain any trailing '/'.
|
||||
#
|
||||
# [*internal_url*]
|
||||
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:8082
|
||||
# This url should *not* contain any trailing '/'.
|
||||
#
|
||||
# [*version*]
|
||||
# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
|
||||
# API version endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
|
||||
#
|
||||
# [*port*]
|
||||
# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
|
||||
# Default port for endpoints. (Defaults to 'undef')
|
||||
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
|
||||
#
|
||||
# [*public_port*]
|
||||
# (optional) DEPRECATED: Use public_url instead.
|
||||
# Default port for endpoints. (Defaults to 'undef')
|
||||
# Setting this parameter overrides public_url parameter.
|
||||
#
|
||||
# [*public_protocol*]
|
||||
# (optional) DEPRECATED: Use public_url instead.
|
||||
# Protocol for public endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides public_url parameter.
|
||||
#
|
||||
# [*public_address*]
|
||||
# (optional) DEPRECATED: Use public_url instead.
|
||||
# Public address for endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides public_url parameter.
|
||||
#
|
||||
# [*internal_protocol*]
|
||||
# (optional) DEPRECATED: Use internal_url instead.
|
||||
# Protocol for internal endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides internal_url parameter.
|
||||
#
|
||||
# [*internal_address*]
|
||||
# (optional) DEPRECATED: Use internal_url instead.
|
||||
# Internal address for endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides internal_url parameter.
|
||||
#
|
||||
# [*admin_protocol*]
|
||||
# (optional) DEPRECATED: Use admin_url instead.
|
||||
# Protocol for admin endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides admin_url parameter.
|
||||
#
|
||||
# [*admin_address*]
|
||||
# (optional) DEPRECATED: Use admin_url instead.
|
||||
# Admin address for endpoint. (Defaults to 'undef')
|
||||
# Setting this parameter overrides admin_url parameter.
|
||||
#
|
||||
# === Deprecation notes
|
||||
#
|
||||
# If any value is provided for public_protocol, public_address or port parameters,
|
||||
# public_url will be completely ignored. The same applies for internal and admin parameters.
|
||||
#
|
||||
# === Examples
|
||||
#
|
||||
# class { 'murano::keystone::auth':
|
||||
# public_url => 'https://10.0.0.10:8082',
|
||||
# internal_url => 'https://10.0.0.11:8082',
|
||||
# admin_url => 'https://10.0.0.11:8082',
|
||||
# }
|
||||
#
|
||||
class murano::keystone::auth(
|
||||
$password,
|
||||
$service_name = undef,
|
||||
$auth_name = 'murano',
|
||||
$email = 'murano@localhost',
|
||||
$tenant = 'services',
|
||||
$service_type = 'application_catalog',
|
||||
$service_description = 'Murano Application Catalog',
|
||||
$configure_endpoint = true,
|
||||
$region = 'RegionOne',
|
||||
$public_url = 'http://127.0.0.1:8082',
|
||||
$admin_url = 'http://127.0.0.1:8082',
|
||||
$internal_url = 'http://127.0.0.1:8082',
|
||||
# DEPRECATED PARAMETERS
|
||||
$version = undef,
|
||||
$port = undef,
|
||||
$public_port = undef,
|
||||
$public_protocol = undef,
|
||||
$public_address = undef,
|
||||
$public_port = undef,
|
||||
$internal_protocol = undef,
|
||||
$internal_address = undef,
|
||||
$admin_protocol = undef,
|
||||
$admin_address = undef,
|
||||
) {
|
||||
|
||||
if $version {
|
||||
warning('The version parameter is deprecated, use public_url, internal_url and admin_url instead.')
|
||||
}
|
||||
|
||||
if $port {
|
||||
warning('The port parameter is deprecated, use public_url, internal_url and admin_url instead.')
|
||||
}
|
||||
|
||||
if $public_port {
|
||||
warning('The public_port parameter is deprecated, use public_url instead.')
|
||||
}
|
||||
|
||||
if $public_protocol {
|
||||
warning('The public_protocol parameter is deprecated, use public_url instead.')
|
||||
}
|
||||
|
||||
if $internal_protocol {
|
||||
warning('The internal_protocol parameter is deprecated, use internal_url instead.')
|
||||
}
|
||||
|
||||
if $admin_protocol {
|
||||
warning('The admin_protocol parameter is deprecated, use admin_url instead.')
|
||||
}
|
||||
|
||||
if $public_address {
|
||||
warning('The public_address parameter is deprecated, use public_url instead.')
|
||||
}
|
||||
|
||||
if $internal_address {
|
||||
warning('The internal_address parameter is deprecated, use internal_url instead.')
|
||||
}
|
||||
|
||||
if $admin_address {
|
||||
warning('The admin_address parameter is deprecated, use admin_url instead.')
|
||||
}
|
||||
|
||||
if ($public_protocol or $public_address or $port or $public_port or $version) {
|
||||
$public_url_real = sprintf('%s://%s:%s',
|
||||
pick($public_protocol, 'http'),
|
||||
pick($public_address, '127.0.0.1'),
|
||||
pick($public_port, $port, '8082'))
|
||||
} else {
|
||||
$public_url_real = $public_url
|
||||
}
|
||||
|
||||
if ($admin_protocol or $admin_address or $port or $version) {
|
||||
$admin_url_real = sprintf('%s://%s:%s',
|
||||
pick($admin_protocol, 'http'),
|
||||
pick($admin_address, '127.0.0.1'),
|
||||
pick($port, '8082'))
|
||||
} else {
|
||||
$admin_url_real = $admin_url
|
||||
}
|
||||
|
||||
if ($internal_protocol or $internal_address or $port or $version) {
|
||||
$internal_url_real = sprintf('%s://%s:%s',
|
||||
pick($internal_protocol, 'http'),
|
||||
pick($internal_address, '127.0.0.1'),
|
||||
pick($port, '8082'))
|
||||
} else {
|
||||
$internal_url_real = $internal_url
|
||||
}
|
||||
|
||||
$real_service_name = pick($service_name, $auth_name)
|
||||
|
||||
keystone::resource::service_identity { $real_service_name:
|
||||
configure_user => true,
|
||||
configure_user_role => true,
|
||||
configure_endpoint => $configure_endpoint,
|
||||
service_type => $service_type,
|
||||
service_description => $service_description,
|
||||
region => $region,
|
||||
password => $password,
|
||||
email => $email,
|
||||
tenant => $tenant,
|
||||
public_url => $public_url_real,
|
||||
admin_url => $admin_url_real,
|
||||
internal_url => $internal_url_real,
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
# == Class: murano::params
|
||||
#
|
||||
# Parameters for puppet-murano
|
||||
#
|
||||
class murano::params {
|
||||
$dbmanage_command = 'murano-db-manage --config-file /etc/murano/murano.conf upgrade'
|
||||
$default_external_network = 'public'
|
||||
$rabbit_service_name = 'rabbit-server-murano'
|
||||
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
# package names
|
||||
$api_package_name = 'openstack-murano-api'
|
||||
$common_package_name = 'openstack-murano-common'
|
||||
$engine_package_name = 'openstack-murano-engine'
|
||||
$pythonclient_package_name = 'openstack-python-muranoclient'
|
||||
$dashboard_package_name = 'openstack-murano-dashboard'
|
||||
# service names
|
||||
$api_service_name = 'murano-api'
|
||||
$engine_service_name = 'murano-engine'
|
||||
# dashboard config file
|
||||
$local_settings_path = '/etc/openstack-dashboard/local_settings'
|
||||
# rabbitmq init params
|
||||
$init_script_file = 'rabbitmq-init-centos.erb'
|
||||
$init_install_cmd = "chkconfig --add '/etc/init.d/${rabbit_service_name}'"
|
||||
}
|
||||
'Debian': {
|
||||
# package names
|
||||
$api_package_name = 'murano-api'
|
||||
$common_package_name = 'murano-common'
|
||||
$engine_package_name = 'murano-engine'
|
||||
$pythonclient_package_name = 'python-muranoclient'
|
||||
$dashboard_package_name = 'murano-dashboard'
|
||||
# service names
|
||||
$api_service_name = 'murano-api'
|
||||
$engine_service_name = 'murano-engine'
|
||||
# dashboard config file
|
||||
$local_settings_path = '/etc/openstack-dashboard/local_settings.py'
|
||||
# rabbitmq init params
|
||||
$init_script_file = 'rabbitmq-init-ubuntu.erb'
|
||||
$init_install_cmd = "update-rc.d '${rabbit_service_name}' defaults"
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
# == Class: murano::policy
|
||||
#
|
||||
# Configure the murano policies
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*policies*]
|
||||
# (optional) Set of policies to configure for murano
|
||||
# Defaults to empty hash.
|
||||
#
|
||||
# [*policy_path*]
|
||||
# (optional) Path to the murano policy.json file
|
||||
# Defaults to /etc/murano/policy.json
|
||||
#
|
||||
class murano::policy (
|
||||
$policies = {},
|
||||
$policy_path = '/etc/murano/policy.json',
|
||||
) {
|
||||
|
||||
validate_hash($policies)
|
||||
|
||||
Openstacklib::Policy::Base {
|
||||
file_path => $policy_path,
|
||||
}
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
# == Class: murano::rabbitmq
|
||||
#
|
||||
# murano rabbitmq configuration
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*rabbit_user*]
|
||||
# (Optional)
|
||||
# Defaults to 'murano'
|
||||
#
|
||||
# [*rabbit_password*]
|
||||
# (Optional)
|
||||
# Defaults to 'murano'
|
||||
#
|
||||
# [*rabbit_vhost*]
|
||||
# (Optional)
|
||||
# Defaults to '/'
|
||||
#
|
||||
# [*rabbit_port*]
|
||||
# (Optional)
|
||||
# Defaults to '55572'
|
||||
#
|
||||
# [*rabbit_cluster_port*]
|
||||
# (Optional)
|
||||
# Defaults to '41056'
|
||||
#
|
||||
# [*rabbit_node_name*]
|
||||
# (Optional)
|
||||
# Defaults to 'murano@localhost'
|
||||
#
|
||||
# [*rabbit_config_path*]
|
||||
# (Optional)
|
||||
# Defaults to '/etc/rabbitmq/rabbitmq-murano.config'
|
||||
#
|
||||
# [*firewall_rule_name*]
|
||||
# (Optional)
|
||||
# Defaults to '203 murano-rabbitmq'
|
||||
#
|
||||
class murano::rabbitmq(
|
||||
$rabbit_user = 'murano',
|
||||
$rabbit_password = 'murano',
|
||||
$rabbit_vhost = '/',
|
||||
$rabbit_port = '55572',
|
||||
$rabbit_cluster_port = '41056',
|
||||
$rabbit_node_name = 'murano@localhost',
|
||||
$rabbit_config_path = '/etc/rabbitmq/rabbitmq-murano.config',
|
||||
$firewall_rule_name = '203 murano-rabbitmq',
|
||||
) {
|
||||
|
||||
include ::rabbitmq::params
|
||||
|
||||
ensure_packages([$rabbitmq::params::package_name],
|
||||
{
|
||||
ensure => $rabbitmq::params::package_ensure,
|
||||
provider => $rabbitmq::params::package_provider,
|
||||
before => File['rabbitmq_config'],
|
||||
}
|
||||
)
|
||||
|
||||
file { 'rabbitmq_config' :
|
||||
path => $rabbit_config_path,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template('murano/rabbitmq.config.erb'),
|
||||
}
|
||||
|
||||
file { 'init_script' :
|
||||
path => "/etc/init.d/${::murano::params::rabbit_service_name}",
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
content => template("murano/${::murano::params::init_script_file}"),
|
||||
}
|
||||
|
||||
exec { 'install_init_script' :
|
||||
command => $::murano::params::init_install_cmd,
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
unless => "test -f /etc/init.d/${::murano::params::rabbit_service_name}"
|
||||
}
|
||||
|
||||
service { 'rabbitmq-server-murano' :
|
||||
ensure => 'running',
|
||||
name => $::murano::params::rabbit_service_name,
|
||||
enable => true,
|
||||
}
|
||||
|
||||
firewall { $firewall_rule_name :
|
||||
dport => [ $rabbit_port ],
|
||||
proto => 'tcp',
|
||||
action => 'accept',
|
||||
}
|
||||
|
||||
if $rabbit_user == 'guest' {
|
||||
fail('Murano user should not be guest!')
|
||||
}
|
||||
|
||||
# evil hack to workaround resource duplication restrictions between main and Murano RabbitMQ instances
|
||||
# and other problems that doesn't allow me to use Puppet resources here
|
||||
# passing variables from nailgun to exec can theoretically allow shell injection attacks
|
||||
# well... but if you can pass variables to nailgun you already can do anything you want anyway
|
||||
|
||||
exec { 'remove_murano_guest' :
|
||||
command => "rabbitmqctl -n '${rabbit_node_name}' delete_user guest",
|
||||
onlyif => "rabbitmqctl -n '${rabbit_node_name}' list_users | grep -qE '^guest\\s*\\['",
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
}
|
||||
|
||||
exec { 'create_murano_user' :
|
||||
command => "rabbitmqctl -n '${rabbit_node_name}' add_user '${rabbit_user}' '${rabbit_password}'",
|
||||
unless => "rabbitmqctl -n '${rabbit_node_name}' list_users | grep -qE '^${rabbit_user}\\s*\\['",
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
}
|
||||
|
||||
exec { 'create_murano_vhost' :
|
||||
command => "rabbitmqctl -n '${rabbit_node_name}' add_vhost '${rabbit_vhost}'",
|
||||
unless => "rabbitmqctl -n '${rabbit_node_name}' list_vhosts | grep -qE '^${rabbit_vhost}$'",
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
}
|
||||
|
||||
exec { 'set_murano_user_permissions' :
|
||||
command => "rabbitmqctl -n '${rabbit_node_name}' set_permissions -p '${rabbit_vhost}' '${rabbit_user}' '.*' '.*' '.*'",
|
||||
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
||||
}
|
||||
|
||||
File['rabbitmq_config'] ->
|
||||
File['init_script'] ->
|
||||
Exec['install_init_script'] ->
|
||||
Service['rabbitmq-server-murano']
|
||||
|
||||
Firewall[$firewall_rule_name] -> Service['rabbitmq-server-murano']
|
||||
File['rabbitmq_config'] ~> Service['rabbitmq-server-murano']
|
||||
File['init_script'] ~> Service['rabbitmq-server-murano']
|
||||
|
||||
Service['rabbitmq-server-murano'] ->
|
||||
Exec['remove_murano_guest'] ->
|
||||
Exec['create_murano_user'] ->
|
||||
Exec['create_murano_vhost'] ->
|
||||
Exec['set_murano_user_permissions']
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
{
|
||||
"name": "openstack-murano",
|
||||
"version": "1.0.0",
|
||||
"author": "Mirantis Inc.",
|
||||
"summary": "Puppet module for OpenStack Murano",
|
||||
"license": "Apache-2.0",
|
||||
"source": "git://github.com/openstack/puppet-murano.git",
|
||||
"project_page": "https://launchpad.net/puppet-murano",
|
||||
"issues_url": "https://bugs.launchpad.net/puppet-murano",
|
||||
"requirements": [
|
||||
{ "name": "pe","version_requirement": "3.x" },
|
||||
{ "name": "puppet","version_requirement": "3.x" }
|
||||
],
|
||||
"operatingsystem_support": [
|
||||
{
|
||||
"operatingsystem": "Fedora",
|
||||
"operatingsystemrelease": ["20"]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "RedHat",
|
||||
"operatingsystemrelease": ["7"]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "Debian",
|
||||
"operatingsystemrelease": ["8"]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "Ubuntu",
|
||||
"operatingsystemrelease": ["12.04","14.04"]
|
||||
}
|
||||
],
|
||||
"description": "Installs and configures OpenStack Murano (Application Catalog).",
|
||||
"dependencies": [
|
||||
{ "name": "puppetlabs/inifile", "version_requirement": ">=1.0.0 <2.0.0" },
|
||||
{ "name": "openstack/keystone", "version_requirement": ">=6.0.0 <7.0.0" },
|
||||
{ "name": "puppetlabs/stdlib", "version_requirement": ">=4.0.0 <5.0.0" },
|
||||
{ "name": "openstack/openstacklib", "version_requirement": ">=6.0.0 <7.0.0" }
|
||||
]
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'get_ext_net_name' do
|
||||
let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
|
||||
|
||||
it 'should exist' do
|
||||
Puppet::Parser::Functions.function('get_ext_net_name').should == 'function_get_ext_net_name'
|
||||
end
|
||||
|
||||
it 'should return the network name that has router_ext enabled' do
|
||||
expect(scope.function_get_ext_net_name(
|
||||
[
|
||||
{
|
||||
"net04" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
"router_ext" => false,
|
||||
}
|
||||
},
|
||||
"net04_ext" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
"router_ext" => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
)).to eq 'net04_ext'
|
||||
end
|
||||
|
||||
it 'should return nil if router_ext is not enabled' do
|
||||
expect(scope.function_get_ext_net_name(
|
||||
[
|
||||
{
|
||||
"net04" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
"router_ext" => false,
|
||||
}
|
||||
},
|
||||
"net04_ext" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
"router_ext" => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
)).to be_nil
|
||||
end
|
||||
|
||||
it 'should return nil if there is no router_ext' do
|
||||
expect(scope.function_get_ext_net_name(
|
||||
[
|
||||
{
|
||||
"net04" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
}
|
||||
},
|
||||
"net04_ext" =>
|
||||
{
|
||||
"L2" =>
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
)).to be_nil
|
||||
end
|
||||
|
||||
it 'should return nil with empty network data' do
|
||||
expect(scope.function_get_ext_net_name(
|
||||
[
|
||||
{}
|
||||
]
|
||||
)).to be_nil
|
||||
end
|
||||
|
||||
end
|
|
@ -1 +0,0 @@
|
|||
require 'puppetlabs_spec_helper/module_spec_helper'
|
|
@ -1,33 +0,0 @@
|
|||
$LOAD_PATH.push(
|
||||
File.join(
|
||||
File.dirname(__FILE__),
|
||||
'..',
|
||||
'..',
|
||||
'..',
|
||||
'fixtures',
|
||||
'modules',
|
||||
'inifile',
|
||||
'lib')
|
||||
)
|
||||
require 'spec_helper'
|
||||
provider_class = Puppet::Type.type(:murano_config).provider(:ini_setting)
|
||||
describe provider_class do
|
||||
|
||||
it 'should default to the default setting when no other one is specified' do
|
||||
resource = Puppet::Type::Murano_config.new(
|
||||
{:name => 'DEFAULT/foo', :value => 'bar'}
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.section).to eq('DEFAULT')
|
||||
expect(provider.setting).to eq('foo')
|
||||
end
|
||||
|
||||
it 'should allow setting to be set explicitly' do
|
||||
resource = Puppet::Type::Murano_config.new(
|
||||
{:name => 'dude/whoa', :value => 'bar'}
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.section).to eq('dude')
|
||||
expect(provider.setting).to eq('whoa')
|
||||
end
|
||||
end
|
|
@ -1,33 +0,0 @@
|
|||
$LOAD_PATH.push(
|
||||
File.join(
|
||||
File.dirname(__FILE__),
|
||||
'..',
|
||||
'..',
|
||||
'..',
|
||||
'fixtures',
|
||||
'modules',
|
||||
'inifile',
|
||||
'lib')
|
||||
)
|
||||
require 'spec_helper'
|
||||
provider_class = Puppet::Type.type(:murano_paste_ini_config).provider(:ini_setting)
|
||||
describe provider_class do
|
||||
|
||||
it 'should default to the default setting when no other one is specified' do
|
||||
resource = Puppet::Type::Murano_paste_ini_config.new(
|
||||
{:name => 'DEFAULT/foo', :value => 'bar'}
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.section).to eq('DEFAULT')
|
||||
expect(provider.setting).to eq('foo')
|
||||
end
|
||||
|
||||
it 'should allow setting to be set explicitly' do
|
||||
resource = Puppet::Type::Murano_paste_ini_config.new(
|
||||
{:name => 'dude/whoa', :value => 'bar'}
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
expect(provider.section).to eq('dude')
|
||||
expect(provider.setting).to eq('whoa')
|
||||
end
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
require 'puppet'
|
||||
require 'puppet/type/murano_config'
|
||||
describe 'Puppet::Type.type(:murano_config)' do
|
||||
before :each do
|
||||
@murano_config = Puppet::Type.type(:murano_config).new(:name => 'DEFAULT/foo', :value => 'bar')
|
||||
end
|
||||
|
||||
it 'should require a name' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_config).new({})
|
||||
}.to raise_error(Puppet::Error, 'Title or name must be provided')
|
||||
end
|
||||
|
||||
it 'should not expect a name with whitespace' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_config).new(:name => 'f oo')
|
||||
}.to raise_error(Puppet::Error, /Parameter name failed/)
|
||||
end
|
||||
|
||||
it 'should fail when there is no section' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_config).new(:name => 'foo')
|
||||
}.to raise_error(Puppet::Error, /Parameter name failed/)
|
||||
end
|
||||
|
||||
it 'should not require a value when ensure is absent' do
|
||||
Puppet::Type.type(:murano_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
|
||||
end
|
||||
|
||||
it 'should accept a valid value' do
|
||||
@murano_config[:value] = 'bar'
|
||||
expect(@murano_config[:value]).to eq('bar')
|
||||
end
|
||||
|
||||
it 'should not accept a value with whitespace' do
|
||||
@murano_config[:value] = 'b ar'
|
||||
expect(@murano_config[:value]).to eq('b ar')
|
||||
end
|
||||
|
||||
it 'should accept valid ensure values' do
|
||||
@murano_config[:ensure] = :present
|
||||
expect(@murano_config[:ensure]).to eq(:present)
|
||||
@murano_config[:ensure] = :absent
|
||||
expect(@murano_config[:ensure]).to eq(:absent)
|
||||
end
|
||||
|
||||
it 'should not accept invalid ensure values' do
|
||||
expect {
|
||||
@murano_config[:ensure] = :latest
|
||||
}.to raise_error(Puppet::Error, /Invalid value/)
|
||||
end
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
require 'puppet'
|
||||
require 'puppet/type/murano_paste_ini_config'
|
||||
describe 'Puppet::Type.type(:murano_paste_ini_config)' do
|
||||
before :each do
|
||||
@murano_paste_ini_config = Puppet::Type.type(:murano_paste_ini_config).new(:name => 'DEFAULT/foo', :value => 'bar')
|
||||
end
|
||||
|
||||
it 'should require a name' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_paste_ini_config).new({})
|
||||
}.to raise_error(Puppet::Error, 'Title or name must be provided')
|
||||
end
|
||||
|
||||
it 'should not expect a name with whitespace' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_paste_ini_config).new(:name => 'f oo')
|
||||
}.to raise_error(Puppet::Error, /Parameter name failed/)
|
||||
end
|
||||
|
||||
it 'should fail when there is no section' do
|
||||
expect {
|
||||
Puppet::Type.type(:murano_paste_ini_config).new(:name => 'foo')
|
||||
}.to raise_error(Puppet::Error, /Parameter name failed/)
|
||||
end
|
||||
|
||||
it 'should not require a value when ensure is absent' do
|
||||
Puppet::Type.type(:murano_paste_ini_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
|
||||
end
|
||||
|
||||
it 'should accept a valid value' do
|
||||
@murano_paste_ini_config[:value] = 'bar'
|
||||
expect(@murano_paste_ini_config[:value]).to eq('bar')
|
||||
end
|
||||
|
||||
it 'should not accept a value with whitespace' do
|
||||
@murano_paste_ini_config[:value] = 'b ar'
|
||||
expect(@murano_paste_ini_config[:value]).to eq('b ar')
|
||||
end
|
||||
|
||||
it 'should accept valid ensure values' do
|
||||
@murano_paste_ini_config[:ensure] = :present
|
||||
expect(@murano_paste_ini_config[:ensure]).to eq(:present)
|
||||
@murano_paste_ini_config[:ensure] = :absent
|
||||
expect(@murano_paste_ini_config[:ensure]).to eq(:absent)
|
||||
end
|
||||
|
||||
it 'should not accept invalid ensure values' do
|
||||
expect {
|
||||
@murano_paste_ini_config[:ensure] = :latest
|
||||
}.to raise_error(Puppet::Error, /Invalid value/)
|
||||
end
|
||||
end
|
|
@ -1,182 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# rabbitmq-server Murano RabbitMQ broker
|
||||
#
|
||||
# chkconfig: - 80 05
|
||||
# description: Enable AMQP service provided by RabbitMQ
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rabbitmq-server
|
||||
# Required-Start: $remote_fs $network
|
||||
# Required-Stop: $remote_fs $network
|
||||
# Description: RabbitMQ broker
|
||||
# Short-Description: Enable AMQP service provided by RabbitMQ broker for Murano
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
|
||||
NAME="rabbitmq-server-murano"
|
||||
DAEMON="/usr/sbin/rabbitmq-server"
|
||||
CONTROL="/usr/sbin/rabbitmqctl"
|
||||
DESC="Murano RabbitMQ Server"
|
||||
USER="rabbitmq"
|
||||
ROTATE_SUFFIX=".old"
|
||||
|
||||
export RABBITMQ_LOG_DIR="/var/log/rabbitmq"
|
||||
export RABBITMQ_PID_FILE="/var/run/rabbitmq-murano/pid"
|
||||
export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq-murano"
|
||||
export RABBITMQ_MNESIA_BASE="/var/lib/rabbitmq/mnesia-murano"
|
||||
export RABBITMQ_LOG_BASE="/var/log/rabbitmq-murano"
|
||||
export RABBITMQ_ENABLED_PLUGINS_FILE="/etc/rabbitmq/enabled_plugins_murano"
|
||||
export RABBITMQ_NODENAME="murano@localhost"
|
||||
export RABBITMQ_NODE_PORT="<%= @rabbit_port %>"
|
||||
export RABBITMQ_NODE_IP_ADDRESS="0.0.0.0"
|
||||
|
||||
START_PROG="runuser rabbitmq --session-command"
|
||||
LOCK_FILE="/var/lock/subsys/${NAME}"
|
||||
|
||||
test -x "${DAEMON}" || exit 0
|
||||
test -x "${CONTROL}" || exit 0
|
||||
|
||||
CONTROL="${CONTROL} -n ${RABBITMQ_NODENAME}"
|
||||
|
||||
RETVAL="0"
|
||||
|
||||
[ -f /etc/default/${NAME} ] && . /etc/default/${NAME}
|
||||
|
||||
check_dir () {
|
||||
mkdir -p "${1}"
|
||||
chown -R "${USER}:${USER}" "${1}"
|
||||
chmod "755" "${1}"
|
||||
}
|
||||
|
||||
ensure_dirs () {
|
||||
PID_DIR=`dirname ${RABBITMQ_PID_FILE}`
|
||||
check_dir "${PID_DIR}"
|
||||
check_dir "${RABBITMQ_LOG_DIR}"
|
||||
check_dir "${RABBITMQ_LOG_BASE}"
|
||||
check_dir "${RABBITMQ_MNESIA_BASE}"
|
||||
}
|
||||
|
||||
remove_pid () {
|
||||
rm -f "${RABBITMQ_PID_FILE}"
|
||||
}
|
||||
|
||||
start_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" = "0" ] ; then
|
||||
echo "Murano RabbitMQ is currently running!"
|
||||
RETVAL="0"
|
||||
return
|
||||
fi
|
||||
|
||||
ensure_dirs
|
||||
${START_PROG} "${DAEMON}" 1> "${RABBITMQ_LOG_BASE}/startup_log" 2> "${RABBITMQ_LOG_BASE}/startup_err" 0<&- &
|
||||
${CONTROL} wait "${RABBITMQ_PID_FILE}" 1> "/dev/null" 2>&1
|
||||
RETVAL="${?}"
|
||||
|
||||
if [ "${RETVAL}" -gt "0" ]; then
|
||||
remove_pid
|
||||
echo "Murano RabbitMQ start FAILED!"
|
||||
RETVAL="1"
|
||||
else
|
||||
echo "Murano RabbitMQ start SUCCESS!"
|
||||
if [ -n "${LOCK_FILE}" ]; then
|
||||
touch "${LOCK_FILE}"
|
||||
fi
|
||||
RETVAL="0"
|
||||
fi
|
||||
}
|
||||
|
||||
stop_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" != 0 ]; then
|
||||
echo "RabbitMQ is not running!"
|
||||
RETVAL="0"
|
||||
return
|
||||
fi
|
||||
|
||||
${CONTROL} stop "${RABBITMQ_PID_FILE}" > "${RABBITMQ_LOG_BASE}/shutdown_log" 2> "${RABBITMQ_LOG_BASE}/shutdown_err"
|
||||
RETVAL="${?}"
|
||||
|
||||
if [ "${RETVAL}" = "0" ] ; then
|
||||
remove_pid
|
||||
echo "Murano RabbitMQ stop SUCCESS!"
|
||||
if [ -n "{$LOCK_FILE}" ] ; then
|
||||
rm -f "${LOCK_FILE}"
|
||||
fi
|
||||
RETVAL="0"
|
||||
else
|
||||
echo "Murano RabbitMQ stop FAILED!"
|
||||
RETVAL="1"
|
||||
fi
|
||||
}
|
||||
|
||||
status_rabbitmq () {
|
||||
if [ "${1}" != "quiet" ] ; then
|
||||
${CONTROL} status 2>&1
|
||||
else
|
||||
${CONTROL} status > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ "${?}" != "0" ]; then
|
||||
RETVAL="3"
|
||||
fi
|
||||
}
|
||||
|
||||
rotate_logs_rabbitmq () {
|
||||
${CONTROL} rotate_logs "${ROTATE_SUFFIX}"
|
||||
if [ $? != 0 ]; then
|
||||
RETVAL="1"
|
||||
fi
|
||||
}
|
||||
|
||||
restart_running_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" != "0" ]; then
|
||||
echo "RabbitMQ is not runnning!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
restart_rabbitmq
|
||||
}
|
||||
|
||||
restart_rabbitmq () {
|
||||
stop_rabbitmq
|
||||
start_rabbitmq
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
echo "Starting $DESC"
|
||||
start_rabbitmq
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping $DESC"
|
||||
stop_rabbitmq
|
||||
;;
|
||||
status)
|
||||
status_rabbitmq
|
||||
;;
|
||||
rotate-logs)
|
||||
echo "Rotating log files for $DESC"
|
||||
rotate_logs_rabbitmq
|
||||
;;
|
||||
force-reload|reload|restart)
|
||||
echo "Restarting $DESC"
|
||||
restart_rabbitmq
|
||||
;;
|
||||
try-restart)
|
||||
echo "Restarting $DESC"
|
||||
restart_running_rabbitmq
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit "${RETVAL}"
|
|
@ -1,231 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# rabbitmq-server Murano RabbitMQ broker
|
||||
#
|
||||
# chkconfig: - 80 05
|
||||
# description: Enable AMQP service provided by RabbitMQ
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rabbitmq-server
|
||||
# Required-Start: $remote_fs $network
|
||||
# Required-Stop: $remote_fs $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Description: RabbitMQ broker
|
||||
# Short-Description: Enable AMQP service provided by RabbitMQ broker for Murano
|
||||
### END INIT INFO
|
||||
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
|
||||
NAME="rabbitmq-server-murano"
|
||||
DAEMON="/usr/sbin/rabbitmq-server"
|
||||
CONTROL="/usr/sbin/rabbitmqctl"
|
||||
DESC="Murano RabbitMQ Server"
|
||||
USER="rabbitmq"
|
||||
ROTATE_SUFFIX=".old"
|
||||
|
||||
export RABBITMQ_LOG_DIR="/var/log/rabbitmq"
|
||||
export RABBITMQ_PID_FILE="/var/run/rabbitmq-murano/pid"
|
||||
export RABBITMQ_CONFIG_FILE="/etc/rabbitmq/rabbitmq-murano"
|
||||
export RABBITMQ_MNESIA_BASE="/var/lib/rabbitmq/mnesia-murano"
|
||||
export RABBITMQ_LOG_BASE="/var/log/rabbitmq-murano"
|
||||
export RABBITMQ_ENABLED_PLUGINS_FILE="/etc/rabbitmq/enabled_plugins_murano"
|
||||
export RABBITMQ_NODENAME="murano@localhost"
|
||||
export RABBITMQ_NODE_PORT="<%= @rabbit_port %>"
|
||||
export RABBITMQ_NODE_IP_ADDRESS="0.0.0.0"
|
||||
|
||||
LOCK_DIR="/var/lock/rabbitmq"
|
||||
LOCK_FILE="${LOCK_DIR}/${NAME}"
|
||||
mkdir -p "${LOCK_DIR}"
|
||||
chown -R "${USER}:${USER}" "${LOCK_DIR}"
|
||||
|
||||
test -x "${DAEMON}" || exit 0
|
||||
test -x "${CONTROL}" || exit 0
|
||||
|
||||
CONTROL="${CONTROL} -n ${RABBITMQ_NODENAME}"
|
||||
|
||||
RETVAL="0"
|
||||
|
||||
[ -f /etc/default/${NAME} ] && . /etc/default/${NAME}
|
||||
|
||||
check_dir () {
|
||||
mkdir -p "${1}"
|
||||
chown -R "${USER}:${USER}" "${1}"
|
||||
chmod "755" "${1}"
|
||||
}
|
||||
|
||||
ensure_dirs () {
|
||||
PID_DIR=`dirname ${RABBITMQ_PID_FILE}`
|
||||
check_dir "${PID_DIR}"
|
||||
check_dir "${RABBITMQ_LOG_DIR}"
|
||||
check_dir "${RABBITMQ_LOG_BASE}"
|
||||
check_dir "${RABBITMQ_MNESIA_BASE}"
|
||||
}
|
||||
|
||||
remove_pid () {
|
||||
rm -f "${RABBITMQ_PID_FILE}"
|
||||
}
|
||||
#####
|
||||
|
||||
c_start_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
if [ $RETVAL != 0 ] ; then
|
||||
#Slave nodes fail to start until master is not up and running
|
||||
#So, give slaves several attempts to start
|
||||
#Rabbit database will be moved out before last attempt.
|
||||
local MAX_START_ATTEMPTS=3
|
||||
printf '%s\n' "RabbitMQ is going to make ${MAX_START_ATTEMPTS} \
|
||||
attempts to find master node and start."
|
||||
while test $MAX_START_ATTEMPTS -ne 0
|
||||
do
|
||||
RETVAL=0
|
||||
ensure_pid_dir
|
||||
printf '%s\n' "${MAX_START_ATTEMPTS} attempts left to start \
|
||||
RabbitMQ Server before consider start failed."
|
||||
if [ $MAX_START_ATTEMPTS = 1 ] ; then
|
||||
move_out_rabbit_database_to_backup
|
||||
fi
|
||||
set +e
|
||||
RABBITMQ_PID_FILE=$PID_FILE start-stop-daemon --quiet \
|
||||
--chuid rabbitmq --start --exec $DAEMON \
|
||||
--pidfile "$RABBITMQ_PID_FILE" --background
|
||||
$CONTROL wait $PID_FILE >/dev/null 2>&1
|
||||
RETVAL=$?
|
||||
set -e
|
||||
if [ $RETVAL != 0 ] ; then
|
||||
remove_pid
|
||||
else
|
||||
if [ $MAX_START_ATTEMPTS = 1 ] ; then
|
||||
set_nova_rabbit_credentials
|
||||
RETVAL=0
|
||||
fi
|
||||
break
|
||||
fi
|
||||
MAX_START_ATTEMPTS=$((MAX_START_ATTEMPTS - 1))
|
||||
done
|
||||
else
|
||||
RETVAL=3
|
||||
fi
|
||||
}
|
||||
#####
|
||||
|
||||
start_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" = "0" ] ; then
|
||||
echo "Murano RabbitMQ is currently running!"
|
||||
RETVAL="0"
|
||||
return
|
||||
fi
|
||||
|
||||
ensure_dirs
|
||||
start-stop-daemon --quiet --chuid rabbitmq \
|
||||
--start --exec "${DAEMON}" \
|
||||
--pidfile "${RABBITMQ_PID_FILE}" --background
|
||||
${CONTROL} wait "${RABBITMQ_PID_FILE}" 1> "/dev/null" 2>&1
|
||||
RETVAL="${?}"
|
||||
|
||||
if [ "${RETVAL}" -gt "0" ]; then
|
||||
remove_pid
|
||||
echo "Murano RabbitMQ start FAILED!"
|
||||
RETVAL="1"
|
||||
else
|
||||
echo "Murano RabbitMQ start SUCCESS!"
|
||||
if [ -n "${LOCK_FILE}" ]; then
|
||||
touch "${LOCK_FILE}"
|
||||
fi
|
||||
RETVAL="0"
|
||||
fi
|
||||
}
|
||||
|
||||
stop_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" != 0 ]; then
|
||||
echo "RabbitMQ is not running!"
|
||||
RETVAL="0"
|
||||
return
|
||||
fi
|
||||
|
||||
${CONTROL} stop "${RABBITMQ_PID_FILE}" > "${RABBITMQ_LOG_BASE}/shutdown_log" 2> "${RABBITMQ_LOG_BASE}/shutdown_err"
|
||||
RETVAL="${?}"
|
||||
|
||||
if [ "${RETVAL}" = "0" ] ; then
|
||||
remove_pid
|
||||
echo "Murano RabbitMQ stop SUCCESS!"
|
||||
if [ -n "{$LOCK_FILE}" ] ; then
|
||||
rm -f "${LOCK_FILE}"
|
||||
fi
|
||||
RETVAL="0"
|
||||
else
|
||||
echo "Murano RabbitMQ stop FAILED!"
|
||||
RETVAL="1"
|
||||
fi
|
||||
}
|
||||
|
||||
status_rabbitmq () {
|
||||
if [ "${1}" != "quiet" ] ; then
|
||||
${CONTROL} status 2>&1
|
||||
else
|
||||
${CONTROL} status > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ "${?}" != "0" ]; then
|
||||
RETVAL="3"
|
||||
fi
|
||||
}
|
||||
|
||||
rotate_logs_rabbitmq () {
|
||||
${CONTROL} rotate_logs "${ROTATE_SUFFIX}"
|
||||
if [ $? != 0 ]; then
|
||||
RETVAL="1"
|
||||
fi
|
||||
}
|
||||
|
||||
restart_running_rabbitmq () {
|
||||
status_rabbitmq quiet
|
||||
|
||||
if [ "${RETVAL}" != "0" ]; then
|
||||
echo "RabbitMQ is not runnning!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
restart_rabbitmq
|
||||
}
|
||||
|
||||
restart_rabbitmq () {
|
||||
stop_rabbitmq
|
||||
start_rabbitmq
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
echo "Starting $DESC"
|
||||
start_rabbitmq
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping $DESC"
|
||||
stop_rabbitmq
|
||||
;;
|
||||
status)
|
||||
status_rabbitmq
|
||||
;;
|
||||
rotate-logs)
|
||||
echo "Rotating log files for $DESC"
|
||||
rotate_logs_rabbitmq
|
||||
;;
|
||||
force-reload|reload|restart)
|
||||
echo "Restarting $DESC"
|
||||
restart_rabbitmq
|
||||
;;
|
||||
try-restart)
|
||||
echo "Restarting $DESC"
|
||||
restart_running_rabbitmq
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|rotate-logs|restart|condrestart|try-restart|reload|force-reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit "${RETVAL}"
|
|
@ -1,7 +0,0 @@
|
|||
[
|
||||
{rabbit, [{tcp_listeners, [<%= @rabbit_port %>]}]},
|
||||
{kernel,[
|
||||
{inet_dist_listen_min, <%= @rabbit_cluster_port %>},
|
||||
{inet_dist_listen_max, <%= @rabbit_cluster_port %>}
|
||||
]}
|
||||
].
|
|
@ -39,11 +39,13 @@ fixtures:
|
|||
'sahara':
|
||||
repo: 'https://review.fuel-infra.org/puppet-modules/puppet-sahara.git'
|
||||
branch: '7.0.0-mos-rc1'
|
||||
'murano':
|
||||
repo: 'https://review.fuel-infra.org/puppet-modules/puppet-murano.git'
|
||||
branch: '7.0.0-mos-rc1'
|
||||
symlinks:
|
||||
'openstack': "#{source_dir}"
|
||||
'osnailyfacter': "#{source_dir}/../osnailyfacter"
|
||||
'l23network': "#{source_dir}/../l23network"
|
||||
'rsyslog': "#{source_dir}/../rsyslog"
|
||||
'mysql': "#{source_dir}/../mysql"
|
||||
'murano': "#{source_dir}/../murano"
|
||||
'tweaks': "#{source_dir}/../tweaks"
|
||||
|
|
|
@ -80,24 +80,26 @@ if $murano_hash['enabled'] {
|
|||
use_stderr => $use_stderr,
|
||||
log_facility => $syslog_log_facility_murano,
|
||||
database_connection => $sql_connection,
|
||||
keystone_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
keystone_username => $murano_user,
|
||||
keystone_password => $murano_hash['user_password'],
|
||||
keystone_tenant => $tenant,
|
||||
auth_uri => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
admin_user => $murano_user,
|
||||
admin_password => $murano_hash['user_password'],
|
||||
admin_tenant_name => $tenant,
|
||||
identity_uri => "http://${service_endpoint}:35357/",
|
||||
use_neutron => $use_neutron,
|
||||
rabbit_os_user => $rabbit_hash['user'],
|
||||
rabbit_os_password => $rabbit_hash['password'],
|
||||
rabbit_os_port => $amqp_port,
|
||||
rabbit_os_hosts => split($amqp_hosts, ','),
|
||||
rabbit_os_host => split($amqp_hosts, ','),
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_own_host => $public_ip,
|
||||
rabbit_own_port => '55572',
|
||||
rabbit_own_port => $amqp_port,
|
||||
rabbit_own_user => 'murano',
|
||||
rabbit_own_password => $heat_hash['rabbit_password'],
|
||||
rabbit_own_vhost => 'murano',
|
||||
service_host => $api_bind_host,
|
||||
service_port => $api_bind_port,
|
||||
external_network => $external_network,
|
||||
use_trusts => true,
|
||||
}
|
||||
|
||||
class { 'murano::api':
|
||||
|
@ -114,10 +116,16 @@ if $murano_hash['enabled'] {
|
|||
repo_url => $repository_url,
|
||||
}
|
||||
|
||||
class { 'murano::rabbitmq':
|
||||
rabbit_user => 'murano',
|
||||
rabbit_password => $heat_hash['rabbit_password'],
|
||||
rabbit_port => '55572',
|
||||
rabbitmq_user { 'murano':
|
||||
password => $heat_hash['rabbit_password'],
|
||||
}
|
||||
|
||||
rabbitmq_vhost { '/murano': }
|
||||
|
||||
rabbitmq_user_permissions { "murano@/murano":
|
||||
configure_permission => '.*',
|
||||
read_permission => '.*',
|
||||
write_permission => '.*',
|
||||
}
|
||||
|
||||
$haproxy_stats_url = "http://${management_ip}:10000/;csv"
|
||||
|
@ -138,20 +146,13 @@ if $murano_hash['enabled'] {
|
|||
url => $haproxy_stats_url,
|
||||
}
|
||||
|
||||
murano::application { 'io.murano' :
|
||||
os_tenant_name => $tenant,
|
||||
os_username => $murano_user,
|
||||
os_password => $murano_hash['user_password'],
|
||||
os_auth_url => "${public_protocol}://${public_address}:5000/v2.0/",
|
||||
os_region => $region,
|
||||
mandatory => true,
|
||||
}
|
||||
murano::application { 'io.murano' : }
|
||||
|
||||
Haproxy_backend_status['keystone-admin'] -> Haproxy_backend_status['murano-api']
|
||||
Haproxy_backend_status['keystone-public'] -> Haproxy_backend_status['murano-api']
|
||||
Haproxy_backend_status['murano-api'] -> Murano::Application['io.murano']
|
||||
|
||||
Service['murano-api'] -> Murano::Application<| mandatory == true |>
|
||||
Service['murano-api'] -> Murano::Application['io.murano']
|
||||
}
|
||||
|
||||
Firewall[$firewall_rule] -> Class['murano::api']
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
groups: [primary-controller, controller]
|
||||
condition: "settings:additional_components.murano.value == true"
|
||||
required_for: [deploy_end, controller_remaining_tasks]
|
||||
requires: [heat, horizon]
|
||||
requires: [heat, horizon, rabbitmq]
|
||||
parameters:
|
||||
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/murano/murano.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
|
|
|
@ -80,30 +80,31 @@ describe manifest do
|
|||
context 'if murano is enabled', :if => enable do
|
||||
it 'should declare murano class correctly' do
|
||||
should contain_class('murano').with(
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'use_stderr' => 'false',
|
||||
'log_facility' => syslog_log_facility_murano,
|
||||
'verbose' => verbose,
|
||||
'debug' => debug,
|
||||
'use_syslog' => use_syslog,
|
||||
'use_stderr' => 'false',
|
||||
'log_facility' => syslog_log_facility_murano,
|
||||
'database_connection' => sql_connection,
|
||||
'keystone_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'keystone_username' => murano_user,
|
||||
'keystone_password' => murano_password,
|
||||
'keystone_tenant' => tenant,
|
||||
'auth_uri' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'admin_user' => murano_user,
|
||||
'admin_password' => murano_password,
|
||||
'admin_tenant_name' => tenant,
|
||||
'identity_uri' => "http://#{service_endpoint}:35357/",
|
||||
'use_neutron' => use_neutron,
|
||||
'rabbit_os_user' => rabbit_os_user,
|
||||
'rabbit_os_password' => rabbit_os_password,
|
||||
'rabbit_os_port' => amqp_port,
|
||||
'rabbit_os_hosts' => amqp_hosts.split(','),
|
||||
'rabbit_os_host' => amqp_hosts.split(','),
|
||||
'rabbit_ha_queues' => rabbit_ha_queues,
|
||||
'rabbit_own_host' => public_ip,
|
||||
'rabbit_own_port' => '55572',
|
||||
'rabbit_own_port' => amqp_port,
|
||||
'rabbit_own_user' => 'murano',
|
||||
'rabbit_own_password' => rabbit_own_password,
|
||||
'service_host' => bind_address,
|
||||
'service_port' => api_bind_port,
|
||||
'external_network' => external_network
|
||||
'service_host' => bind_address,
|
||||
'service_port' => api_bind_port,
|
||||
'external_network' => external_network,
|
||||
'rabbit_own_vhost' => 'murano',
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -129,25 +130,28 @@ describe manifest do
|
|||
)
|
||||
end
|
||||
|
||||
it 'should declare murano::rabbitmq class correctly' do
|
||||
should contain_class('murano::rabbitmq').with(
|
||||
'rabbit_user' => 'murano',
|
||||
'rabbit_password' => rabbit_own_password,
|
||||
'rabbit_port' => '55572'
|
||||
)
|
||||
it 'should declare rabbitmq_user' do
|
||||
should contain_rabbitmq_user('murano').with({
|
||||
:password => rabbit_own_password,
|
||||
})
|
||||
end
|
||||
|
||||
it 'should declare rabbitmq_vhost' do
|
||||
should contain_rabbitmq_vhost('/murano')
|
||||
end
|
||||
|
||||
it 'should declare rabbitmq_user_permission' do
|
||||
should contain_rabbitmq_user_permissions('murano@/murano').with({
|
||||
:configure_permission => '.*',
|
||||
:read_permission => '.*',
|
||||
:write_permission => '.*',
|
||||
})
|
||||
end
|
||||
|
||||
enable = (Noop.hiera_structure('murano/enabled') and Noop.hiera('node_role') == 'primary-controller')
|
||||
context 'on primary controller', :if => enable do
|
||||
it 'should declare murano::application resource correctly' do
|
||||
should contain_murano__application('io.murano').with(
|
||||
'os_tenant_name' => tenant,
|
||||
'os_username' => murano_user,
|
||||
'os_password' => murano_password,
|
||||
'os_auth_url' => "#{public_protocol}://#{public_address}:5000/v2.0/",
|
||||
'os_region' => region,
|
||||
'mandatory' => true
|
||||
)
|
||||
should contain_murano__application('io.murano')
|
||||
end
|
||||
|
||||
it {
|
||||
|
|
Loading…
Reference in New Issue