Commiting a cookie cutter module sync set of files
This module had pre-existing content which is not the methodology puppet-openstack community advises. This commit takes the content from their new-module documentation and commits it to this repo as a marker to where the module should have started. The previous history is being kept for preservation and will be migrated into upcoming commits to establish a developmental history based on the cookiecutter and msync foundation as documented by the puppet openstack community. Change-Id: I19189f0d5a100a3668f29d285ef3a0254f56ca51 Signed-off-by: Dan Radez <dradez@redhat.com>
This commit is contained in:
parent
6934f153ab
commit
85caa08479
|
@ -1,11 +0,0 @@
|
|||
fixtures:
|
||||
repositories:
|
||||
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
|
||||
inifile: "https://github.com/puppetlabs/puppetlabs-inifile"
|
||||
openstacklib: "https://github.com/openstack/puppet-openstacklib"
|
||||
postgresql: "https://github.com/puppetlabs/puppetlabs-postgresql"
|
||||
mysql: "https://github.com/puppetlabs/puppetlabs-mysql"
|
||||
concat: "https://github.com/puppetlabs/puppetlabs-concat"
|
||||
keystone: "https://github.com/openstack/puppet-keystone"
|
||||
symlinks:
|
||||
"tacker": "#{source_dir}"
|
|
@ -1,7 +1,11 @@
|
|||
pkg/
|
||||
Gemfile.lock
|
||||
spec/fixtures/modules/*
|
||||
spec/fixtures/manifests/site.pp
|
||||
*.swp
|
||||
pkg
|
||||
vendor/
|
||||
spec/fixtures/
|
||||
.vagrant/
|
||||
.bundle/
|
||||
coverage/
|
||||
.idea/
|
||||
*.swp
|
||||
*.iml
|
||||
openstack/
|
||||
|
|
29
.travis.yml
29
.travis.yml
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
language: ruby
|
||||
bundler_args: --without local_only
|
||||
before_install: rm Gemfile.lock || true
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- 2.0.0
|
||||
- 2.1.7
|
||||
- 2.2.3
|
||||
script: bundle exec rake test
|
||||
env:
|
||||
- PUPPET_VERSION="~> 3.4.0"
|
||||
- PUPPET_VERSION="~> 3.5.0"
|
||||
- PUPPET_VERSION="~> 3.6.0"
|
||||
- PUPPET_VERSION="~> 3.7.0"
|
||||
- PUPPET_VERSION="~> 4.0.0"
|
||||
- PUPPET_VERSION="~> 4.1.0"
|
||||
- PUPPET_VERSION="~> 4.2.0"
|
||||
- PUPPET_VERSION="~> 4.3.0"
|
||||
matrix:
|
||||
exclude:
|
||||
- rvm: 2.2.3
|
||||
env: PUPPET_VERSION="~> 3.4.0"
|
||||
- rvm: 2.2.3
|
||||
env: PUPPET_VERSION="~> 3.5.0"
|
||||
- rvm: 2.2.3
|
||||
env: PUPPET_VERSION="~> 3.6.0"
|
||||
- rvm: 2.2.3
|
||||
env: PUPPET_VERSION="~> 3.7.0"
|
33
Gemfile
33
Gemfile
|
@ -1,32 +1,15 @@
|
|||
source ENV['GEM_SOURCE'] || "https://rubygems.org"
|
||||
|
||||
group :development, :test do
|
||||
gem 'puppetlabs_spec_helper', :require => 'false'
|
||||
gem 'rspec-puppet', '~> 2.2.0', :require => 'false'
|
||||
gem 'rspec-puppet-facts', :require => 'false'
|
||||
gem 'metadata-json-lint', :require => 'false'
|
||||
gem 'puppet-lint-param-docs', :require => 'false'
|
||||
gem 'puppet-lint-absolute_classname-check', :require => 'false'
|
||||
gem 'puppet-lint-absolute_template_path', :require => 'false'
|
||||
gem 'puppet-lint-trailing_newline-check', :require => 'false'
|
||||
gem 'puppet-lint-unquoted_string-check', :require => 'false'
|
||||
gem 'puppet-lint-leading_zero-check', :require => 'false'
|
||||
gem 'puppet-lint-variable_contains_upcase', :require => 'false'
|
||||
gem 'puppet-lint-numericvariable', :require => 'false'
|
||||
gem 'json', :require => 'false'
|
||||
group :development, :test, :system_tests do
|
||||
gem 'puppet-openstack_spec_helper',
|
||||
:git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper',
|
||||
:require => false
|
||||
:require => 'false',
|
||||
:git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper'
|
||||
end
|
||||
|
||||
group :local_only do
|
||||
gem "travis"
|
||||
gem "travis-lint"
|
||||
gem "beaker"
|
||||
gem "beaker-rspec"
|
||||
gem "vagrant-wrapper"
|
||||
gem "puppet-blacksmith"
|
||||
gem "guard-rake"
|
||||
if facterversion = ENV['FACTER_GEM_VERSION']
|
||||
gem 'facter', facterversion, :require => false
|
||||
else
|
||||
gem 'facter', :require => false
|
||||
end
|
||||
|
||||
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||
|
@ -34,3 +17,5 @@ if puppetversion = ENV['PUPPET_GEM_VERSION']
|
|||
else
|
||||
gem 'puppet', :require => false
|
||||
end
|
||||
|
||||
# vim:ft=ruby
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright 2015 OpenStack Foundation
|
||||
Copyright 2016 OpenStack Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
10
README.md
10
README.md
|
@ -14,7 +14,7 @@ tacker
|
|||
Overview
|
||||
--------
|
||||
|
||||
The tacker module is a part of [OpenStack](https://github.com/openstack), an effort by the Openstack infrastructure team to provide continuous integration testing and code review for Openstack and Openstack community projects not part of the core software. The module its self is used to flexibly configure and manage the FIXME service for Openstack.
|
||||
The tacker module is a part of [OpenStack](https://www.openstack.org), an effort by the OpenStack infrastructure team to provide continuous integration testing and code review for OpenStack and OpenStack community projects not part of the core software. The module its self is used to flexibly configure and manage the NFV orchestration service for OpenStack.
|
||||
|
||||
Module Description
|
||||
------------------
|
||||
|
@ -26,7 +26,7 @@ Setup
|
|||
|
||||
**What the tacker module affects**
|
||||
|
||||
* [Tacker](https://wiki.openstack.org/wiki/Tacker), the FIXME service for Openstack.
|
||||
* [Tacker](https://wiki.openstack.org/wiki/Tacker), the NFV orchestration service for OpenStack.
|
||||
|
||||
### Installing tacker
|
||||
|
||||
|
@ -35,7 +35,7 @@ Setup
|
|||
|
||||
### Beginning with tacker
|
||||
|
||||
To utilize the tacker module's functionality you will need to declare multiple resources. The following is a modified excerpt from the [openstack module](https://github.com/stackfoge/puppet-openstack). This is not an exhaustive list of all the components needed, we recommend you consult and understand the [openstack module](https://github.com/stackforge/puppet-openstack) and the [core openstack](http://docs.openstack.org) documentation.
|
||||
To utilize the tacker module's functionality you will need to declare multiple resources.
|
||||
|
||||
Implementation
|
||||
--------------
|
||||
|
@ -63,14 +63,14 @@ bundle exec rake acceptance
|
|||
|
||||
For more information on writing and running beaker-rspec tests visit the documentation:
|
||||
|
||||
* https://github.com/puppetlabs/beaker/wiki/How-to-Write-a-Beaker-Test-for-a-Module
|
||||
* https://github.com/puppetlabs/beaker-rspec/blob/master/README.md
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
Developer documentation for the entire puppet-openstack project.
|
||||
|
||||
* https://wiki.openstack.org/wiki/Puppet
|
||||
* http://docs.openstack.org/developer/puppet-openstack-guide/
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
|
36
Rakefile
36
Rakefile
|
@ -1,35 +1 @@
|
|||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet/version'
|
||||
require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6
|
||||
require 'metadata-json-lint/rake_task'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
|
||||
# Coverage from puppetlabs-spec-helper requires rcov which
|
||||
# doesn't work in anything since 1.8.7
|
||||
Rake::Task[:coverage].clear
|
||||
|
||||
PuppetSyntax.exclude_paths ||= []
|
||||
PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
|
||||
PuppetSyntax.exclude_paths << "pkg/**/*"
|
||||
PuppetSyntax.exclude_paths << "vendor/**/*"
|
||||
|
||||
Rake::Task[:lint].clear
|
||||
PuppetLint::RakeTask.new :lint do |config|
|
||||
config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
|
||||
config.fail_on_warnings = true
|
||||
config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
|
||||
config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"]
|
||||
end
|
||||
|
||||
desc "Run syntax, lint, spec tests."
|
||||
task :test => [
|
||||
:syntax,
|
||||
:lint,
|
||||
:metadata_lint,
|
||||
:spec,
|
||||
]
|
||||
require 'puppet-openstack_spec_helper/rake_tasks'
|
||||
|
|
|
@ -3,7 +3,7 @@ Puppet::Type.newtype(:tacker_config) do
|
|||
ensurable
|
||||
|
||||
newparam(:name, :namevar => true) do
|
||||
desc 'Section/setting name to manage from /etc/tacker/tacker.conf'
|
||||
desc 'Section/setting name to manage from tacker.conf'
|
||||
newvalues(/\S+\/\S+/)
|
||||
end
|
||||
|
||||
|
@ -14,6 +14,7 @@ Puppet::Type.newtype(:tacker_config) do
|
|||
value.capitalize! if value =~ /^(true|false)$/i
|
||||
value
|
||||
end
|
||||
newvalues(/^[\S ]*$/)
|
||||
|
||||
def is_to_s( currentvalue )
|
||||
if resource.secret?
|
||||
|
@ -48,4 +49,5 @@ Puppet::Type.newtype(:tacker_config) do
|
|||
autorequire(:package) do
|
||||
'tacker'
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
# == Class: tacker::client
|
||||
#
|
||||
# Installs Tacker client.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) Ensure state of the package.
|
||||
# Defaults to 'present'.
|
||||
#
|
||||
class tacker::client (
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
package { 'python-tackerclient':
|
||||
ensure => $ensure,
|
||||
tag => 'openstack',
|
||||
}
|
||||
|
||||
if $ensure == 'present' {
|
||||
include '::openstacklib::openstackclient'
|
||||
}
|
||||
}
|
101
manifests/db.pp
101
manifests/db.pp
|
@ -1,97 +1,58 @@
|
|||
# == Class: tacker::db
|
||||
#
|
||||
# Configure the Tacker database connection
|
||||
# Configure the tacker database
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*database_connection*]
|
||||
# Url used to connect to database.
|
||||
# (Optional) Defaults to 'sqlite:////var/lib/tacker/tacker.sqlite'.
|
||||
# (Optional) Url used to connect to database.
|
||||
# Defaults to "sqlite:////var/lib/tacker/tacker.sqlite".
|
||||
#
|
||||
# [*database_idle_timeout*]
|
||||
# Timeout when db connections should be reaped.
|
||||
# (Optional) Defaults to 3600.
|
||||
# (Optional) Timeout when db connections should be reaped.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_retries*]
|
||||
# Maximum number of database connection retries during startup.
|
||||
# (Optional) Maximum number of database connection retries during startup.
|
||||
# Setting -1 implies an infinite retry count.
|
||||
# (Optional) Defaults to 10.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_retry_interval*]
|
||||
# Interval between retries of opening a database connection.
|
||||
# (Optional) Defaults to 10.
|
||||
# (Optional) Interval between retries of opening a database connection.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_min_pool_size*]
|
||||
# Minimum number of SQL connections to keep open in a pool.
|
||||
# (Optional) Defaults to 1.
|
||||
# (Optional) Minimum number of SQL connections to keep open in a pool.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_pool_size*]
|
||||
# Maximum number of SQL connections to keep open in a pool.
|
||||
# (Optional) Defaults to 10.
|
||||
# (Optional)Maximum number of SQL connections to keep open in a pool.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_max_overflow*]
|
||||
# If set, use this value for max_overflow with sqlalchemy.
|
||||
# (Optional) Defaults to 20.
|
||||
# (Optional) If set, use this value for max_overflow with sqlalchemy.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class tacker::db (
|
||||
$database_connection = 'sqlite:////var/lib/tacker/tacker.sqlite',
|
||||
$database_idle_timeout = 3600,
|
||||
$database_min_pool_size = 1,
|
||||
$database_max_pool_size = 10,
|
||||
$database_max_retries = 10,
|
||||
$database_retry_interval = 10,
|
||||
$database_max_overflow = 20,
|
||||
$database_idle_timeout = $::os_service_default,
|
||||
$database_min_pool_size = $::os_service_default,
|
||||
$database_max_pool_size = $::os_service_default,
|
||||
$database_max_retries = $::os_service_default,
|
||||
$database_retry_interval = $::os_service_default,
|
||||
$database_max_overflow = $::os_service_default,
|
||||
) {
|
||||
|
||||
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
|
||||
# to use tacker::<myparam> if tacker::db::<myparam> isn't specified.
|
||||
$database_connection_real = pick($::tacker::database_connection, $database_connection)
|
||||
$database_idle_timeout_real = pick($::tacker::database_idle_timeout, $database_idle_timeout)
|
||||
$database_min_pool_size_real = pick($::tacker::database_min_pool_size, $database_min_pool_size)
|
||||
$database_max_pool_size_real = pick($::tacker::database_max_pool_size, $database_max_pool_size)
|
||||
$database_max_retries_real = pick($::tacker::database_max_retries, $database_max_retries)
|
||||
$database_retry_interval_real = pick($::tacker::database_retry_interval, $database_retry_interval)
|
||||
$database_max_overflow_real = pick($::tacker::database_max_overflow, $database_max_overflow)
|
||||
validate_re($database_connection,
|
||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
validate_re($database_connection_real,
|
||||
'(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||
|
||||
if $database_connection_real {
|
||||
case $database_connection_real {
|
||||
/^mysql:\/\//: {
|
||||
$backend_package = false
|
||||
require 'mysql::bindings'
|
||||
require 'mysql::bindings::python'
|
||||
}
|
||||
/^postgresql:\/\//: {
|
||||
$backend_package = false
|
||||
require 'postgresql::lib::python'
|
||||
}
|
||||
/^sqlite:\/\//: {
|
||||
$backend_package = $::tacker::params::sqlite_package_name
|
||||
}
|
||||
default: {
|
||||
fail('Unsupported backend configured')
|
||||
}
|
||||
}
|
||||
|
||||
if $backend_package and !defined(Package[$backend_package]) {
|
||||
package {'tacker-backend-package':
|
||||
ensure => present,
|
||||
name => $backend_package,
|
||||
tag => 'openstack',
|
||||
}
|
||||
}
|
||||
|
||||
tacker_config {
|
||||
'database/connection': value => $database_connection_real, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout_real;
|
||||
'database/min_pool_size': value => $database_min_pool_size_real;
|
||||
'database/max_retries': value => $database_max_retries_real;
|
||||
'database/retry_interval': value => $database_retry_interval_real;
|
||||
'database/max_pool_size': value => $database_max_pool_size_real;
|
||||
'database/max_overflow': value => $database_max_overflow_real;
|
||||
}
|
||||
oslo::db { 'tacker_config':
|
||||
connection => $database_connection,
|
||||
idle_timeout => $database_idle_timeout,
|
||||
min_pool_size => $database_min_pool_size,
|
||||
max_retries => $database_max_retries,
|
||||
retry_interval => $database_retry_interval,
|
||||
max_pool_size => $database_max_pool_size,
|
||||
max_overflow => $database_max_overflow,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# The tacker::db::mysql class implements mysql backend for tacker
|
||||
#
|
||||
# This class can be used to create tables, users and grant
|
||||
# privelege for a mysql tacker database.
|
||||
# privilege for a mysql tacker database.
|
||||
#
|
||||
# == parameters
|
||||
#
|
||||
|
|
|
@ -1,13 +1,22 @@
|
|||
#
|
||||
# Class to execute "tacker-manage db_sync
|
||||
# Class to execute tacker-manage db_sync
|
||||
#
|
||||
class tacker::db::sync {
|
||||
exec { 'tacker-manage db_sync':
|
||||
# == Parameters
|
||||
#
|
||||
# [*extra_params*]
|
||||
# (optional) String of extra command line parameters to append
|
||||
# to the tacker-dbsync command.
|
||||
# Defaults to undef
|
||||
#
|
||||
class tacker::db::sync(
|
||||
$extra_params = undef,
|
||||
) {
|
||||
exec { 'tacker-db-sync':
|
||||
command => "tacker-manage db_sync ${extra_params}",
|
||||
path => '/usr/bin',
|
||||
user => 'tacker',
|
||||
refreshonly => true,
|
||||
subscribe => [Package['tacker'], Tacker_config['database/connection']],
|
||||
require => User['tacker'],
|
||||
}
|
||||
|
||||
Exec['tacker-manage db_sync'] ~> Service<| title == 'tacker' |>
|
||||
|
|
|
@ -1,448 +1,11 @@
|
|||
# == Class: tacker
|
||||
#
|
||||
# Module for managing tacker config
|
||||
# Full description of class tacker here.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*keystone_password*]
|
||||
# (required) Password used to authentication.
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) Desired ensure state of packages.
|
||||
# accepts latest or specific versions.
|
||||
# Defaults to present.
|
||||
#
|
||||
# [*client_package_ensure*]
|
||||
# (optional) Desired ensure state of the client package.
|
||||
# accepts latest or specific versions.
|
||||
# Defaults to present.
|
||||
#
|
||||
# [*bind_host*]
|
||||
# (optional) The IP address that tacker binds to.
|
||||
# Default to '0.0.0.0'.
|
||||
#
|
||||
# [*bind_port*]
|
||||
# (optional) Port that tacker binds to.
|
||||
# Defaults to '8888'
|
||||
#
|
||||
# [*verbose*]
|
||||
# (optional) Rather Tacker should log at verbose level.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*debug*]
|
||||
# (optional) Rather Tacker should log at debug level.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*auth_type*]
|
||||
# (optional) Type is authorization being used.
|
||||
# Defaults to 'keystone'
|
||||
#
|
||||
# [*auth_uri*]
|
||||
# (optional) Complete public Identity API endpoint.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*identity_uri*]
|
||||
# (optional) Complete admin Identity API endpoint.
|
||||
# Defaults to: false
|
||||
#
|
||||
# [*keystone_tenant*]
|
||||
# (optional) Tenant to authenticate to.
|
||||
# Defaults to services.
|
||||
#
|
||||
# [*keystone_user*]
|
||||
# (optional) User to authenticate as with keystone.
|
||||
# Defaults to 'tacker'.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (Optional) If Puppet should manage service startup / shutdown.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*enabled*]
|
||||
# (optional) If the Tacker services should be enabled.
|
||||
# Default to true.
|
||||
#
|
||||
# [*database_connection*]
|
||||
# (optional) Url used to connect to database.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*database_idle_timeout*]
|
||||
# (optional) Timeout when db connections should be reaped.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*database_max_retries*]
|
||||
# (optional) Maximum number of database connection retries during startup.
|
||||
# Setting -1 implies an infinite retry count.
|
||||
# (Defaults to undef)
|
||||
#
|
||||
# [*database_retry_interval*]
|
||||
# (optional) Interval between retries of opening a database connection.
|
||||
# (Defaults to undef)
|
||||
#
|
||||
# [*database_min_pool_size*]
|
||||
# (optional) Minimum number of SQL connections to keep open in a pool.
|
||||
# Defaults to: undef
|
||||
#
|
||||
# [*database_max_pool_size*]
|
||||
# (optional) Maximum number of SQL connections to keep open in a pool.
|
||||
# Defaults to: undef
|
||||
#
|
||||
# [*database_max_overflow*]
|
||||
# (optional) If set, use this value for max_overflow with sqlalchemy.
|
||||
# Defaults to: undef
|
||||
#
|
||||
# [*rpc_backend*]
|
||||
# (Optional) Use these options to configure the RabbitMQ message system.
|
||||
# Defaults to 'rabbit'
|
||||
#
|
||||
# [*control_exchange*]
|
||||
# (Optional)
|
||||
# Defaults to 'openstack'.
|
||||
#
|
||||
# [*rabbit_host*]
|
||||
# (Optional) IP or hostname of the rabbit server.
|
||||
# Defaults to '127.0.0.1'
|
||||
#
|
||||
# [*rabbit_port*]
|
||||
# (Optional) Port of the rabbit server.
|
||||
# Defaults to 5672.
|
||||
#
|
||||
# [*rabbit_hosts*]
|
||||
# (Optional) Array of host:port (used with HA queues).
|
||||
# If defined, will remove rabbit_host & rabbit_port parameters from config
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*rabbit_userid*]
|
||||
# (Optional) User to connect to the rabbit server.
|
||||
# Defaults to 'guest'
|
||||
#
|
||||
# [*rabbit_password*]
|
||||
# (Required) Password to connect to the rabbit_server.
|
||||
# Defaults to empty. Required if using the Rabbit (kombu)
|
||||
# backend.
|
||||
#
|
||||
# [*rabbit_virtual_host*]
|
||||
# (Optional) Virtual_host to use.
|
||||
# Defaults to '/'
|
||||
#
|
||||
# [*rabbit_heartbeat_timeout_threshold*]
|
||||
# (optional) Number of seconds after which the RabbitMQ broker is considered
|
||||
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
|
||||
# Heartbeating helps to ensure the TCP connection to RabbitMQ isn't silently
|
||||
# closed, resulting in missed or lost messages from the queue.
|
||||
# (Requires kombu >= 3.0.7 and amqp >= 1.4.0)
|
||||
# Defaults to 0
|
||||
#
|
||||
# [*rabbit_heartbeat_rate*]
|
||||
# (optional) How often during the rabbit_heartbeat_timeout_threshold period to
|
||||
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
|
||||
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
|
||||
# every 30 seconds.
|
||||
# Defaults to 2
|
||||
#
|
||||
# [*rabbit_use_ssl*]
|
||||
# (optional) Connect over SSL for RabbitMQ
|
||||
# Defaults to false
|
||||
#
|
||||
# [*kombu_ssl_ca_certs*]
|
||||
# (optional) SSL certification authority file (valid only if SSL enabled).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_certfile*]
|
||||
# (optional) SSL cert file (valid only if SSL enabled).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_keyfile*]
|
||||
# (optional) SSL key file (valid only if SSL enabled).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_version*]
|
||||
# (optional) SSL version to use (valid only if SSL enabled).
|
||||
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
|
||||
# available on some distributions.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_reconnect_delay*]
|
||||
# (optional) How long to wait before reconnecting in response to an AMQP
|
||||
# consumer cancel notification.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*amqp_durable_queues*]
|
||||
# Use durable queues in amqp.
|
||||
# (Optional) Defaults to false.
|
||||
#
|
||||
# [*service_provider*]
|
||||
# (optional) Provider, that can be used for tacker service.
|
||||
# Default value defined in tacker::params for given operation system.
|
||||
# If you use Pacemaker or another Cluster Resource Manager, you can make
|
||||
# custom service provider for changing start/stop/status behavior of service,
|
||||
# and set it here.
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service that will be providing the
|
||||
# server functionality of tacker.
|
||||
# Defaults to '$::tacker::params::service_name'
|
||||
#
|
||||
# [*sync_db*]
|
||||
# (Optional) Run db sync on the node.
|
||||
# Defaults to true
|
||||
#
|
||||
# [*opendaylight_host*]
|
||||
# (Optional) IP or hostname of the opendaylight server.
|
||||
# Defaults to '127.0.0.1'
|
||||
#
|
||||
# [*opendaylight_port*]
|
||||
# (Optional) Port of the opendaylight server.
|
||||
# Defaults to 8081 so it doesn't conflict with swift proxy.
|
||||
#
|
||||
# [*opendaylight_username*]
|
||||
# (Optional) Username to auth to the opendaylight server.
|
||||
# Defaults to admin, which is the ODL default.
|
||||
#
|
||||
# [*opendaylight_password*]
|
||||
# (Optional) Password to auth to the opendaylight server.
|
||||
# Defaults to admin, which is the ODL default.
|
||||
#
|
||||
# [*heat_uri*]
|
||||
# (Optional) Heat URI to access Heat API server.
|
||||
# Defaults to false.
|
||||
#
|
||||
# == Dependencies
|
||||
# None
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# class { 'tacker':
|
||||
# keystone_password => 'tacker',
|
||||
# keystone_tenant => 'service',
|
||||
# auth_uri => 'http://192.168.122.6:5000/',
|
||||
# identity_uri => 'http://192.168.122.6:35357/',
|
||||
# database_connection => 'mysql://tacker:password@192.168.122.6/tacker',
|
||||
# rabbit_host => '192.168.122.6',
|
||||
# rabbit_password => 'guest',
|
||||
# }
|
||||
#
|
||||
# class { 'tacker::db::mysql':
|
||||
# password => 'password',
|
||||
# host => '192.168.122.6',
|
||||
# }
|
||||
#
|
||||
# class { 'tacker::keystone::auth':
|
||||
# password => 'tacker',
|
||||
# tenant => 'service',
|
||||
# admin_url => 'http://192.168.122.6:8888',
|
||||
# internal_url => 'http://192.168.122.6:8888',
|
||||
# public_url => 'http://192.168.122.6:8888',
|
||||
# region => 'regionOne',
|
||||
# }
|
||||
#
|
||||
# == Authors
|
||||
#
|
||||
# Dan Radez <dradez@redhat.com>
|
||||
# Tim Rozet <trozet@redhat.com>
|
||||
# == Copyright
|
||||
#
|
||||
# Copyright 2015 Red Hat Inc, unless otherwise noted.
|
||||
#
|
||||
class tacker {
|
||||
|
||||
class tacker(
|
||||
$keystone_password,
|
||||
$package_ensure = 'present',
|
||||
$client_package_ensure = 'present',
|
||||
$bind_host = '0.0.0.0',
|
||||
$bind_port = '8888',
|
||||
$verbose = undef,
|
||||
$debug = undef,
|
||||
$auth_type = 'keystone',
|
||||
$auth_uri = false,
|
||||
$identity_uri = false,
|
||||
$keystone_tenant = 'services',
|
||||
$keystone_user = 'tacker',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$database_connection = undef,
|
||||
$database_idle_timeout = undef,
|
||||
$database_max_retries = undef,
|
||||
$database_retry_interval = undef,
|
||||
$database_min_pool_size = undef,
|
||||
$database_max_pool_size = undef,
|
||||
$database_max_overflow = undef,
|
||||
$sync_db = true,
|
||||
$rpc_backend = 'rabbit',
|
||||
$control_exchange = 'tacker',
|
||||
$rabbit_host = '127.0.0.1',
|
||||
$rabbit_port = 5672,
|
||||
$rabbit_hosts = false,
|
||||
$rabbit_virtual_host = '/',
|
||||
$rabbit_heartbeat_timeout_threshold = 0,
|
||||
$rabbit_heartbeat_rate = 2,
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_password = false,
|
||||
$rabbit_use_ssl = false,
|
||||
$kombu_ssl_ca_certs = $::os_service_default,
|
||||
$kombu_ssl_certfile = $::os_service_default,
|
||||
$kombu_ssl_keyfile = $::os_service_default,
|
||||
$kombu_ssl_version = $::os_service_default,
|
||||
$kombu_reconnect_delay = $::os_service_default,
|
||||
$amqp_durable_queues = false,
|
||||
$service_provider = $::tacker::params::service_provider,
|
||||
$service_name = $::tacker::params::service_name,
|
||||
$opendaylight_host = '127.0.0.1',
|
||||
$opendaylight_port = 8081,
|
||||
$opendaylight_username = 'admin',
|
||||
$opendaylight_password = 'admin',
|
||||
$heat_uri = false,
|
||||
) inherits tacker::params {
|
||||
tacker_config {
|
||||
'DEFAULT/service_plugins' : value => 'tacker.vm.plugin.VNFMPlugin,tacker.sfc.plugin.SFCPlugin,tacker.sfc_classifier.plugin.SFCCPlugin';
|
||||
'servicevm/infra_driver' : value => 'heat';
|
||||
'servicevm_heat/stack_retries' : value => '10';
|
||||
'servicevm_heat/stack_retry_wait' : value => '30';
|
||||
'sfc/infra_driver' : value => 'opendaylight';
|
||||
'sfc_opendaylight/ip' : value => $opendaylight_host;
|
||||
'sfc_opendaylight/port' : value => $opendaylight_port;
|
||||
'sfc_opendaylight/username' : value => $opendaylight_username;
|
||||
'sfc_opendaylight/password' : value => $opendaylight_password;
|
||||
}
|
||||
|
||||
if $identity_uri {
|
||||
tacker_config { 'keystone_authtoken/identity_uri': value => $identity_uri; }
|
||||
tacker_config { 'keystone_authtoken/auth_url' : value => $identity_uri; }
|
||||
} else {
|
||||
tacker_config { 'keystone_authtoken/identity_uri': ensure => absent; }
|
||||
}
|
||||
|
||||
if $auth_uri {
|
||||
tacker_config { 'keystone_authtoken/auth_uri': value => $auth_uri; }
|
||||
} else {
|
||||
tacker_config { 'keystone_authtoken/auth_uri': ensure => absent; }
|
||||
}
|
||||
|
||||
if $heat_uri {
|
||||
tacker_config { 'servicevm_heat/heat_uri': value => $heat_uri; }
|
||||
}
|
||||
|
||||
if $auth_type == 'keystone' {
|
||||
tacker_config {
|
||||
'keystone_authtoken/project_name' : value => $keystone_tenant;
|
||||
'keystone_authtoken/username' : value => $keystone_user;
|
||||
'keystone_authtoken/password' : value => $keystone_password, secret => true;
|
||||
}
|
||||
}
|
||||
|
||||
Tacker_config<||> ~> Service[$service_name]
|
||||
Tacker_config<||> ~> Exec<| title == 'tacker-manage db_sync'|>
|
||||
|
||||
include ::tacker::db
|
||||
include ::tacker::params
|
||||
|
||||
if $sync_db {
|
||||
include ::tacker::db::sync
|
||||
Class['::tacker::db::sync'] ~> Service[$service_name]
|
||||
}
|
||||
if $rpc_backend == 'rabbit' {
|
||||
|
||||
if ! $rabbit_password {
|
||||
fail('Please specify a rabbit_password parameter.')
|
||||
}
|
||||
|
||||
tacker_config {
|
||||
'DEFAULT/rabbit_password': value => $rabbit_password, secret => true;
|
||||
'DEFAULT/rabbit_userid': value => $rabbit_userid;
|
||||
'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||
'DEFAULT/control_exchange': value => $control_exchange;
|
||||
#'DEFAULT/rabbit_use_ssl': value => $rabbit_use_ssl;
|
||||
#'DEFAULT/kombu_reconnect_delay': value => $kombu_reconnect_delay;
|
||||
#'DEFAULT/heartbeat_timeout_threshold': value => $rabbit_heartbeat_timeout_threshold;
|
||||
#'DEFAULT/heartbeat_rate': value => $rabbit_heartbeat_rate;
|
||||
#'DEFAULT/amqp_durable_queues': value => $amqp_durable_queues;
|
||||
}
|
||||
|
||||
if $rabbit_use_ssl {
|
||||
tacker_config {
|
||||
'DEFAULT/kombu_ssl_version' : value => $kombu_ssl_version;
|
||||
'DEFAULT/kombu_ssl_ca_certs' : value => $kombu_ssl_ca_certs;
|
||||
'DEFAULT/kombu_ssl_certfile' : value => $kombu_ssl_certfile;
|
||||
'DEFAULT/kombu_ssl_keyfile' : value => $kombu_ssl_keyfile;
|
||||
}
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
tacker_config { 'DEFAULT/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
tacker_config { 'DEFAULT/rabbit_ha_queues': value => true }
|
||||
tacker_config { 'DEFAULT/rabbit_host': ensure => absent }
|
||||
tacker_config { 'DEFAULT/rabbit_port': ensure => absent }
|
||||
} else {
|
||||
tacker_config { 'DEFAULT/rabbit_host': value => $rabbit_host }
|
||||
tacker_config { 'DEFAULT/rabbit_port': value => $rabbit_port }
|
||||
tacker_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
tacker_config { 'DEFAULT/rabbit_ha_queues': value => false }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package { 'tacker':
|
||||
ensure => $package_ensure,
|
||||
name => $::tacker::params::package_name,
|
||||
tag => ['openstack', 'tacker-package'],
|
||||
}
|
||||
if $client_package_ensure == 'present' {
|
||||
include '::tacker::client'
|
||||
} else {
|
||||
class { '::tacker::client':
|
||||
ensure => $client_package_ensure,
|
||||
}
|
||||
}
|
||||
|
||||
group { 'tacker':
|
||||
ensure => present,
|
||||
system => true,
|
||||
require => Package['tacker'],
|
||||
}
|
||||
|
||||
user { 'tacker':
|
||||
ensure => 'present',
|
||||
gid => 'tacker',
|
||||
system => true,
|
||||
require => Package['tacker'],
|
||||
}
|
||||
|
||||
file { ['/etc/tacker', '/var/log/tacker', '/var/lib/tacker']:
|
||||
ensure => directory,
|
||||
mode => '0750',
|
||||
owner => 'tacker',
|
||||
group => 'tacker',
|
||||
require => Package['tacker'],
|
||||
notify => Service[$service_name],
|
||||
}
|
||||
|
||||
file { '/etc/tacker/tacker.conf':
|
||||
ensure => present,
|
||||
mode => '0600',
|
||||
owner => 'tacker',
|
||||
group => 'tacker',
|
||||
require => Package['tacker'],
|
||||
notify => Service[$service_name],
|
||||
}
|
||||
|
||||
tacker_config {
|
||||
'DEFAULT/bind_host': value => $bind_host;
|
||||
'DEFAULT/bind_port': value => $bind_port;
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
}
|
||||
|
||||
class { '::tacker::service':
|
||||
ensure => $service_ensure,
|
||||
service_name => $service_name,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
provider => $service_provider,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,27 +28,29 @@
|
|||
# Defaults to 'true'.
|
||||
#
|
||||
# [*service_type*]
|
||||
# Type of service. Defaults to 'NFV'.
|
||||
#
|
||||
# [*admin_url*]
|
||||
# (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:8888')
|
||||
# This url should *not* contain any version or trailing '/'.
|
||||
#
|
||||
# [*internal_url*]
|
||||
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:8888')
|
||||
# This url should *not* contain any version or trailing '/'.
|
||||
#
|
||||
# [*public_url*]
|
||||
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:8888')
|
||||
# This url should *not* contain any version or trailing '/'.
|
||||
# Type of service. Defaults to 'nfv-orchestration'.
|
||||
#
|
||||
# [*region*]
|
||||
# Region for endpoint. Defaults to 'RegionOne'.
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service.
|
||||
# Defaults to the value of auth_name.
|
||||
# Defaults to the value of 'tacker'.
|
||||
#
|
||||
# [*service_description*]
|
||||
# (optional) Description of the service.
|
||||
# Default to 'tacker NFV orchestration Service'
|
||||
#
|
||||
# [*public_url*]
|
||||
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:9890')
|
||||
# This url should *not* contain any trailing '/'.
|
||||
#
|
||||
# [*admin_url*]
|
||||
# (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:9890')
|
||||
# This url should *not* contain any trailing '/'.
|
||||
#
|
||||
# [*internal_url*]
|
||||
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:9890')
|
||||
#
|
||||
class tacker::keystone::auth (
|
||||
$password,
|
||||
|
@ -58,36 +60,35 @@ class tacker::keystone::auth (
|
|||
$configure_endpoint = true,
|
||||
$configure_user = true,
|
||||
$configure_user_role = true,
|
||||
$service_name = undef,
|
||||
$service_type = 'servicevm',
|
||||
$admin_url = 'http://127.0.0.1:8888',
|
||||
$internal_url = 'http://127.0.0.1:8888',
|
||||
$public_url = 'http://127.0.0.1:8888',
|
||||
$region = 'RegionOne'
|
||||
$service_name = 'tacker',
|
||||
$service_description = 'tacker NFV orchestration Service',
|
||||
$service_type = 'nfv-orchestration',
|
||||
$region = 'RegionOne',
|
||||
$public_url = 'http://127.0.0.1:9890',
|
||||
$admin_url = 'http://127.0.0.1:9890',
|
||||
$internal_url = 'http://127.0.0.1:9890',
|
||||
) {
|
||||
|
||||
$real_service_name = pick($service_name, $auth_name)
|
||||
|
||||
if $configure_user_role {
|
||||
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'tacker-server' |>
|
||||
}
|
||||
Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'tacker-server' |>
|
||||
Keystone_endpoint["${region}/${service_name}::${service_type}"] ~> Service <| name == 'tacker-server' |>
|
||||
|
||||
keystone::resource::service_identity { 'tacker':
|
||||
configure_user => $configure_user,
|
||||
configure_user_role => $configure_user_role,
|
||||
configure_endpoint => $configure_endpoint,
|
||||
service_name => $real_service_name,
|
||||
service_name => $service_name,
|
||||
service_type => $service_type,
|
||||
service_description => 'tacker VNF Manager service',
|
||||
service_description => $service_description,
|
||||
region => $region,
|
||||
auth_name => $auth_name,
|
||||
password => $password,
|
||||
email => $email,
|
||||
tenant => $tenant,
|
||||
admin_url => "${admin_url}/",
|
||||
internal_url => "${internal_url}/",
|
||||
public_url => "${public_url}/",
|
||||
public_url => $public_url,
|
||||
internal_url => $internal_url,
|
||||
admin_url => $admin_url,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,61 +4,61 @@
|
|||
#
|
||||
# == parameters
|
||||
#
|
||||
# [*verbose*]
|
||||
# (Optional) Should the daemons log verbose messages
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*debug*]
|
||||
# (Optional) Should the daemons log debug messages
|
||||
# Defaults to false.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*use_syslog*]
|
||||
# (Optional) Use syslog for logging.
|
||||
# Defaults to false.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*use_stderr*]
|
||||
# (optional) Use stderr for logging
|
||||
# Defaults to true.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*log_facility*]
|
||||
# [*syslog_log_facility*]
|
||||
# (Optional) Syslog facility to receive log lines.
|
||||
# Defaults to 'LOG_USER'.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*log_dir*]
|
||||
# (optional) Directory where logs should be stored.
|
||||
# If set to boolean false, it will not log to any directory.
|
||||
# Defaults to '/var/log/tacker'.
|
||||
#
|
||||
# [*log_file*]
|
||||
# (optional) File where logs should be stored.
|
||||
# Defaults to '/var/log/tacker/tacker.log'
|
||||
#
|
||||
# [*logging_context_format_string*]
|
||||
# (optional) Format string to use for log messages with context.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
||||
# [%(request_id)s %(user_identity)s] %(instance)s%(message)s'
|
||||
#
|
||||
# [*logging_default_format_string*]
|
||||
# (optional) Format string to use for log messages without context.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s\
|
||||
# [-] %(instance)s%(message)s'
|
||||
#
|
||||
# [*logging_debug_format_suffix*]
|
||||
# (optional) Formatted data to append to log format when level is DEBUG.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: '%(funcName)s %(pathname)s:%(lineno)d'
|
||||
#
|
||||
# [*logging_exception_prefix*]
|
||||
# (optional) Prefix each line of exception output with this format.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
|
||||
#
|
||||
# [*log_config_append*]
|
||||
# The name of an additional logging configuration file.
|
||||
# Defaults to undef.
|
||||
# (optional) The name of an additional logging configuration file.
|
||||
# Defaults to $::os_service_default
|
||||
# See https://docs.python.org/2/howto/logging.html
|
||||
#
|
||||
# [*default_log_levels*]
|
||||
# (optional) Hash of logger (keys) and level (values) pairs.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example:
|
||||
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
|
||||
# 'qpid' => 'WARN', 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
|
||||
|
@ -70,11 +70,11 @@
|
|||
#
|
||||
# [*publish_errors*]
|
||||
# (optional) Publish error events (boolean value).
|
||||
# Defaults to undef (false if unconfigured).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*fatal_deprecations*]
|
||||
# (optional) Make deprecations fatal (boolean value)
|
||||
# Defaults to undef (false if unconfigured).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*instance_format*]
|
||||
# (optional) If an instance is passed with the log message, format it
|
||||
|
@ -85,167 +85,51 @@
|
|||
# [*instance_uuid_format*]
|
||||
# (optional) If an instance UUID is passed with the log message, format
|
||||
# it like this (string value).
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: instance_uuid_format='[instance: %(uuid)s] '
|
||||
#
|
||||
# [*log_date_format*]
|
||||
# (optional) Format string for %%(asctime)s in log records.
|
||||
# Defaults to undef.
|
||||
# Defaults to $::os_service_default
|
||||
# Example: 'Y-%m-%d %H:%M:%S'
|
||||
|
||||
class tacker::logging(
|
||||
$use_syslog = false,
|
||||
$use_stderr = true,
|
||||
$log_facility = 'LOG_USER',
|
||||
$use_syslog = $::os_service_default,
|
||||
$use_stderr = $::os_service_default,
|
||||
$syslog_log_facility = $::os_service_default,
|
||||
$log_dir = '/var/log/tacker',
|
||||
$verbose = false,
|
||||
$debug = false,
|
||||
$logging_context_format_string = undef,
|
||||
$logging_default_format_string = undef,
|
||||
$logging_debug_format_suffix = undef,
|
||||
$logging_exception_prefix = undef,
|
||||
$log_config_append = undef,
|
||||
$default_log_levels = undef,
|
||||
$publish_errors = undef,
|
||||
$fatal_deprecations = undef,
|
||||
$instance_format = undef,
|
||||
$instance_uuid_format = undef,
|
||||
$log_date_format = undef,
|
||||
$log_file = '/var/log/tacker/tacker.log',
|
||||
$debug = $::os_service_default,
|
||||
$logging_context_format_string = $::os_service_default,
|
||||
$logging_default_format_string = $::os_service_default,
|
||||
$logging_debug_format_suffix = $::os_service_default,
|
||||
$logging_exception_prefix = $::os_service_default,
|
||||
$log_config_append = $::os_service_default,
|
||||
$default_log_levels = $::os_service_default,
|
||||
$publish_errors = $::os_service_default,
|
||||
$fatal_deprecations = $::os_service_default,
|
||||
$instance_format = $::os_service_default,
|
||||
$instance_uuid_format = $::os_service_default,
|
||||
$log_date_format = $::os_service_default,
|
||||
) {
|
||||
|
||||
tacker_config {
|
||||
'DEFAULT/use_syslog' : value => $use_syslog;
|
||||
'DEFAULT/use_stderr' : value => $use_stderr;
|
||||
'DEFAULT/log_dir' : value => $log_dir;
|
||||
'DEFAULT/verbose' : value => $verbose;
|
||||
'DEFAULT/debug' : value => $debug;
|
||||
'DEFAULT/syslog_log_facility' : value => $log_facility;
|
||||
oslo::log { 'tacker_config':
|
||||
use_stderr => $use_stderr,
|
||||
use_syslog => $use_syslog,
|
||||
log_dir => $log_dir,
|
||||
log_file => $log_file,
|
||||
debug => $debug,
|
||||
logging_context_format_string => $logging_context_format_string,
|
||||
logging_default_format_string => $logging_default_format_string,
|
||||
logging_debug_format_suffix => $logging_debug_format_suffix,
|
||||
logging_exception_prefix => $logging_exception_prefix,
|
||||
log_config_append => $log_config_append,
|
||||
default_log_levels => $default_log_levels,
|
||||
publish_errors => $publish_errors,
|
||||
fatal_deprecations => $fatal_deprecations,
|
||||
instance_format => $instance_format,
|
||||
instance_uuid_format => $instance_uuid_format,
|
||||
log_date_format => $log_date_format,
|
||||
syslog_log_facility => $syslog_log_facility,
|
||||
}
|
||||
|
||||
if $logging_context_format_string {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_context_format_string' :
|
||||
value => $logging_context_format_string;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_context_format_string' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_default_format_string {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_default_format_string' :
|
||||
value => $logging_default_format_string;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_default_format_string' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_debug_format_suffix {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_debug_format_suffix' :
|
||||
value => $logging_debug_format_suffix;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_debug_format_suffix' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $logging_exception_prefix {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_exception_prefix' : value => $logging_exception_prefix;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/logging_exception_prefix' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $log_config_append {
|
||||
tacker_config {
|
||||
'DEFAULT/log_config_append' : value => $log_config_append;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/log_config_append' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $default_log_levels {
|
||||
tacker_config {
|
||||
'DEFAULT/default_log_levels' :
|
||||
value => join(sort(join_keys_to_values($default_log_levels, '=')), ',');
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/default_log_levels' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $publish_errors {
|
||||
tacker_config {
|
||||
'DEFAULT/publish_errors' : value => $publish_errors;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/publish_errors' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $fatal_deprecations {
|
||||
tacker_config {
|
||||
'DEFAULT/fatal_deprecations' : value => $fatal_deprecations;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/fatal_deprecations' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $instance_format {
|
||||
tacker_config {
|
||||
'DEFAULT/instance_format' : value => $instance_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/instance_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $instance_uuid_format {
|
||||
tacker_config {
|
||||
'DEFAULT/instance_uuid_format' : value => $instance_uuid_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/instance_uuid_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $log_date_format {
|
||||
tacker_config {
|
||||
'DEFAULT/log_date_format' : value => $log_date_format;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tacker_config {
|
||||
'DEFAULT/log_date_format' : ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,31 +1,15 @@
|
|||
#
|
||||
# This class contains the platform differences for tacker
|
||||
# Parameters for puppet-tacker
|
||||
#
|
||||
class tacker::params {
|
||||
$client_package_name = 'python-tackerclient'
|
||||
|
||||
case $::osfamily {
|
||||
'Debian': {
|
||||
$package_name = 'tacker'
|
||||
$service_name = 'tacker'
|
||||
$python_memcache_package_name = 'python-memcache'
|
||||
$sqlite_package_name = 'python-pysqlite2'
|
||||
$paste_config = undef
|
||||
case $::operatingsystem {
|
||||
'Debian': {
|
||||
$service_provider = undef
|
||||
}
|
||||
default: {
|
||||
$service_provider = 'upstart'
|
||||
}
|
||||
}
|
||||
}
|
||||
'RedHat': {
|
||||
$package_name = 'openstack-tacker'
|
||||
$service_name = 'openstack-tacker'
|
||||
$python_memcache_package_name = 'python-memcached'
|
||||
$sqlite_package_name = undef
|
||||
$service_provider = undef
|
||||
}
|
||||
}
|
||||
'Debian': {
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem")
|
||||
}
|
||||
|
||||
} # Case $::osfamily
|
||||
}
|
||||
|
|
|
@ -36,4 +36,6 @@ class tacker::policy (
|
|||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
oslo::policy { 'tacker_config': policy_file => $policy_path }
|
||||
|
||||
}
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
# == Class tacker::service
|
||||
#
|
||||
# Encapsulates the tacker service to a class.
|
||||
# This allows resources that require tacker to
|
||||
# require this class, which can optionally
|
||||
# validate that the service can actually accept
|
||||
# connections.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*ensure*]
|
||||
# (optional) The desired state of the tacker service
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*service_name*]
|
||||
# (optional) The name of the tacker service
|
||||
# Defaults to $::tacker::params::service_name
|
||||
#
|
||||
# [*enable*]
|
||||
# (optional) Whether to enable the tacker service
|
||||
# Defaults to true
|
||||
#
|
||||
# [*hasstatus*]
|
||||
# (optional) Whether the tacker service has status
|
||||
# Defaults to true
|
||||
#
|
||||
# [*hasrestart*]
|
||||
# (optional) Whether the tacker service has restart
|
||||
# Defaults to true
|
||||
#
|
||||
# [*provider*]
|
||||
# (optional) Provider for tacker service
|
||||
# Defaults to $::tacker::params::service_provider
|
||||
#
|
||||
class tacker::service(
|
||||
$ensure = undef,
|
||||
$service_name = $::tacker::params::service_name,
|
||||
$enable = true,
|
||||
$hasstatus = true,
|
||||
$hasrestart = true,
|
||||
$provider = $::tacker::params::service_provider,
|
||||
) {
|
||||
include ::tacker::params
|
||||
|
||||
service { 'tacker':
|
||||
ensure => $ensure,
|
||||
name => $service_name,
|
||||
enable => $enable,
|
||||
hasstatus => $hasstatus,
|
||||
hasrestart => $hasrestart,
|
||||
provider => $provider,
|
||||
tag => 'tacker-service',
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "puppet-tacker",
|
||||
"name": "openstack-tacker",
|
||||
"version": "0.0.1",
|
||||
"author": "OpenStack Contributors",
|
||||
"summary": "Puppet module for OpenStack Tacker",
|
||||
|
@ -29,6 +29,7 @@
|
|||
"dependencies": [
|
||||
{ "name": "puppetlabs/inifile", "version_requirement": ">=1.0.0 <2.0.0" },
|
||||
{ "name": "puppetlabs/stdlib", "version_requirement": ">= 4.2.0 <5.0.0" },
|
||||
{ "name": "stackforge/openstacklib", "version_requirement": ">=5.0.0 <6.0.0" }
|
||||
{ "name": "openstack/openstacklib", "version_requirement": ">=8.0.0 <9.0.0" },
|
||||
{ "name": "openstack/oslo", "version_requirement": "<9.0.0" }
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
HOSTS:
|
||||
centos-server-70-x64:
|
||||
roles:
|
||||
- master
|
||||
platform: el-7-x86_64
|
||||
box: puppetlabs/centos-7.0-64-nocm
|
||||
box_url: https://vagrantcloud.com/puppetlabs/centos-7.0-64-nocm
|
||||
hypervisor: vagrant
|
||||
CONFIG:
|
||||
log_level: debug
|
||||
type: foss
|
|
@ -0,0 +1,10 @@
|
|||
HOSTS:
|
||||
ubuntu-server-14.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-14.04-amd64
|
||||
box: puppetlabs/ubuntu-14.04-64-nocm
|
||||
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
|
||||
hypervisor: vagrant
|
||||
CONFIG:
|
||||
type: foss
|
|
@ -0,0 +1,10 @@
|
|||
HOSTS:
|
||||
centos-70-x64:
|
||||
roles:
|
||||
- master
|
||||
platform: el-7-x86_64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -0,0 +1,10 @@
|
|||
HOSTS:
|
||||
ubuntu-14.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-14.04-amd64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -0,0 +1,10 @@
|
|||
HOSTS:
|
||||
ubuntu-16.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-16.04-amd64
|
||||
hypervisor: none
|
||||
ip: 127.0.0.1
|
||||
CONFIG:
|
||||
type: foss
|
||||
set_env: false
|
|
@ -0,0 +1,11 @@
|
|||
HOSTS:
|
||||
ubuntu-server-14.04-amd64:
|
||||
roles:
|
||||
- master
|
||||
platform: ubuntu-14.04-amd64
|
||||
box: puppetlabs/ubuntu-14.04-64-nocm
|
||||
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
|
||||
hypervisor: vagrant
|
||||
CONFIG:
|
||||
log_level: debug
|
||||
type: foss
|
|
@ -3,60 +3,71 @@ require 'spec_helper'
|
|||
describe 'tacker::db::mysql' do
|
||||
|
||||
let :pre_condition do
|
||||
[
|
||||
'include mysql::server',
|
||||
'include tacker::db::sync'
|
||||
]
|
||||
'include mysql::server'
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
let :required_params do
|
||||
{ :password => 'fooboozoo_default_password', }
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
'password' => 'fooboozoo_default_password',
|
||||
}
|
||||
end
|
||||
shared_examples_for 'tacker-db-mysql' do
|
||||
context 'with only required params' do
|
||||
let :params do
|
||||
required_params
|
||||
end
|
||||
|
||||
describe 'with only required params' do
|
||||
it { is_expected.to contain_openstacklib__db__mysql('tacker').with(
|
||||
'user' => 'tacker',
|
||||
'password_hash' => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||
'dbname' => 'tacker',
|
||||
'host' => '127.0.0.1',
|
||||
'charset' => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
)}
|
||||
end
|
||||
it { is_expected.to contain_openstacklib__db__mysql('tacker').with(
|
||||
:user => 'tacker',
|
||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||
:dbname => 'tacker',
|
||||
:host => '127.0.0.1',
|
||||
:charset => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
)}
|
||||
end
|
||||
|
||||
describe "overriding allowed_hosts param to array" do
|
||||
let :params do
|
||||
{
|
||||
:password => 'tackerpass',
|
||||
context 'overriding allowed_hosts param to array' do
|
||||
let :params do
|
||||
{ :allowed_hosts => ['127.0.0.1','%'] }.merge(required_params)
|
||||
end
|
||||
|
||||
it { is_expected.to contain_openstacklib__db__mysql('tacker').with(
|
||||
:user => 'tacker',
|
||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||
:dbname => 'tacker',
|
||||
:host => '127.0.0.1',
|
||||
:charset => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
:allowed_hosts => ['127.0.0.1','%']
|
||||
}
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
||||
describe "overriding allowed_hosts param to string" do
|
||||
let :params do
|
||||
{
|
||||
:password => 'tackerpass2',
|
||||
describe 'overriding allowed_hosts param to string' do
|
||||
let :params do
|
||||
{ :allowed_hosts => '192.168.1.1' }.merge(required_params)
|
||||
end
|
||||
|
||||
it { is_expected.to contain_openstacklib__db__mysql('tacker').with(
|
||||
:user => 'tacker',
|
||||
:password_hash => '*3DDF34A86854A312A8E2C65B506E21C91800D206',
|
||||
:dbname => 'tacker',
|
||||
:host => '127.0.0.1',
|
||||
:charset => 'utf8',
|
||||
:collate => 'utf8_general_ci',
|
||||
:allowed_hosts => '192.168.1.1'
|
||||
}
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "overriding allowed_hosts param equals to host param " do
|
||||
let :params do
|
||||
{
|
||||
:password => 'tackerpass2',
|
||||
:allowed_hosts => '127.0.0.1'
|
||||
}
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'tacker-db-mysql'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,26 +2,18 @@ require 'spec_helper'
|
|||
|
||||
describe 'tacker::db::postgresql' do
|
||||
|
||||
let :req_params do
|
||||
{ :password => 'pw' }
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
'include postgresql::server'
|
||||
end
|
||||
|
||||
context 'on a RedHat osfamily' do
|
||||
let :facts do
|
||||
{
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.0',
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}
|
||||
end
|
||||
let :required_params do
|
||||
{ :password => 'pw' }
|
||||
end
|
||||
|
||||
shared_examples_for 'tacker-db-postgresql' do
|
||||
context 'with only required parameters' do
|
||||
let :params do
|
||||
req_params
|
||||
required_params
|
||||
end
|
||||
|
||||
it { is_expected.to contain_postgresql__server__db('tacker').with(
|
||||
|
@ -29,30 +21,17 @@ describe 'tacker::db::postgresql' do
|
|||
:password => 'md54fb52f4ce3618bd50cf38d2b7399db7a'
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'on a Debian osfamily' do
|
||||
let :facts do
|
||||
{
|
||||
:operatingsystemrelease => '7.8',
|
||||
:operatingsystem => 'Debian',
|
||||
:osfamily => 'Debian',
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}
|
||||
end
|
||||
|
||||
context 'with only required parameters' do
|
||||
let :params do
|
||||
req_params
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts({ :concat_basedir => '/var/lib/puppet/concat' }))
|
||||
end
|
||||
|
||||
it { is_expected.to contain_postgresql__server__db('tacker').with(
|
||||
:user => 'tacker',
|
||||
:password => 'md54fb52f4ce3618bd50cf38d2b7399db7a'
|
||||
)}
|
||||
it_behaves_like 'tacker-db-postgresql'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -5,17 +5,17 @@ describe 'tacker::db' do
|
|||
shared_examples 'tacker::db' do
|
||||
context 'with default parameters' do
|
||||
it { is_expected.to contain_tacker_config('database/connection').with_value('sqlite:////var/lib/tacker/tacker.sqlite') }
|
||||
it { is_expected.to contain_tacker_config('database/idle_timeout').with_value('3600') }
|
||||
it { is_expected.to contain_tacker_config('database/min_pool_size').with_value('1') }
|
||||
it { is_expected.to contain_tacker_config('database/max_retries').with_value('10') }
|
||||
it { is_expected.to contain_tacker_config('database/retry_interval').with_value('10') }
|
||||
it { is_expected.to contain_tacker_config('database/max_pool_size').with_value('10') }
|
||||
it { is_expected.to contain_tacker_config('database/max_overflow').with_value('20') }
|
||||
it { is_expected.to contain_tacker_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_tacker_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_tacker_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_tacker_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_tacker_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_tacker_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql://tacker:tacker@localhost/tacker',
|
||||
{ :database_connection => 'mysql+pymysql://tacker:tacker@localhost/tacker',
|
||||
:database_idle_timeout => '3601',
|
||||
:database_min_pool_size => '2',
|
||||
:database_max_retries => '11',
|
||||
|
@ -25,7 +25,7 @@ describe 'tacker::db' do
|
|||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_tacker_config('database/connection').with_value('mysql://tacker:tacker@localhost/tacker') }
|
||||
it { is_expected.to contain_tacker_config('database/connection').with_value('mysql+pymysql://tacker:tacker@localhost/tacker') }
|
||||
it { is_expected.to contain_tacker_config('database/idle_timeout').with_value('3601') }
|
||||
it { is_expected.to contain_tacker_config('database/min_pool_size').with_value('2') }
|
||||
it { is_expected.to contain_tacker_config('database/max_retries').with_value('11') }
|
||||
|
@ -45,34 +45,70 @@ describe 'tacker::db' do
|
|||
|
||||
end
|
||||
|
||||
context 'with MySQL-python library as backend package' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql://tacker:tacker@localhost/tacker', }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('python-mysqldb').with(:ensure => 'present') }
|
||||
end
|
||||
|
||||
context 'with incorrect database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'redis://tacker:tacker@localhost/tacker', }
|
||||
{ :database_connection => 'foodb://tacker:tacker@localhost/tacker', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => 'jessie',
|
||||
}
|
||||
context 'with incorrect pymysql database_connection string' do
|
||||
let :params do
|
||||
{ :database_connection => 'foo+pymysql://tacker:tacker@localhost/tacker', }
|
||||
end
|
||||
|
||||
it_raises 'a Puppet::Error', /validate_re/
|
||||
end
|
||||
|
||||
it_configures 'tacker::db'
|
||||
end
|
||||
|
||||
context 'on Redhat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.1',
|
||||
}
|
||||
shared_examples_for 'tacker::db on Debian' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://tacker:tacker@localhost/tacker', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
is_expected.to contain_package('db_backend_package').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-pymysql',
|
||||
:tag => 'openstack'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it_configures 'tacker::db'
|
||||
end
|
||||
|
||||
shared_examples_for 'tacker::db on RedHat' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://tacker:tacker@localhost/tacker', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
is_expected.not_to contain_package('db_backend_package')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'tacker::db'
|
||||
it_configures "tacker::db on #{facts[:osfamily]}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,116 +5,124 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'tacker::keystone::auth' do
|
||||
shared_examples_for 'tacker-keystone-auth' do
|
||||
context 'with default class parameters' do
|
||||
let :params do
|
||||
{ :password => 'tacker_password',
|
||||
:tenant => 'foobar' }
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
it { is_expected.to contain_keystone_user('tacker').with(
|
||||
:ensure => 'present',
|
||||
:password => 'tacker_password',
|
||||
) }
|
||||
|
||||
describe 'with default class parameters' do
|
||||
let :params do
|
||||
{ :password => 'tacker_password',
|
||||
:tenant => 'foobar' }
|
||||
it { is_expected.to contain_keystone_user_role('tacker@foobar').with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_service('tacker::nfv-orchestration').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker NFV orchestration Service'
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker::nfv-orchestration').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1:9890',
|
||||
:admin_url => 'http://127.0.0.1:9890',
|
||||
:internal_url => 'http://127.0.0.1:9890',
|
||||
) }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('tacker').with(
|
||||
:ensure => 'present',
|
||||
:password => 'tacker_password',
|
||||
) }
|
||||
context 'when overriding URL parameters' do
|
||||
let :params do
|
||||
{ :password => 'tacker_password',
|
||||
:public_url => 'https://10.10.10.10:80',
|
||||
:internal_url => 'http://10.10.10.11:81',
|
||||
:admin_url => 'http://10.10.10.12:81', }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user_role('tacker@foobar').with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_service('tacker::servicevm').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker VNF Manager service'
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker::servicevm').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'http://127.0.0.1:8888/',
|
||||
:admin_url => 'http://127.0.0.1:8888/',
|
||||
:internal_url => 'http://127.0.0.1:8888/',
|
||||
) }
|
||||
end
|
||||
|
||||
describe 'when overriding URL paramaters' do
|
||||
let :params do
|
||||
{ :password => 'tacker_password',
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker::nfv-orchestration').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.10.10.10:80',
|
||||
:internal_url => 'http://10.10.10.11:81',
|
||||
:admin_url => 'http://10.10.10.12:81', }
|
||||
:admin_url => 'http://10.10.10.12:81',
|
||||
) }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker::servicevm').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.10.10.10:80/',
|
||||
:internal_url => 'http://10.10.10.11:81/',
|
||||
:admin_url => 'http://10.10.10.12:81/',
|
||||
) }
|
||||
end
|
||||
context 'when overriding auth name' do
|
||||
let :params do
|
||||
{ :password => 'foo',
|
||||
:auth_name => 'tackery' }
|
||||
end
|
||||
|
||||
describe 'when overriding auth name' do
|
||||
let :params do
|
||||
{ :password => 'foo',
|
||||
:auth_name => 'tackery' }
|
||||
it { is_expected.to contain_keystone_user('tackery') }
|
||||
it { is_expected.to contain_keystone_user_role('tackery@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker::nfv-orchestration') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker::nfv-orchestration') }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('tackery') }
|
||||
it { is_expected.to contain_keystone_user_role('tackery@services') }
|
||||
it { is_expected.to contain_keystone_service('tackery::servicevm') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tackery::servicevm') }
|
||||
end
|
||||
context 'when overriding service name' do
|
||||
let :params do
|
||||
{ :service_name => 'tacker_service',
|
||||
:auth_name => 'tacker',
|
||||
:password => 'tacker_password' }
|
||||
end
|
||||
|
||||
describe 'when overriding service name' do
|
||||
let :params do
|
||||
{ :service_name => 'tacker_service',
|
||||
:auth_name => 'tacker',
|
||||
:password => 'tacker_password' }
|
||||
it { is_expected.to contain_keystone_user('tacker') }
|
||||
it { is_expected.to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker_service::nfv-orchestration') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker_service::nfv-orchestration') }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('tacker') }
|
||||
it { is_expected.to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker_service::servicevm') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/tacker_service::servicevm') }
|
||||
end
|
||||
context 'when disabling user configuration' do
|
||||
|
||||
describe 'when disabling user configuration' do
|
||||
let :params do
|
||||
{
|
||||
:password => 'tacker_password',
|
||||
:configure_user => false
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.not_to contain_keystone_user('tacker') }
|
||||
it { is_expected.to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker::nfv-orchestration').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker NFV orchestration Service'
|
||||
) }
|
||||
|
||||
let :params do
|
||||
{
|
||||
:password => 'tacker_password',
|
||||
:configure_user => false
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.not_to contain_keystone_user('tacker') }
|
||||
it { is_expected.to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker::servicevm').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker VNF Manager service'
|
||||
) }
|
||||
context 'when disabling user and user role configuration' do
|
||||
|
||||
end
|
||||
let :params do
|
||||
{
|
||||
:password => 'tacker_password',
|
||||
:configure_user => false,
|
||||
:configure_user_role => false
|
||||
}
|
||||
end
|
||||
|
||||
describe 'when disabling user and user role configuration' do
|
||||
it { is_expected.not_to contain_keystone_user('tacker') }
|
||||
it { is_expected.not_to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker::nfv-orchestration').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker NFV orchestration Service'
|
||||
) }
|
||||
|
||||
let :params do
|
||||
{
|
||||
:password => 'tacker_password',
|
||||
:configure_user => false,
|
||||
:configure_user_role => false
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.not_to contain_keystone_user('tacker') }
|
||||
it { is_expected.not_to contain_keystone_user_role('tacker@services') }
|
||||
it { is_expected.to contain_keystone_service('tacker::servicevm').with(
|
||||
:ensure => 'present',
|
||||
:description => 'tacker VNF Manager service'
|
||||
) }
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'tacker-keystone-auth'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,9 +26,9 @@ describe 'tacker::logging' do
|
|||
:log_date_format => '%Y-%m-%d %H:%M:%S',
|
||||
:use_syslog => true,
|
||||
:use_stderr => false,
|
||||
:log_facility => 'LOG_FOO',
|
||||
:syslog_log_facility => 'LOG_FOO',
|
||||
:log_dir => '/var/log',
|
||||
:verbose => true,
|
||||
:log_file => '/var/log/tacker.log',
|
||||
:debug => true,
|
||||
}
|
||||
end
|
||||
|
@ -57,12 +57,12 @@ describe 'tacker::logging' do
|
|||
|
||||
shared_examples 'basic default logging settings' do
|
||||
it 'configures tacker logging settins with default values' do
|
||||
is_expected.to contain_tacker_config('DEFAULT/use_syslog').with(:value => 'false')
|
||||
is_expected.to contain_tacker_config('DEFAULT/use_stderr').with(:value => 'true')
|
||||
is_expected.to contain_tacker_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER')
|
||||
is_expected.to contain_tacker_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/log_dir').with(:value => '/var/log/tacker')
|
||||
is_expected.to contain_tacker_config('DEFAULT/verbose').with(:value => 'false')
|
||||
is_expected.to contain_tacker_config('DEFAULT/debug').with(:value => 'false')
|
||||
is_expected.to contain_tacker_config('DEFAULT/log_file').with(:value => '/var/log/tacker/tacker.log')
|
||||
is_expected.to contain_tacker_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -72,7 +72,7 @@ describe 'tacker::logging' do
|
|||
is_expected.to contain_tacker_config('DEFAULT/use_stderr').with(:value => 'false')
|
||||
is_expected.to contain_tacker_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
|
||||
is_expected.to contain_tacker_config('DEFAULT/log_dir').with(:value => '/var/log')
|
||||
is_expected.to contain_tacker_config('DEFAULT/verbose').with(:value => 'true')
|
||||
is_expected.to contain_tacker_config('DEFAULT/log_file').with(:value => '/var/log/tacker.log')
|
||||
is_expected.to contain_tacker_config('DEFAULT/debug').with(:value => 'true')
|
||||
end
|
||||
end
|
||||
|
@ -121,24 +121,19 @@ describe 'tacker::logging' do
|
|||
:default_log_levels, :fatal_deprecations,
|
||||
:instance_format, :instance_uuid_format,
|
||||
:log_date_format, ].each { |param|
|
||||
it { is_expected.to contain_tacker_config("DEFAULT/#{param}").with_ensure('absent') }
|
||||
it { is_expected.to contain_tacker_config("DEFAULT/#{param}").with_value('<SERVICE DEFAULT>') }
|
||||
}
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'tacker-logging'
|
||||
end
|
||||
|
||||
it_configures 'tacker-logging'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
it_configures 'tacker-logging'
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'tacker::policy' do
|
||||
|
||||
shared_examples_for 'tacker policies' do
|
||||
shared_examples_for 'tacker-policies' do
|
||||
let :params do
|
||||
{
|
||||
:policy_path => '/etc/tacker/policy.json',
|
||||
|
@ -23,19 +22,15 @@ describe 'tacker::policy' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_behaves_like 'tacker-policies'
|
||||
end
|
||||
|
||||
it_configures 'tacker policies'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
it_configures 'tacker policies'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,11 +8,6 @@ include RspecPuppetFacts
|
|||
RSpec.configure do |c|
|
||||
c.alias_it_should_behave_like_to :it_configures, 'configures'
|
||||
c.alias_it_should_behave_like_to :it_raises, 'raises'
|
||||
# TODO(aschultz): remove this after all tests converted to use OSDefaults
|
||||
# instead of referencing @default_facts
|
||||
c.before :each do
|
||||
@default_facts = OSDefaults.get_facts
|
||||
end
|
||||
end
|
||||
|
||||
at_exit { RSpec::Puppet::Coverage.report! }
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
require 'puppet-openstack_spec_helper/beaker_spec_helper'
|
Loading…
Reference in New Issue