Retire puppet-glare - Step 2: Remove Project Content

Depends-on: https://review.opendev.org/790056
Change-Id: Id76e00fafd171f3d77b70817c5cfd103cb207b0e
This commit is contained in:
Takashi Kajinami 2021-05-06 23:55:00 +09:00
parent f6c156be72
commit ba81a15371
99 changed files with 8 additions and 4488 deletions

26
.gitignore vendored
View File

@ -1,26 +0,0 @@
# Add patterns in here to exclude files created by tools integrated with this
# repository, such as test frameworks from the project's recommended workflow,
# rendered documentation and package builds.
#
# Don't add patterns to exclude files created by preferred personal tools
# (editors, IDEs, your operating system itself even). These should instead be
# maintained outside the repository, for example in a ~/.gitignore file added
# with:
#
# git config --global core.excludesfile '~/.gitignore'
pkg/
Gemfile.lock
vendor/
spec/fixtures/
.vagrant/
.bundle/
coverage/
.idea/
*.iml
/openstack
/log
# Files created by releasenotes build
releasenotes/build
.tox

View File

@ -1,6 +0,0 @@
- project:
templates:
- puppet-openstack-check-jobs
- puppet-openstack-module-unit-jobs
- puppet-openstack-litmus-jobs
- release-notes-jobs-python3

View File

@ -1,19 +0,0 @@
The source repository for this project can be found at:
https://opendev.org/openstack/puppet-glare
Pull requests submitted through GitHub are not monitored.
To start contributing to OpenStack, follow the steps in the contribution guide
to set up and use Gerrit:
https://docs.openstack.org/contributors/code-and-documentation/quick-start.html
Bugs should be filed on Launchpad:
https://bugs.launchpad.net/puppet-glare
For more specific information about contributing to this repository, see the
Puppet OpenStack contributor guide:
https://docs.openstack.org/puppet-openstack-guide/latest/contributor/contributing.html

36
Gemfile
View File

@ -1,36 +0,0 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :test, :system_tests do
spec_helper_dir = '/home/zuul/src/opendev.org/openstack/puppet-openstack_spec_helper'
if File.directory?(spec_helper_dir)
if ENV['ZUUL_PROJECT'] == 'openstack/puppet-openstack_spec_helper'
gem 'puppet-openstack_spec_helper',
:path => '../..',
:require => 'false'
else
gem 'puppet-openstack_spec_helper',
:path => spec_helper_dir,
:require => 'false'
end
else
spec_helper_version = ENV['ZUUL_BRANCH'] || "master"
gem 'puppet-openstack_spec_helper',
:git => 'https://opendev.org/openstack/puppet-openstack_spec_helper',
:ref => spec_helper_version,
:require => 'false'
end
end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
# vim:ft=ruby

176
LICENSE
View File

@ -1,176 +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.

View File

@ -1,81 +0,0 @@
Team and repository tags
========================
[![Team and repository tags](https://governance.openstack.org/tc/badges/puppet-glare.svg)](https://governance.openstack.org/tc/reference/tags/index.html)
<!-- Change things from this point on -->
glare
=======
#### Table of Contents
1. [Overview - What is the glare module?](#overview)
2. [Module Description - What does the module do?](#module-description)
3. [Setup - The basics of getting started with glare](#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. [Release Notes - Release notes for the project](#release-notes)
8. [Contributors - Those with commits](#contributors)
9. [Repository - The project source code repository](#repository)
Overview
--------
The glare module is a part of [OpenStack](https://opendev.org/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 glare service for OpenStack.
Module Description
------------------
The glare module is a thorough attempt to make Puppet capable of managing the entirety of glare. This includes manifests to provision region specific endpoint and database connections. Types are shipped as part of the glare module to assist in manipulation of configuration files.
Setup
-----
**What the glare module affects**
* [Glare](https://github.com/openstack/glare), the glare service for OpenStack.
### Installing glare
glare is not currently in Puppet Forge, but is anticipated to be added soon. Once that happens, you'll be able to install glare with:
puppet module install openstack/glare
### Beginning with glare
To utilize the glare module's functionality you will need to declare multiple resources.
Implementation
--------------
### glare
glare is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers.
Limitations
------------
* All the glare types use the CLI tools and so need to be ran on the glare node.
Development
-----------
Developer documentation for the entire puppet-openstack project.
* https://docs.openstack.org/puppet-openstack-guide/latest/
Release Notes
-------------
* https://docs.openstack.org/releasenotes/puppet-glare
Contributors
------------
* https://github.com/openstack/puppet-glare/graphs/contributors
Repository
----------
* https://opendev.org/openstack/puppet-glare

8
README.rst Normal file
View File

@ -0,0 +1,8 @@
This project is no longer maintained.
The contents of this repository are still available in the Git source code
management system. To see the contents of this repository before it reached its
end of life, please check out the previous commit with "git checkout HEAD^1".
For any further questions, please email openstack-discuss@lists.openstack.org
or join #openstack-dev on Freenode.

View File

@ -1 +0,0 @@
require 'puppet-openstack_spec_helper/rake_tasks'

View File

@ -1,12 +0,0 @@
# This is a cross-platform list tracking distribution packages needed by tests;
# see https://docs.openstack.org/infra/bindep/ for additional information.
libxml2-devel [test platform:rpm]
libxml2-dev [test platform:dpkg]
libxslt-devel [test platform:rpm]
libxslt1-dev [test platform:dpkg]
ruby-devel [test platform:rpm]
ruby-dev [test platform:dpkg]
zlib1g-dev [test platform:dpkg]
zlib-devel [test platform:rpm]
puppet [build]

View File

@ -1,6 +0,0 @@
# This is required for the docs build jobs
sphinx>=3.5.1 # BSD
openstackdocstheme>=2.2.1 # Apache-2.0
# This is required for the releasenotes build jobs
reno>=3.1.0 # Apache-2.0

View File

@ -1,12 +0,0 @@
# The baseline for module testing used by Puppet Inc. is that each manifest
# should have a corresponding test manifest that declares that class or defined
# type.
#
# Tests are then run by using puppet apply --noop (to check for compilation
# errors and view a log of events) or by fully applying the test in a virtual
# environment (to compare the resulting system state to the desired state).
#
# Learn more about module testing here:
# https://puppet.com/docs/puppet/latest/bgtm.html#testing-your-module
#
include glare

View File

@ -1,10 +0,0 @@
Puppet::Type.type(:glare_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/glare/glare.conf'
end
end

View File

@ -1,10 +0,0 @@
Puppet::Type.type(:glare_paste_ini).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/glare/glare-paste.ini'
end
end

View File

@ -1,10 +0,0 @@
Puppet::Type.type(:glare_swift_config).provide(
:ini_setting,
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
) do
def self.file_path
'/etc/glare/glare-swift.conf'
end
end

View File

@ -1,53 +0,0 @@
Puppet::Type.newtype(:glare_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from glare.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
newvalues(/^[\S ]*$/)
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:anchor) do
['glare::install::end']
end
end

View File

@ -1,53 +0,0 @@
Puppet::Type.newtype(:glare_paste_ini) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from glare_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
newvalues(/^[\S ]*$/)
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:anchor) do
['glare::install::end']
end
end

View File

@ -1,53 +0,0 @@
Puppet::Type.newtype(:glare_swift_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from glare-swift.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
newvalues(/^[\S ]*$/)
def is_to_s( currentvalue )
if resource.secret?
return '[old secret redacted]'
else
return currentvalue
end
end
def should_to_s( newvalue )
if resource.secret?
return '[new secret redacted]'
else
return newvalue
end
end
end
newparam(:secret, :boolean => true) do
desc 'Whether to hide the value from Puppet logs. Defaults to `false`.'
newvalues(:true, :false)
defaultto false
end
newparam(:ensure_absent_val) do
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
defaultto('<SERVICE DEFAULT>')
end
autorequire(:anchor) do
['glare::install::end']
end
end

View File

@ -1,62 +0,0 @@
#
# == Class: glare::backend::cinder
#
# Setup Glare to backend artifacts into Cinder
#
# === Parameters
#
# [*cinder_catalog_info*]
# (optional) Info to match when looking for cinder in the service catalog.
# Format is : separated values of the form:
# <service_type>:<service_name>:<endpoint_type> (string value)
# Defaults to $::os_service_default.
#
# [*cinder_endpoint_template*]
# (optional) Override service catalog lookup with template for cinder endpoint.
# Should be a valid URL. Example: 'http://localhost:8776/v1/%(project_id)s'
# Defaults to $::os_service_default.
#
# [*cinder_ca_certificates_file*]
# (optional) Location of ca certificate file to use for cinder client requests.
# Should be a valid ca certificate file
# Defaults to $::os_service_default.
#
# [*cinder_http_retries*]
# (optional) Number of cinderclient retries on failed http calls.
# Should be a valid integer
# Defaults to $::os_service_default.
#
# [*cinder_api_insecure*]
# (optional) Allow to perform insecure SSL requests to cinder.
# Should be a valid boolean value
# Defaults to $::os_service_default.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
class glare::backend::cinder(
$cinder_ca_certificates_file = $::os_service_default,
$cinder_api_insecure = $::os_service_default,
$cinder_catalog_info = $::os_service_default,
$cinder_endpoint_template = $::os_service_default,
$cinder_http_retries = $::os_service_default,
$multi_store = false,
) {
include glare::deps
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/cinder_api_insecure': value => $cinder_api_insecure;
'glance_store/cinder_catalog_info': value => $cinder_catalog_info;
'glance_store/cinder_http_retries': value => $cinder_http_retries;
'glance_store/cinder_endpoint_template': value => $cinder_endpoint_template;
'glance_store/cinder_ca_certificates_file': value => $cinder_ca_certificates_file;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 'cinder'; }
}
}

View File

@ -1,31 +0,0 @@
# === class: glare::backend::file
#
# used to configure file backends for glare
#
# === parameters:
#
# [*filesystem_store_datadir*]
# Location where dist images are stored when
# default_store == file.
# Optional. Default: /var/lib/glare/images/
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
class glare::backend::file(
$filesystem_store_datadir = '/var/lib/glare/images/',
$multi_store = false,
) {
include glare::deps
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/filesystem_store_datadir': value => $filesystem_store_datadir;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 'file'; }
}
}

View File

@ -1,73 +0,0 @@
# == Class: glare::backend::rbd
#
# Configures the storage backend for glare
# as a rbd instance.
#
# === Parameters:
#
# [*rbd_store_user*]
# (Optional) Default: $::os_service_default.
#
# [*rbd_store_pool*]
# (Optional) Default: $::os_service_default.
#
# [*rbd_store_ceph_conf*]
# (Optional) Default: $::os_service_default.
#
# [*rbd_store_chunk_size*]
# (Optional) Default: $::os_service_default.
#
# [*package_manage*]
# (Optional) Whether manage ceph package state or not.
# Defaults to true
#
# [*package_ensure*]
# (Optional) Desired ensure state of packages.
# Defaults to present
#
# [*rados_connect_timeout*]
# (Optional) Timeout value (in seconds) used when connecting
# to ceph cluster. If value <= 0, no timeout is set and
# default librados value is used.
# Default: $::os_service_default
#
# [*multi_store*]
# (Optional) Boolean describing if multiple backends will be configured.
# Defaults to false
#
class glare::backend::rbd(
$rbd_store_user = $::os_service_default,
$rbd_store_ceph_conf = $::os_service_default,
$rbd_store_pool = $::os_service_default,
$rbd_store_chunk_size = $::os_service_default,
$package_manage = true,
$package_ensure = 'present',
$rados_connect_timeout = $::os_service_default,
$multi_store = false,
) {
include glare::deps
include glare::params
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/rbd_store_ceph_conf': value => $rbd_store_ceph_conf;
'glance_store/rbd_store_user': value => $rbd_store_user;
'glance_store/rbd_store_pool': value => $rbd_store_pool;
'glance_store/rbd_store_chunk_size': value => $rbd_store_chunk_size;
'glance_store/rados_connect_timeout': value => $rados_connect_timeout;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 'rbd'; }
}
if $package_manage {
ensure_packages('python-ceph', {
ensure => $package_ensure,
name => $::glare::params::pyceph_package_name,
tag => 'glare-support-package',
})
}
}

View File

@ -1,99 +0,0 @@
# == class: glare::backend::s3
#
# configures the storage backend for glare
# as a s3 instance
#
# === parameters:
#
# [*access_key*]
# (Required) The S3 query token access key.
#
# [*secret_key*]
# (Required) The S3 query token secret key.
#
# [*host*]
# (Required) The host where the S3 server is listening.
#
# [*bucket*]
# (Required) The S3 bucket to be used to store the Glance data.
#
# [*bucket_url_format*]
# (Optional) The S3 calling format used to determine the bucket. Either
# 'subdomain' or 'path' can be used.
# Default: $::os_service_default.
#
# [*create_bucket_on_put*]
# (Optional) A boolean to determine if the S3 bucket should be created on
# upload if it does not exist or if an error should be returned to the user.
# Default: $::os_service_default.
#
# [*large_object_size*]
# (Optional) What size, in MB, should S3 start chunking image files and do a
# multipart upload in S3.
# Default: $::os_service_default.
#
# [*large_object_chunk_size*]
# (Optional) What multipart upload part size, in MB, should S3 use when
# uploading parts. The size must be greater than or equal to 5M.
# Default: $::os_service_default.
#
# [*object_buffer_dir*]
# (Optional) The local directory where uploads will be staged before they are
# transferred into S3.
# Default: $::os_service_default.
#
# [*thread_pools*]
# (Optional) The number of thread pools to perform a multipart upload in S3.
# Default: $::os_service_default.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
class glare::backend::s3(
$access_key,
$secret_key,
$host,
$bucket,
$bucket_url_format = $::os_service_default,
$create_bucket_on_put = $::os_service_default,
$large_object_size = $::os_service_default,
$large_object_chunk_size = $::os_service_default,
$object_buffer_dir = $::os_service_default,
$thread_pools = $::os_service_default,
$multi_store = false,
) {
include glare::deps
if !is_service_default($large_object_chunk_size){
if !is_integer($large_object_chunk_size) or $large_object_chunk_size < 5 {
fail('glare::backend::s3::large_object_chunk_size must be an integer >= 5')
}
}
if !is_service_default($bucket_url_format){
if !($bucket_url_format in ['subdomain', 'path']) {
fail('glare::backend::s3::bucket_url_format must be either "subdomain" or "path"')
}
}
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/s3_store_access_key': value => $access_key, secret => true;
'glance_store/s3_store_secret_key': value => $secret_key, secret => true;
'glance_store/s3_store_host': value => $host;
'glance_store/s3_store_bucket': value => $bucket;
'glance_store/s3_store_bucket_url_format': value => $bucket_url_format;
'glance_store/s3_store_create_bucket_on_put': value => $create_bucket_on_put;
'glance_store/s3_store_large_object_size': value => $large_object_size;
'glance_store/s3_store_large_object_chunk_size': value => $large_object_chunk_size;
'glance_store/s3_store_thread_pools': value => $thread_pools;
'glance_store/s3_store_object_buffer_dir': value => $object_buffer_dir;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 's3'; }
}
}

View File

@ -1,100 +0,0 @@
# == class: glare::backend::swift
#
# configures the storage backend for glare
# as a swift instance
#
# === parameters:
#
# [*swift_store_user*]
# Required. Swift store user.
#
# [*swift_store_key*]
# Required. Swift store key.
#
# [*swift_store_auth_address*]
# Optional. Default: 'http://127.0.0.1:5000/v3'
#
# [*swift_store_auth_project_domain_id*]
# Optional. Useful when keystone auth is version 3. Default: default
#
# [*swift_store_auth_user_domain_id*]
# Optional. Useful when keystone auth is version 3. Default: default
#
# [*swift_store_container*]
# Optional. Default: $::os_service_default.
#
# [*swift_store_auth_version*]
# Optional. Default: '3'
#
# [*swift_store_large_object_size*]
# Optional. Default: $::os_service_default.
#
# [*swift_store_create_container_on_put*]
# Optional. Default: $::os_service_default.
#
# [*swift_store_endpoint_type*]
# Optional. Default: 'internalURL'
#
# [*swift_store_region*]
# Optional. Default: $::os_service_default.
#
# [*default_swift_reference*]
# Optional. The reference to the default swift
# account/backing store parameters to use for adding
# new images. String value.
# Default to 'ref1'.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
class glare::backend::swift(
$swift_store_user,
$swift_store_key,
$swift_store_auth_address = 'http://127.0.0.1:5000/v3',
$swift_store_container = $::os_service_default,
$swift_store_auth_version = '3',
$swift_store_auth_project_domain_id = 'default',
$swift_store_auth_user_domain_id = 'default',
$swift_store_large_object_size = $::os_service_default,
$swift_store_create_container_on_put = $::os_service_default,
$swift_store_endpoint_type = 'internalURL',
$swift_store_region = $::os_service_default,
$default_swift_reference = 'ref1',
$multi_store = false,
) {
include glare::deps
include swift::client
Class['swift::client'] -> Anchor['glare::install::end']
Service<| tag == 'swift-service' |> -> Service['glare']
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/swift_store_region': value => $swift_store_region;
'glance_store/swift_store_container': value => $swift_store_container;
'glance_store/swift_store_create_container_on_put':
value => $swift_store_create_container_on_put;
'glance_store/swift_store_large_object_size':
value => $swift_store_large_object_size;
'glance_store/swift_store_endpoint_type':
value => $swift_store_endpoint_type;
'glance_store/swift_store_config_file': value => '/etc/glare/glare-swift.conf';
'glance_store/default_swift_reference': value => $default_swift_reference;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 'swift'; }
}
glare_swift_config {
"${default_swift_reference}/user": value => $swift_store_user;
"${default_swift_reference}/key": value => $swift_store_key;
"${default_swift_reference}/auth_address": value => $swift_store_auth_address;
"${default_swift_reference}/auth_version": value => $swift_store_auth_version;
"${default_swift_reference}/user_domain_id": value => $swift_store_auth_user_domain_id;
"${default_swift_reference}/project_domain_id": value => $swift_store_auth_project_domain_id;
}
}

View File

@ -1,95 +0,0 @@
# == Class: glare::backend::vsphere
#
# Setup Glare to backend images into VMWare vCenter/ESXi
#
# === Parameters
#
# [*vcenter_insecure*]
# (optional) If true, the ESX/vCenter server certificate is not verified.
# If false, then the default CA truststore is used for verification.
# This option is ignored if "vcenter_ca_file" is set.
# Defaults to 'True'.
#
# [*vcenter_ca_file*]
# (optional) The name of the CA bundle file which will be used in
# verifying vCenter server certificate. If parameter is not set
# then system truststore is used. If parameter is set,
# vcenter_insecure value is ignored.
# Defaults to $::os_service_default.
#
# [*vcenter_datastores*]
# (Multi-valued) A list of datastores where the image
# can be stored. This option may be specified multiple times
# for specifying multiple datastores. The datastore name should
# be specified after its datacenter path, seperated by ":".
# An optional weight may be given after the datastore name,
# seperated again by ":". Thus, the required format
# becomes <datacenter_path>:<datastore_name>:<optional_weight>.
# When adding an image, the datastore with highest weight will be selected,
# unless there is not enough free space available in cases where the image
# size is already known. If no weight is given, it is assumed to be
# zero and the directory will be considered for selection last.
# If multiple datastores have the same weight, then the one with the most
# free space available is selected.
# Defaults to $::os_service_default.
#
# [*vcenter_host*]
# (required) vCenter/ESXi Server target system.
# Should be a valid an IP address or a DNS name.
#
# [*vcenter_user*]
# (required) Username for authenticating with vCenter/ESXi server.
#
# [*vcenter_password*]
# (required) Password for authenticating with vCenter/ESXi server.
#
# [*vcenter_image_dir*]
# (required) The name of the directory where the glare images will be stored
# in the VMware datastore.
#
# [*vcenter_task_poll_interval*]
# (optional) The interval used for polling remote tasks invoked on
# vCenter/ESXi server.
# Defaults to $::os_service_default.
#
# [*vcenter_api_retry_count*]
# (optional) Number of times VMware ESX/VC server API must be retried upon
# connection related issues.
# Defaults to $::os_service_default.
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false.
#
class glare::backend::vsphere(
$vcenter_host,
$vcenter_user,
$vcenter_password,
$vcenter_image_dir,
$vcenter_datastores,
$vcenter_ca_file = $::os_service_default,
$vcenter_insecure = 'True',
$vcenter_task_poll_interval = $::os_service_default,
$vcenter_api_retry_count = $::os_service_default,
$multi_store = false,
) {
include glare::deps
# Glare hasn't its own store, glance_store should be used
glare_config {
'glance_store/vmware_insecure': value => $vcenter_insecure;
'glance_store/vmware_ca_file': value => $vcenter_ca_file;
'glance_store/vmware_server_host': value => $vcenter_host;
'glance_store/vmware_server_username': value => $vcenter_user;
'glance_store/vmware_server_password': value => $vcenter_password, secret => true;
'glance_store/vmware_store_image_dir': value => $vcenter_image_dir;
'glance_store/vmware_task_poll_interval': value => $vcenter_task_poll_interval;
'glance_store/vmware_api_retry_count': value => $vcenter_api_retry_count;
'glance_store/vmware_datastores': value => $vcenter_datastores;
}
if !$multi_store {
glare_config { 'glance_store/default_store': value => 'vsphere'; }
}
}

View File

@ -1,23 +0,0 @@
# == Class: glare::client
#
# Installs the glare python library.
#
# === Parameters:
#
# [*ensure*]
# (Optional) Ensure state for pachage.
# Defaults to 'present'.
#
class glare::client (
$ensure = 'present'
) {
include glare::deps
include glare::params
package { 'python-glareclient':
ensure => $ensure,
name => $::glare::params::client_package_name,
tag => 'openstack',
}
}

View File

@ -1,38 +0,0 @@
# == Class: glare::config
#
# This class is used to manage arbitrary glare configurations.
#
# === Parameters
#
# [*glare_config*]
# (optional) Allow configuration of arbitrary glare configurations.
# The value is an hash of glare_config resources. Example:
# { 'DEFAULT/foo' => { value => 'fooValue'},
# 'DEFAULT/bar' => { value => 'barValue'}
# }
# In yaml format, Example:
# glare_config:
# DEFAULT/foo:
# value: fooValue
# DEFAULT/bar:
# value: barValue
#
# NOTE: The configuration MUST NOT be already handled by this module
# or Puppet catalog compilation will fail with duplicate resources.
#
# [*glare_paste_ini_config*]
# (optional) Allow configuration of glance-glare-paste.ini configurations.
#
class glare::config (
$glare_config = {},
$glare_paste_ini_config = {}
) {
include glare::deps
validate_legacy(Hash, 'validate_hash', $glare_config)
validate_legacy(Hash, 'validate_hash', $glare_paste_ini_config)
create_resources('glare_config', $glare_config)
create_resources('glare_paste_ini', $glare_paste_ini_config)
}

View File

@ -1,83 +0,0 @@
# == Class: glare::db
#
# Configure the glare database
#
# === Parameters
#
# [*database_connection*]
# (Optional) Url used to connect to database.
# Defaults to 'sqlite:////var/lib/glare/glare.sqlite'.
#
# [*database_connection_recycle_time*]
# (Optional) Timeout when db connections should be reaped.
# Defaults to $::os_service_default
#
# [*database_db_max_retries*]
# (optional) Maximum retries in case of connection error or deadlock error
# before error is raised. Set to -1 to specify an infinite retry count.
# Defaults to $::os_service_default
#
# [*database_max_retries*]
# (Optional) Maximum number of database connection retries during startup.
# Setting -1 implies an infinite retry count.
# Defaults to $::os_service_default
#
# [*database_retry_interval*]
# (Optional) Interval between retries of opening a database connection.
# Defaults to $::os_service_default
#
# [*database_max_pool_size*]
# (Optional)Maximum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default
#
# [*database_max_overflow*]
# (Optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to $::os_service_default
#
# [*database_pool_timeout*]
# (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# Defaults to $::os_service_default
#
# [*mysql_enable_ndb*]
# (Optional) If True, transparently enables support for handling MySQL
# Cluster (NDB).
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# (Optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef
#
class glare::db (
$database_connection = 'sqlite:////var/lib/glare/glare.sqlite',
$database_connection_recycle_time = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_db_max_retries = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
$mysql_enable_ndb = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {
include glare::deps
if $database_min_pool_size {
warning('The database_min_pool_size parameter is deprecated, and will be removed in a future release.')
}
oslo::db { 'glare_config':
connection => $database_connection,
connection_recycle_time => $database_connection_recycle_time,
db_max_retries => $database_db_max_retries,
max_retries => $database_max_retries,
retry_interval => $database_retry_interval,
max_pool_size => $database_max_pool_size,
max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout,
mysql_enable_ndb => $mysql_enable_ndb,
}
}

View File

@ -1,63 +0,0 @@
# The glare::db::mysql class implements mysql backend for glare
#
# This class can be used to create tables, users and grant
# privilege for a mysql glare database.
#
# == Parameters
#
# [*password*]
# (Required) Password to connect to the database.
#
# [*dbname*]
# (Optional) Name of the database.
# Defaults to 'glare'.
#
# [*user*]
# (Optional) User to connect to the database.
# Defaults to 'glare'.
#
# [*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) The database collate.
# Only used with mysql modules >= 2.2.
# Defaults to 'utf8_general_ci'
#
class glare::db::mysql(
$password,
$dbname = 'glare',
$user = 'glare',
$host = '127.0.0.1',
$charset = 'utf8',
$collate = 'utf8_general_ci',
$allowed_hosts = undef
) {
include glare::deps
validate_legacy(String, 'validate_string', $password)
::openstacklib::db::mysql { 'glare':
user => $user,
password => $password,
dbname => $dbname,
host => $host,
charset => $charset,
collate => $collate,
allowed_hosts => $allowed_hosts,
}
Anchor['glare::db::begin']
~> Class['glare::db::mysql']
~> Anchor['glare::db::end']
}

View File

@ -1,49 +0,0 @@
# == Class: glare::db::postgresql
#
# Class that configures postgresql for glare
# Requires the Puppetlabs postgresql module.
#
# === Parameters
#
# [*password*]
# (Required) Password to connect to the database.
#
# [*dbname*]
# (Optional) Name of the database.
# Defaults to 'glare'.
#
# [*user*]
# (Optional) User to connect to the database.
# Defaults to 'glare'.
#
# [*encoding*]
# (Optional) The charset to use for the database.
# Default to undef.
#
# [*privileges*]
# (Optional) Privileges given to the database user.
# Default to 'ALL'
#
class glare::db::postgresql(
$password,
$dbname = 'glare',
$user = 'glare',
$encoding = undef,
$privileges = 'ALL',
) {
include glare::deps
::openstacklib::db::postgresql { 'glare':
password => $password,
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
}
Anchor['glare::db::begin']
~> Class['glare::db::postgresql']
~> Anchor['glare::db::end']
}

View File

@ -1,39 +0,0 @@
#
# Class to execute glare-db-manage
#
# == Parameters
#
# [*extra_params*]
# (Optional) String of extra command line parameters to append
# to the glare-db-manage command.
# Defaults to ''
#
# [*db_sync_timeout*]
# (Optional) Timeout for the execution of the db_sync
# Defaults to 300
#
class glare::db::sync(
$extra_params = '',
$db_sync_timeout = 300,
) {
include glare::deps
exec { 'glare-db-sync':
command => "glare-db-manage ${extra_params} upgrade",
user => 'glare',
path => [ '/bin/', '/usr/bin/' , '/usr/local/bin' ],
refreshonly => true,
try_sleep => 5,
tries => 10,
timeout => $db_sync_timeout,
logoutput => on_failure,
subscribe => [
Anchor['glare::install::end'],
Anchor['glare::config::end'],
Anchor['glare::dbsync::begin']
],
notify => Anchor['glare::dbsync::end'],
tag => 'openstack-db',
}
}

View File

@ -1,57 +0,0 @@
# == Class: glare::deps
#
# glare anchors and dependency management
#
class glare::deps {
# Setup anchors for install, config and service phases of the module. These
# anchors allow external modules to hook the begin and end of any of these
# phases. Package or service management can also be replaced by ensuring the
# package is absent or turning off service management and having the
# replacement depend on the appropriate anchors. When applicable, end tags
# should be notified so that subscribers can determine if installation,
# config or service state changed and act on that if needed.
anchor { 'glare::install::begin': }
-> Package<| tag == 'glare'|>
~> anchor { 'glare::install::end': }
-> anchor { 'glare::config::begin': }
-> File<| tag == 'glare-config-file' |>
~> anchor { 'glare::config::end': }
-> anchor { 'glare::db::begin': }
-> anchor { 'glare::db::end': }
~> anchor { 'glare::dbsync::begin': }
-> anchor { 'glare::dbsync::end': }
~> anchor { 'glare::service::begin': }
~> Service<| tag == 'glare' |>
~> anchor { 'glare::service::end': }
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db<||> -> Anchor['glare::dbsync::begin']
# Ensure files are modified in the config block
Anchor['glare::config::begin']
-> File_line<| tag == 'glare-file-line' |>
~> Anchor['glare::config::end']
# Ensure all files are in place before modifying them
File<| tag == 'glare-config-file' |> -> File_line<| tag == 'glare-file-line' |>
# All other inifile providers need to be processed in the config block
Anchor['glare::config::begin'] -> Glare_config<||> ~> Anchor['glare::config::end']
Anchor['glare::config::begin'] -> Glare_paste_ini<||> ~> Anchor['glare::config::end']
# Support packages need to be installed in the install phase, but we don't
# put them in the chain above because we don't want any false dependencies
# between packages with the glare-package tag and the glare-support-package
# tag. Note: the package resources here will have a 'before' relationshop on
# the glare::install::end anchor. The line between glare-support-package and
# glare-package should be whether or not glare services would need to be
# restarted if the package state was changed.
Anchor['glare::install::begin']
-> Package<| tag == 'glare-support-package'|>
-> Anchor['glare::install::end']
# Installation or config changes will always restart services.
Anchor['glare::install::end'] ~> Anchor['glare::service::begin']
Anchor['glare::config::end'] ~> Anchor['glare::service::begin']
}

View File

@ -1,244 +0,0 @@
# == Class: glare
#
# Base glare config.
#
# === Parameters
# [*package_ensure*]
# (optional) Ensure state for package. On RedHat platforms this
# setting is ignored and the setting from the glance class is used
# because there is only one glance package. Defaults to 'present'.
#
# [*bind_host*]
# (optional) The address of the host to bind to.
# Default: 0.0.0.0
#
# [*bind_port*]
# (optional) The port the server should bind to.
# Default: 9494
#
# [*backlog*]
# (optional) Backlog requests when creating socket
# Default: 4096
#
# [*workers*]
# (optional) Number of Glare worker processes to start
# Default: $::os_workers
#
# [*auth_strategy*]
# (optional) Type is authorization being used.
# Defaults to 'keystone'
#
# [*pipeline*]
# (optional) Partial name of a pipeline in your paste configuration file with the
# service name removed.
# Defaults to 'keystone'.
#
# [*manage_service*]
# (optional) If Puppet should manage service startup / shutdown.
# Defaults to true.
#
# [*enabled*]
# (optional) Whether to enable services.
# Defaults to true.
#
# [*cert_file*]
# (optinal) Certificate file to use when starting API server securely
# Defaults to $::os_service_default
#
# [*key_file*]
# (optional) Private key file to use when starting API server securely
# Defaults to $::os_service_default
#
# [*ca_file*]
# (optional) CA certificate file to use to verify connecting clients
# Defaults to $::os_service_default
#
# [*stores*]
# (optional) List of which store classes and store class locations are
# currently known to glare at startup.
# Defaults to undef,
# Example: file,http
# Possible values:
# * A comma separated list that could include:
# * file
# * http
# * swift
# * rbd
# * sheepdog
# * cinder
# * vmware
# Related Options:
# * default_store
#
#
# [*default_store*]
# (optional) Allowed values: file, filesystem, http, https, swift,
# swift+http, swift+https, swift+config, rbd, sheepdog, cinder, vsphere
# default_store = undef,
#
# [*multi_store*]
# (optional) Boolean describing if multiple backends will be configured
# Defaults to false
#
# [*filesystem_store_datadir*]
#
# filesystem_store_datadir = /var/lib/glare/images
#
# [*os_region_name*]
# (optional) Sets the keystone region to use.
# Defaults to 'RegionOne'.
#
# [*allow_anonymous_access*]
# (optional)Allow unauthenticated users to access the API with read-only
# privileges. This only applies when using ContextMiddleware. (boolean
# value)
# Defaults to false
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the glare config.
# Defaults to false.
#
# [*sync_db*]
# (Optional) Run db sync on the node.
# Defaults to true
#
class glare (
$package_ensure = 'present',
$bind_host = $::os_service_default,
$bind_port = $::os_service_default,
$backlog = $::os_service_default,
$workers = $::os_workers,
$auth_strategy = 'keystone',
$pipeline = 'keystone',
$manage_service = true,
$enabled = true,
$cert_file = $::os_service_default,
$key_file = $::os_service_default,
$ca_file = $::os_service_default,
$stores = undef,
$default_store = undef,
$multi_store = false,
$filesystem_store_datadir = '/var/lib/glare/images',
$os_region_name = 'RegionOne',
$allow_anonymous_access = $::os_service_default,
$purge_config = false,
$sync_db = true,
) {
include glare::params
include glare::db
include glare::deps
if $sync_db {
include glare::db::sync
}
ensure_packages ( 'glare' , {
ensure => $package_ensure,
name => $::glare::params::glare_package_name,
tag => ['openstack', 'glare-package'],
})
resources { 'glare_config':
purge => $purge_config,
}
glare_config {
'DEFAULT/bind_host' : value => $bind_host;
'DEFAULT/bind_port' : value => $bind_port;
'DEFAULT/backlog' : value => $backlog;
'DEFAULT/workers' : value => $workers;
'DEFAULT/allow_anonymous_access': value => $allow_anonymous_access;
}
# stores config
if $default_store {
$default_store_real = $default_store
}
if !empty($stores) {
# determine value for glance_store/stores
if size(any2array($stores)) > 1 {
$stores_real = join($stores, ',')
} else {
$stores_real = $stores[0]
}
if !$default_store_real {
# set default store based on provided stores when it isn't explicitly set
warning("default_store not provided, it will be automatically set to ${stores[0]}")
$default_store_real = $stores[0]
}
} elsif $default_store_real {
# set stores based on default_store if only default_store is provided
$stores_real = $default_store
} else {
warning('Glare is being provisioned without any stores configured')
}
if $default_store_real and $multi_store {
glare_config {
'glance_store/default_store': value => $default_store_real;
}
} elsif $multi_store {
glare_config {
'glance_store/default_store': ensure => absent;
}
}
if $stores_real {
glare_config {
'glance_store/stores': value => $stores_real;
}
} else {
glare_config {
'glance_store/stores': ensure => absent;
}
}
glare_config {
'glance_store/os_region_name' : value => $os_region_name;
'glance_store/filesystem_store_datadir' : value => $filesystem_store_datadir;
}
if $pipeline != '' {
glare_config {
'paste_deploy/flavor':
ensure => present,
value => $pipeline,
}
if $pipeline == 'session' {
glare_paste_ini { 'pipeline:glare-api-session/pipeline':
value => 'cors faultwrapper healthcheck versionnegotiation context glarev1api'
}
}
} else {
glare_config { 'paste_deploy/flavor': ensure => absent }
}
# keystone config
if $auth_strategy == 'keystone' {
include glare::keystone::authtoken
}
# SSL Options
glare_config {
'DEFAULT/cert_file': value => $cert_file;
'DEFAULT/key_file' : value => $key_file;
'DEFAULT/ca_file' : value => $ca_file;
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { 'glare':
ensure => $service_ensure,
name => $::glare::params::glare_service_name,
enable => $enabled,
tag => 'glare',
}
}

View File

@ -1,104 +0,0 @@
# == Class: glare::keystone::auth
#
# Configures glare user, service and endpoint in Keystone.
#
# === Parameters
#
# [*password*]
# (Required) Password for glare user.
#
# [*auth_name*]
# (Optional) Username for glare service.
# Defaults to 'glare'.
#
# [*email*]
# (Optional) Email for glare user.
# Defaults to 'glare@localhost'.
#
# [*tenant*]
# (Optional) Tenant for glare user.
# Defaults to 'services'.
#
# [*configure_endpoint*]
# (Optional) Should glare endpoint be configured?
# Defaults to true
#
# [*configure_user*]
# (Optional) Should the service user be configured?
# Defaults to true
#
# [*configure_user_role*]
# (Optional) Should the admin role be configured for the service user?
# Defaults to true
#
# [*service_type*]
# (Optional) Type of service.
# Defaults to 'artifact'.
#
# [*region*]
# (Optional) Region for endpoint.
# Defaults to 'RegionOne'.
#
# [*service_name*]
# (Optional) Name of the service.
# Defaults to the value of 'glare'.
#
# [*service_description*]
# (Optional) Description of the service.
# Default to 'Glare Artifact Repository Service'
#
# [*public_url*]
# (0ptional) The endpoint's public url.
# This url should *not* contain any trailing '/'.
# Defaults to 'http://127.0.0.1:9494'
#
# [*admin_url*]
# (Optional) The endpoint's admin url.
# This url should *not* contain any trailing '/'.
# Defaults to 'http://127.0.0.1:9494'
#
# [*internal_url*]
# (Optional) The endpoint's internal url.
# Defaults to 'http://127.0.0.1:9494
#
class glare::keystone::auth (
$password,
$auth_name = 'glare',
$email = 'glare@localhost',
$tenant = 'services',
$configure_endpoint = true,
$configure_user = true,
$configure_user_role = true,
$service_name = 'glare',
$service_description = 'Glare Artifact Repository Service',
$service_type = 'artifact',
$region = 'RegionOne',
$public_url = 'http://127.0.0.1:9494',
$admin_url = 'http://127.0.0.1:9494',
$internal_url = 'http://127.0.0.1:9494',
) {
include glare::deps
if $configure_user_role {
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'glare-server' |>
}
Keystone_endpoint["${region}/${service_name}::${service_type}"] ~> Service <| name == 'glare-server' |>
keystone::resource::service_identity { 'glare':
configure_user => $configure_user,
configure_user_role => $configure_user_role,
configure_endpoint => $configure_endpoint,
service_name => $service_name,
service_type => $service_type,
service_description => $service_description,
region => $region,
auth_name => $auth_name,
password => $password,
email => $email,
tenant => $tenant,
public_url => $public_url,
internal_url => $internal_url,
admin_url => $admin_url,
}
}

View File

@ -1,269 +0,0 @@
# class: glare::keystone::auth
#
# Configure the keystone_authtoken section in the configuration file
#
# === Parameters
#
# [*username*]
# (Optional) The name of the service user
# Defaults to 'glare'
#
# [*password*]
# (Required) Password to create for the service user
#
# [*auth_url*]
# (Optional) The URL to use for authentication.
# Defaults to 'http://localhost:5000'.
#
# [*project_name*]
# (Optional) Service project name
# Defaults to 'services'
#
# [*user_domain_name*]
# (Optional) Name of domain for $username
# Defaults to 'Default'
#
# [*project_domain_name*]
# (Optional) Name of domain for $project_name
# Defaults to 'Default'
#
# [*insecure*]
# (Optional) If true, explicitly allow TLS without checking server cert
# against any certificate authorities. WARNING: not recommended. Use with
# caution.
# Defaults to $::os_service_default
#
# [*auth_section*]
# (Optional) Config Section from which to load plugin specific options
# Defaults to $::os_service_default.
#
# [*auth_type*]
# (Optional) Authentication type to load
# Defaults to 'password'.
#
# [*www_authenticate_uri*]
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://localhost:5000'.
#
# [*auth_version*]
# (Optional) API version of the admin Identity API endpoint.
# Defaults to $::os_service_default.
#
# [*cache*]
# (Optional) Env key for the swift cache.
# Defaults to $::os_service_default.
#
# [*cafile*]
# (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs
# connections.
# Defaults to $::os_service_default.
#
# [*certfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*delay_auth_decision*]
# (Optional) Do not handle authorization requests within the middleware, but
# delegate the authorization decision to downstream WSGI components. Boolean
# value
# Defaults to $::os_service_default.
#
# [*enforce_token_bind*]
# (Optional) Used to control the use and type of token binding. Can be set
# to: "disabled" to not check token binding. "permissive" (default) to
# validate binding information if the bind type is of a form known to the
# server and ignore it if not. "strict" like "permissive" but if the bind
# type is unknown the token will be rejected. "required" any form of token
# binding is needed to be allowed. Finally the name of a binding method that
# must be present in tokens. String value.
# Defaults to $::os_service_default.
#
# [*http_connect_timeout*]
# (Optional) Request timeout value for communicating with Identity API
# server.
# Defaults to $::os_service_default.
#
# [*http_request_max_retries*]
# (Optional) How many times are we trying to reconnect when communicating
# with Identity API Server. Integer value
# Defaults to $::os_service_default.
#
# [*include_service_catalog*]
# (Optional) Indicate whether to set the X-Service-Catalog header. If False,
# middleware will not ask for service catalog on token validation and will
# not set the X-Service-Catalog header. Boolean value.
# Defaults to $::os_service_default.
#
# [*keyfile*]
# (Optional) Required if identity server requires client certificate
# Defaults to $::os_service_default.
#
# [*memcache_pool_conn_get_timeout*]
# (Optional) Number of seconds that an operation will wait to get a memcached
# client connection from the pool. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_dead_retry*]
# (Optional) Number of seconds memcached server is considered dead before it
# is tried again. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_maxsize*]
# (Optional) Maximum total number of open connections to every memcached
# server. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_socket_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_pool_unused_timeout*]
# (Optional) Number of seconds a connection to memcached is held unused in
# the pool before it is closed. Integer value
# Defaults to $::os_service_default.
#
# [*memcache_secret_key*]
# (Optional, mandatory if memcache_security_strategy is defined) This string
# is used for key derivation.
# Defaults to $::os_service_default.
#
# [*memcache_security_strategy*]
# (Optional) If defined, indicate whether token data should be authenticated
# or authenticated and encrypted. If MAC, token data is authenticated (with
# HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the
# cache. If the value is not one of these options or empty, auth_token will
# raise an exception on initialization.
# Defaults to $::os_service_default.
#
# [*memcache_use_advanced_pool*]
# (Optional) Use the advanced (eventlet safe) memcached client pool. The
# advanced pool will only work under python 2.x Boolean value
# Defaults to $::os_service_default.
#
# [*memcached_servers*]
# (Optional) Optionally specify a list of memcached server(s) to use for
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
#
# [*manage_memcache_package*]
# (Optional) Whether to install the python-memcache package.
# Defaults to false.
#
# [*region_name*]
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
#
# [*token_cache_time*]
# (Optional) In order to prevent excessive effort spent validating tokens,
# the middleware caches previously-seen tokens for a configurable duration
# (in seconds). Set to -1 to disable caching completely. Integer value
# Defaults to $::os_service_default.
#
# [*service_token_roles*]
# (Optional) A choice of roles that must be present in a service token.
# Service tokens are allowed to request that an expired token
# can be used and so this check should tightly control that
# only actual services should be sending this token. Roles
# here are applied as an ANY check so any role in this list
# must be present. For backwards compatibility reasons this
# currently only affects the allow_expired check. (list value)
# Defaults to $::os_service_default.
#
# [*service_token_roles_required*]
# (optional) backwards compatibility to ensure that the service tokens are
# compared against a list of possible roles for validity
# true/false
# Defaults to $::os_service_default.
#
# [*service_type*]
# (Optional) The name or type of the service as it appears in the service
# catalog. This is used to validate tokens that have restricted access rules.
# Defaults to $::os_service_default.
#
# [*interface*]
# (Optional) Interface to use for the Identity API endpoint. Valid values are
# "public", "internal" or "admin".
# Defaults to $::os_service_default.
#
class glare::keystone::authtoken(
$password,
$username = 'glare',
$auth_url = 'http://localhost:5000',
$project_name = 'services',
$user_domain_name = 'Default',
$project_domain_name = 'Default',
$insecure = $::os_service_default,
$auth_section = $::os_service_default,
$auth_type = 'password',
$www_authenticate_uri = 'http://localhost:5000',
$auth_version = $::os_service_default,
$cache = $::os_service_default,
$cafile = $::os_service_default,
$certfile = $::os_service_default,
$delay_auth_decision = $::os_service_default,
$enforce_token_bind = $::os_service_default,
$http_connect_timeout = $::os_service_default,
$http_request_max_retries = $::os_service_default,
$include_service_catalog = $::os_service_default,
$keyfile = $::os_service_default,
$memcache_pool_conn_get_timeout = $::os_service_default,
$memcache_pool_dead_retry = $::os_service_default,
$memcache_pool_maxsize = $::os_service_default,
$memcache_pool_socket_timeout = $::os_service_default,
$memcache_pool_unused_timeout = $::os_service_default,
$memcache_secret_key = $::os_service_default,
$memcache_security_strategy = $::os_service_default,
$memcache_use_advanced_pool = $::os_service_default,
$memcached_servers = $::os_service_default,
$manage_memcache_package = false,
$region_name = $::os_service_default,
$token_cache_time = $::os_service_default,
$service_token_roles = $::os_service_default,
$service_token_roles_required = $::os_service_default,
$service_type = $::os_service_default,
$interface = $::os_service_default,
) {
include glare::deps
keystone::resource::authtoken { 'glare_config':
username => $username,
password => $password,
project_name => $project_name,
auth_url => $auth_url,
www_authenticate_uri => $www_authenticate_uri,
auth_version => $auth_version,
auth_type => $auth_type,
auth_section => $auth_section,
user_domain_name => $user_domain_name,
project_domain_name => $project_domain_name,
insecure => $insecure,
cache => $cache,
cafile => $cafile,
certfile => $certfile,
delay_auth_decision => $delay_auth_decision,
enforce_token_bind => $enforce_token_bind,
http_connect_timeout => $http_connect_timeout,
http_request_max_retries => $http_request_max_retries,
include_service_catalog => $include_service_catalog,
keyfile => $keyfile,
memcache_pool_conn_get_timeout => $memcache_pool_conn_get_timeout,
memcache_pool_dead_retry => $memcache_pool_dead_retry,
memcache_pool_maxsize => $memcache_pool_maxsize,
memcache_pool_socket_timeout => $memcache_pool_socket_timeout,
memcache_secret_key => $memcache_secret_key,
memcache_security_strategy => $memcache_security_strategy,
memcache_use_advanced_pool => $memcache_use_advanced_pool,
memcache_pool_unused_timeout => $memcache_pool_unused_timeout,
memcached_servers => $memcached_servers,
manage_memcache_package => $manage_memcache_package,
region_name => $region_name,
token_cache_time => $token_cache_time,
service_token_roles => $service_token_roles,
service_token_roles_required => $service_token_roles_required,
service_type => $service_type,
interface => $interface,
}
}

View File

@ -1,149 +0,0 @@
# Class glare::logging
#
# glare logging configuration
#
# == parameters
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*use_json*]
# (Optional) Use json for logging.
# Defaults to $::os_service_default
#
# [*use_journal*]
# (Optional) Use journal for logging.
# Defaults to $::os_service_default
#
# [*use_stderr*]
# (Optional) Use stderr for logging
# Defaults to $::os_service_default
#
# [*syslog_log_facility*]
# (Optional) Syslog facility to receive log lines.
# 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/glare'.
#
# [*log_file*]
# (Optional) File where logs should be stored.
# Defaults to '/var/log/glare/glare.log'
#
# [*logging_context_format_string*]
# (Optional) Format string to use for log messages with context.
# 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 $::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 $::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 $::os_service_default
# Example: '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s'
#
# [*log_config_append*]
# (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*]
# (0ptional) Hash of logger (keys) and level (values) pairs.
# Defaults to $::os_service_default
# Example:
# { 'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
# 'sqlalchemy' => 'WARN', 'suds' => 'INFO',
# 'oslo.messaging' => 'INFO', 'iso8601' => 'WARN',
# 'requests.packages.urllib3.connectionpool' => 'WARN',
# 'urllib3.connectionpool' => 'WARN',
# 'websocket' => 'WARN', 'glaremiddleware' => 'WARN',
# 'routes.middleware' => 'WARN', stevedore => 'WARN' }
#
# [*publish_errors*]
# (Optional) Publish error events (boolean value).
# Defaults to $::os_service_default
#
# [*fatal_deprecations*]
# (Optional) Make deprecations fatal (boolean value)
# Defaults to $::os_service_default
#
# [*instance_format*]
# (Optional) If an instance is passed with the log message, format it
# like this (string value).
# Defaults to undef.
# Example: '[instance: %(uuid)s] '
#
# [*instance_uuid_format*]
# (Optional) If an instance UUID is passed with the log message, format
# it like this (string value).
# 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 $::os_service_default
# Example: 'Y-%m-%d %H:%M:%S'
#
class glare::logging(
$use_syslog = $::os_service_default,
$use_json = $::os_service_default,
$use_journal = $::os_service_default,
$use_stderr = $::os_service_default,
$syslog_log_facility = $::os_service_default,
$log_dir = '/var/log/glare',
$log_file = '/var/log/glare/glare.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,
) {
include glare::deps
oslo::log { 'glare_config':
use_stderr => $use_stderr,
use_syslog => $use_syslog,
use_json => $use_json,
use_journal => $use_journal,
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,
}
}

View File

@ -1,25 +0,0 @@
# Parameters for puppet-glare
#
class glare::params {
include openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$group = 'glare'
$client_package_name = "python${pyvers}-glareclient"
case $::osfamily {
'RedHat': {
$glare_package_name = 'openstack-glare'
$glare_service_name = 'openstack-glare-api'
$pyceph_package_name = "python${pyvers}-rbd"
}
'Debian': {
$glare_package_name = 'glare-api'
$glare_service_name = 'glare-api'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")
}
} # Case $::osfamily
}

View File

@ -1,68 +0,0 @@
# == Class: glare::policy
#
# Configure the glare policies
#
# === Parameters
#
# [*enforce_scope*]
# (Optional) Whether or not to enforce scope when evaluating policies.
# Defaults to $::os_service_default.
#
# [*enforce_new_defaults*]
# (Optional) Whether or not to use old deprecated defaults when evaluating
# policies.
# Defaults to $::os_service_default.
#
# [*policies*]
# (Optional) Set of policies to configure for glare
# Example :
# {
# 'glare-context_is_admin' => {
# 'key' => 'context_is_admin',
# 'value' => 'true'
# },
# 'glare-default' => {
# 'key' => 'default',
# 'value' => 'rule:admin_or_owner'
# }
# }
# Defaults to empty hash.
#
# [*policy_path*]
# (Optional) Path to the glare policy.yaml file
# Defaults to /etc/glare/policy.yaml
#
# [*policy_dirs*]
# (Optional) Path to the glare policy folder
# Defaults to $::os_service_default
#
class glare::policy (
$enforce_scope = $::os_service_default,
$enforce_new_defaults = $::os_service_default,
$policies = {},
$policy_path = '/etc/glare/policy.yaml',
$policy_dirs = $::os_service_default,
) {
include glare::deps
include glare::params
validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base {
file_path => $policy_path,
file_user => 'root',
file_group => $::glare::params::group,
file_format => 'yaml',
}
create_resources('openstacklib::policy::base', $policies)
oslo::policy { 'glare_config':
enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults,
policy_file => $policy_path,
policy_dirs => $policy_dirs,
}
}

View File

@ -1,59 +0,0 @@
{
"name": "openstack-glare",
"version": "8.0.0",
"author": "OpenStack Contributors",
"summary": "Puppet module for OpenStack Glare",
"license": "Apache-2.0",
"source": "https://opendev.org/openstack/puppet-glare.git",
"project_page": "https://launchpad.net/puppet-glare",
"issues_url": "https://bugs.launchpad.net/puppet-glare",
"description": "Installs and configures OpenStack Glare.",
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 7.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"8"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"20.04"
]
}
],
"dependencies": [
{
"name": "puppetlabs/inifile",
"version_requirement": ">=2.0.0 <3.0.0"
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 5.0.0 <8.0.0"
},
{
"name": "openstack/openstacklib",
"version_requirement": ">=19.0.0 <20.0.0"
},
{
"name": "openstack/keystone",
"version_requirement": ">=19.0.0 <20.0.0"
},
{
"name": "openstack/oslo",
"version_requirement": ">=19.0.0 <20.0.0"
}
]
}

View File

@ -1,5 +0,0 @@
---
features:
- |
Adds the pool_timeout option for configuring oslo.db. This will
configure this value for pool_timeout with SQLAlchemy.

View File

@ -1,4 +0,0 @@
---
features:
- |
Add support to configure service_token_roles in authtoken middleware.

View File

@ -1,3 +0,0 @@
---
features:
- Adds db_sync_timeout parameter to db sync.

View File

@ -1,4 +0,0 @@
---
features:
- |
Add mysql_enable_ndb parameter to select mysql storage engine.

View File

@ -1,4 +0,0 @@
---
deprecations:
- auth_uri is deprecated and will be removed in a future release.
Please use www_authenticate_uri instead.

View File

@ -1,4 +0,0 @@
---
deprecations:
- database_min_pool_size option is now deprecated for removal, the
parameter has no effect.

View File

@ -1,4 +0,0 @@
---
deprecations:
- database_idle_timeout is deprecated and will be removed in a future
release. Please use database_connection_recycle_time instead.

View File

@ -1,6 +0,0 @@
---
deprecations:
- check_revocations_for_cached option is now deprecated for removal, the
parameter has no effect.
- hash_algorithms option is now deprecated for removal, the parameter
has no effect.

View File

@ -1,4 +0,0 @@
---
upgrade:
- |
glare::logging is now not included by default in init class.

View File

@ -1,4 +0,0 @@
---
upgrade:
- |
Support for el6 (RHEL6.x, CentOS6.x and so on) has been removed.

View File

@ -1,5 +0,0 @@
---
features:
- |
The new ``glare::keystone::authtoken::interface`` parameter has been added,
which can be used to set the interface parameter in authtoken middleware.

View File

@ -1,5 +0,0 @@
---
features:
- |
The new ``glare::keystone::authtoken::service_type`` parameter has been
added to configure the service_type parameter in authtoken middleware.

View File

@ -1,4 +0,0 @@
---
upgrade:
- |
Now policy.yaml is used by default instead of policy.json.

View File

@ -1,3 +0,0 @@
---
features:
- Add openstack-db tag to Exec that run db-sync.

View File

@ -1,5 +0,0 @@
---
features:
- |
The new ``glare::policy::enforce_scope`` parameter has been added to
support the corresponding parameter in oslo.policy library.

View File

@ -1,5 +0,0 @@
---
features:
- |
There is now a new policy_dirs parameter in the glare::policy class,
so one can set a custom path.

View File

@ -1,5 +0,0 @@
---
features:
- |
The new ``glare::policy::enforce_new_defaults`` parameter has been
added.

View File

@ -1,4 +0,0 @@
---
upgrade:
- |
This module now requires a puppetlabs-mysql version >= 6.0.0

View File

@ -1,10 +0,0 @@
---
prelude: >
In this release Ubuntu has moved all projects that supported it to python3
which means that there will be a lot of changes. The Puppet OpenStack project
does not test the upgrade path from python2 to python3 packages so there might
be manual steps required when moving to the python3 packages.
upgrade:
- |
Ubuntu packages are now using python3, the upgrade path is not tested by
Puppet OpenStack. Manual steps may be required when upgrading.

View File

@ -1,4 +0,0 @@
---
upgrade:
- |
The deprecated parameter auth_uri is now removed, please use www_authenticate_uri.

View File

@ -1,5 +0,0 @@
---
upgrade:
- |
The deprecated pki related options check_revocations_for_cached and
hash_algorithms option has been removed.

View File

@ -1,3 +0,0 @@
---
upgrade:
- Deprecated idle_timeout option has been removed.

View File

@ -1,5 +0,0 @@
---
features:
- Service_token_roles_required missing in the server config file which
allows backwards compatibility to ensure that the service tokens are
compared against a list of possible roles for validity.

View File

@ -1,8 +0,0 @@
---
upgrade:
- The default value for glare::keystone::auth::internal_url
is changed to 'http://127.0.0.1:9494'.
- The default value for glare::keystone::auth::admin_url
is changed to 'http://127.0.0.1:9494'.
- The default value for glare::keystone::auth::public_url
is changed to 'http://127.0.0.1:9494'.

View File

@ -1,256 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'openstackdocstheme',
'reno.sphinxext',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
copyright = u'2016, Puppet OpenStack Developers'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'puppet-glareReleaseNotesdoc'
# -- Options for LaTeX output ---------------------------------------------
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'puppet-glareReleaseNotes.tex', u'puppet-glare Release Notes Documentation',
u'2016, Puppet OpenStack Developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'puppet-glarereleasenotes', u'puppet-glare Release Notes Documentation',
[u'2016, Puppet OpenStack Developers'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'puppet-glareReleaseNotes', u'puppet-glare Release Notes Documentation',
u'2016, Puppet OpenStack Developers', 'puppet-glareReleaseNotes', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False
# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']
# openstackdocstheme options
openstackdocs_repo_name = 'openstack/puppet-glare'
openstackdocs_bug_project = 'puppet-glare'
openstackdocs_bug_tag = ''
openstackdocs_auto_name = False

View File

@ -1,25 +0,0 @@
======================================
Welcome to puppet-glare Release Notes!
======================================
Contents
========
.. toctree::
:maxdepth: 2
unreleased
wallaby
victoria
ussuri
train
stein
rocky
queens
Indices and tables
==================
* :ref:`genindex`
* :ref:`search`

View File

@ -1,6 +0,0 @@
===================================
Queens Series Release Notes
===================================
.. release-notes::
:branch: stable/queens

View File

@ -1,6 +0,0 @@
===================================
Rocky Series Release Notes
===================================
.. release-notes::
:branch: stable/rocky

View File

@ -1,6 +0,0 @@
===================================
Stein Series Release Notes
===================================
.. release-notes::
:branch: stable/stein

View File

@ -1,6 +0,0 @@
==========================
Train Series Release Notes
==========================
.. release-notes::
:branch: stable/train

View File

@ -1,5 +0,0 @@
==============================
Current Series Release Notes
==============================
.. release-notes::

View File

@ -1,6 +0,0 @@
===========================
Ussuri Series Release Notes
===========================
.. release-notes::
:branch: stable/ussuri

View File

@ -1,6 +0,0 @@
=============================
Victoria Series Release Notes
=============================
.. release-notes::
:branch: stable/victoria

View File

@ -1,6 +0,0 @@
============================
Wallaby Series Release Notes
============================
.. release-notes::
:branch: stable/wallaby

View File

@ -1,13 +0,0 @@
[metadata]
name = puppet-glare
summary = Puppet module for OpenStack Glare
description-file =
README.md
author = OpenStack
author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/puppet-openstack-guide/latest
classifier =
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux

View File

@ -1,22 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

View File

@ -1,83 +0,0 @@
require 'spec_helper_acceptance'
describe 'basic glare config resource' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
Exec { logoutput => 'on_failure' }
File <||> -> Glare_config <||>
File <||> -> Glare_paste_ini <||>
file { '/etc/glare' :
ensure => directory,
}
file { '/etc/glare/glare.conf' :
ensure => file,
}
file { '/etc/glare/glare-paste.ini' :
ensure => file,
}
glare_config { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
glare_config { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
glare_config { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
glare_config { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
glare_paste_ini { 'DEFAULT/thisshouldexist' :
value => 'foo',
}
glare_paste_ini { 'DEFAULT/thisshouldnotexist' :
value => '<SERVICE DEFAULT>',
}
glare_paste_ini { 'DEFAULT/thisshouldexist2' :
value => '<SERVICE DEFAULT>',
ensure_absent_val => 'toto',
}
glare_paste_ini { 'DEFAULT/thisshouldnotexist2' :
value => 'toto',
ensure_absent_val => 'toto',
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file('/etc/glare/glare.conf') do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
describe '#content' do
subject { super().content }
it { is_expected.not_to match /thisshouldnotexist/ }
end
end
describe file('/etc/glare/glare-paste.ini') do
it { is_expected.to exist }
it { is_expected.to contain('thisshouldexist=foo') }
it { is_expected.to contain('thisshouldexist2=<SERVICE DEFAULT>') }
describe '#content' do
subject { super().content }
it { is_expected.not_to match /thisshouldnotexist/ }
end
end
end
end

View File

@ -1,75 +0,0 @@
#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Emilien Macchi <emilien.macchi@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for glare::backend::cinder class
#
require 'spec_helper'
describe 'glare::backend::cinder' do
let :pre_condition do
'class { "glare::keystone::authtoken": password => "pass" }'
end
shared_examples_for 'glare with cinder backend' do
context 'when default parameters' do
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/default_store').with_value('cinder')
is_expected.to contain_glare_config('glance_store/cinder_api_insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/cinder_catalog_info').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/cinder_http_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/cinder_ca_certificates_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/cinder_endpoint_template').with_value('<SERVICE DEFAULT>')
end
end
context 'when overriding parameters' do
let :params do
{
:cinder_api_insecure => true,
:cinder_ca_certificates_file => '/etc/ssh/ca.crt',
:cinder_catalog_info => 'volume:cinder:internalURL',
:cinder_endpoint_template => 'http://srv-foo:8776/v1/%(project_id)s',
:cinder_http_retries => '10',
}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/cinder_api_insecure').with_value(true)
is_expected.to contain_glare_config('glance_store/cinder_ca_certificates_file').with_value('/etc/ssh/ca.crt')
is_expected.to contain_glare_config('glance_store/cinder_catalog_info').with_value('volume:cinder:internalURL')
is_expected.to contain_glare_config('glance_store/cinder_endpoint_template').with_value('http://srv-foo:8776/v1/%(project_id)s')
is_expected.to contain_glare_config('glance_store/cinder_http_retries').with_value('10')
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 'glare with cinder backend'
end
end
end

View File

@ -1,33 +0,0 @@
require 'spec_helper'
describe 'glare::backend::file' do
shared_examples_for 'glare::backend::file' do
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/default_store').with_value('file')
is_expected.to contain_glare_config('glance_store/filesystem_store_datadir').with_value('/var/lib/glare/images/')
end
describe 'when overriding datadir' do
let :params do
{:filesystem_store_datadir => '/tmp/'}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/filesystem_store_datadir').with_value('/tmp/')
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 'glare::backend::file'
end
end
end

View File

@ -1,83 +0,0 @@
require 'spec_helper'
describe 'glare::backend::rbd' do
shared_examples 'glare::backend::rbd' do
context 'with default params' do
it { should contain_glare_config('glance_store/default_store').with_value('rbd') }
it { should contain_glare_config('glance_store/rbd_store_pool').with_value('<SERVICE DEFAULT>') }
it { should contain_glare_config('glance_store/rbd_store_ceph_conf').with_value('<SERVICE DEFAULT>') }
it { should contain_glare_config('glance_store/rbd_store_chunk_size').with_value('<SERVICE DEFAULT>') }
it { should contain_glare_config('glance_store/rados_connect_timeout').with_value('<SERVICE DEFAULT>')}
it { should contain_glare_config('glance_store/rbd_store_user').with_value('<SERVICE DEFAULT>')}
it { should contain_package('python-ceph').with(
:name => platform_params[:pyceph_package_name],
:ensure => 'present'
)}
end
context 'when passing params' do
let :params do
{
:rbd_store_user => 'user',
:rbd_store_chunk_size => '2',
:package_ensure => 'latest',
:rados_connect_timeout => '30',
}
end
it { should contain_glare_config('glance_store/rbd_store_user').with_value('user') }
it { should contain_glare_config('glance_store/rbd_store_chunk_size').with_value('2') }
it { should contain_glare_config('glance_store/rados_connect_timeout').with_value('30')}
it { should contain_package('python-ceph').with(
:name => platform_params[:pyceph_package_name],
:ensure => 'latest'
)}
end
context 'with not managed ceph package' do
let :params do
{
:package_manage => false
}
end
it { should_not contain_package('python-ceph') }
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
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian' then
pyceph_pkg = 'python3-ceph'
else
pyceph_pkg = 'python-ceph'
end
{ :pyceph_package_name => pyceph_pkg, }
when 'RedHat'
if facts[:operatingsystem] == 'Fedora'
{ :pyceph_package_name => 'python3-rbd' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :pyceph_package_name => 'python3-rbd' }
else
{ :pyceph_package_name => 'python-rbd' }
end
end
end
end
it_behaves_like 'glare::backend::rbd'
end
end
end

View File

@ -1,122 +0,0 @@
require 'spec_helper'
describe 'glare::backend::s3' do
shared_examples_for 'glare::backend::s3' do
let :params do
{
:access_key => 'access',
:secret_key => 'secret',
:host => 'host',
:bucket => 'bucket'
}
end
describe 'when default parameters' do
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/default_store').with_value('s3')
is_expected.to contain_glare_config('glance_store/s3_store_access_key').with_value('access').with_secret(true)
is_expected.to contain_glare_config('glance_store/s3_store_secret_key').with_value('secret').with_secret(true)
is_expected.to contain_glare_config('glance_store/s3_store_host').with_value('host')
is_expected.to contain_glare_config('glance_store/s3_store_bucket').with_value('bucket')
is_expected.to contain_glare_config('glance_store/s3_store_bucket_url_format').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/s3_store_create_bucket_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/s3_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/s3_store_large_object_chunk_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/s3_store_object_buffer_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/s3_store_thread_pools').with_value('<SERVICE DEFAULT>')
end
end
describe 'when overriding parameters' do
let :params do
{
:access_key => 'access2',
:secret_key => 'secret2',
:host => 'host2',
:bucket => 'bucket2',
:bucket_url_format => 'path',
:create_bucket_on_put => true,
:large_object_size => 200,
:large_object_chunk_size => 20,
:object_buffer_dir => '/tmp',
:thread_pools => 20,
}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/s3_store_access_key').with_value('access2').with_secret(true)
is_expected.to contain_glare_config('glance_store/s3_store_secret_key').with_value('secret2').with_secret(true)
is_expected.to contain_glare_config('glance_store/s3_store_host').with_value('host2')
is_expected.to contain_glare_config('glance_store/s3_store_bucket').with_value('bucket2')
is_expected.to contain_glare_config('glance_store/s3_store_bucket_url_format').with_value('path')
is_expected.to contain_glare_config('glance_store/s3_store_create_bucket_on_put').with_value('true')
is_expected.to contain_glare_config('glance_store/s3_store_large_object_size').with_value('200')
is_expected.to contain_glare_config('glance_store/s3_store_large_object_chunk_size').with_value('20')
is_expected.to contain_glare_config('glance_store/s3_store_object_buffer_dir').with_value('/tmp')
is_expected.to contain_glare_config('glance_store/s3_store_thread_pools').with_value('20')
end
end
describe 'with invalid bucket_url_format' do
let :params do
{
:access_key => 'access',
:secret_key => 'secret',
:host => 'host',
:bucket => 'bucket',
:bucket_url_format => 'invalid'
}
end
it 'throws errors' do
is_expected.to raise_error(Puppet::Error, /glare::backend::s3::bucket_url_format must be either "subdomain" or "path"/)
end
end
describe 'with invalid large_object_chunk_size' do
let :params do
{
:access_key => 'access',
:secret_key => 'secret',
:host => 'host',
:bucket => 'bucket',
:large_object_chunk_size => 1
}
end
it 'throws error' do
is_expected.to raise_error(Puppet::Error, /glare::backend::s3::large_object_chunk_size must be an integer >= 5/)
end
end
describe 'with non-integer large_object_chunk_size' do
let :params do
{
:access_key => 'access',
:secret_key => 'secret',
:host => 'host',
:bucket => 'bucket',
:large_object_chunk_size => 'string'
}
end
it 'throws error' do
is_expected.to raise_error(Puppet::Error, /glare::backend::s3::large_object_chunk_size must be an integer >= 5/)
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 'glare::backend::s3'
end
end
end

View File

@ -1,81 +0,0 @@
require 'spec_helper'
describe 'glare::backend::swift' do
shared_examples_for 'glare::backend::swift' do
let :params do
{
:swift_store_user => 'user',
:swift_store_key => 'key',
}
end
let :pre_condition do
'class { "glare::keystone::authtoken": password => "pass" }
include glare'
end
describe 'when default parameters' do
it { is_expected.to contain_class 'swift::client' }
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/default_store').with_value('swift')
is_expected.to contain_glare_config('glance_store/swift_store_large_object_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/swift_store_container').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/swift_store_create_container_on_put').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/swift_store_endpoint_type').with_value('internalURL')
is_expected.to contain_glare_config('glance_store/swift_store_region').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/swift_store_config_file').with_value('/etc/glare/glare-swift.conf')
is_expected.to contain_glare_config('glance_store/default_swift_reference').with_value('ref1')
end
end
describe 'when overriding parameters' do
let :params do
{
:swift_store_user => 'user2',
:swift_store_key => 'key2',
:swift_store_auth_version => '1',
:swift_store_auth_project_domain_id => 'proj_domain',
:swift_store_auth_user_domain_id => 'user_domain',
:swift_store_large_object_size => '100',
:swift_store_auth_address => '127.0.0.2:8080/v1.0/',
:swift_store_container => 'swift',
:swift_store_create_container_on_put => true,
:swift_store_endpoint_type => 'publicURL',
:swift_store_region => 'RegionTwo',
:default_swift_reference => 'swift_creds',
}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/swift_store_container').with_value('swift')
is_expected.to contain_glare_config('glance_store/swift_store_create_container_on_put').with_value(true)
is_expected.to contain_glare_config('glance_store/swift_store_large_object_size').with_value('100')
is_expected.to contain_glare_config('glance_store/swift_store_endpoint_type').with_value('publicURL')
is_expected.to contain_glare_config('glance_store/swift_store_region').with_value('RegionTwo')
is_expected.to contain_glare_config('glance_store/default_swift_reference').with_value('swift_creds')
is_expected.to contain_glare_swift_config('swift_creds/key').with_value('key2')
is_expected.to contain_glare_swift_config('swift_creds/user').with_value('user2')
is_expected.to contain_glare_swift_config('swift_creds/auth_version').with_value('1')
is_expected.to contain_glare_swift_config('swift_creds/auth_address').with_value('127.0.0.2:8080/v1.0/')
is_expected.to contain_glare_swift_config('swift_creds/user_domain_id').with_value('user_domain')
is_expected.to contain_glare_swift_config('swift_creds/project_domain_id').with_value('proj_domain')
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 'glare::backend::swift'
end
end
end

View File

@ -1,88 +0,0 @@
#
# Copyright (C) 2014 Mirantis
#
# Author: Steapn Rogov <srogov@mirantis.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for glare::backend::vsphere class
#
require 'spec_helper'
describe 'glare::backend::vsphere' do
let :pre_condition do
'class { "glare::keystone::authtoken": password => "pass" }'
end
shared_examples_for 'glare with vsphere backend' do
context 'when default parameters' do
let :params do
{
:vcenter_host => '10.0.0.1',
:vcenter_user => 'root',
:vcenter_password => '123456',
:vcenter_datastores => 'Datacenter:Datastore',
:vcenter_image_dir => '/openstack_glance',
}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/default_store').with_value('vsphere')
is_expected.to contain_glare_config('glance_store/vmware_insecure').with_value('True')
is_expected.to contain_glare_config('glance_store/vmware_server_host').with_value('10.0.0.1')
is_expected.to contain_glare_config('glance_store/vmware_server_username').with_value('root')
is_expected.to contain_glare_config('glance_store/vmware_server_password').with_value('123456').with_secret(true)
is_expected.to contain_glare_config('glance_store/vmware_store_image_dir').with_value('/openstack_glance')
is_expected.to contain_glare_config('glance_store/vmware_task_poll_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/vmware_api_retry_count').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('glance_store/vmware_datastores').with_value('Datacenter:Datastore')
is_expected.to contain_glare_config('glance_store/vmware_ca_file').with_value('<SERVICE DEFAULT>')
end
end
context 'when overriding parameters' do
let :params do
{
:vcenter_host => '10.0.0.1',
:vcenter_user => 'root',
:vcenter_password => '123456',
:vcenter_datastores => 'Datacenter:Datastore',
:vcenter_image_dir => '/openstack_glance',
:vcenter_ca_file => '/etc/glance/vcenter-ca.pem',
:vcenter_task_poll_interval => '6',
:vcenter_api_retry_count => '11',
}
end
it 'configures glare.conf' do
is_expected.to contain_glare_config('glance_store/vmware_ca_file').with_value('/etc/glance/vcenter-ca.pem')
is_expected.to contain_glare_config('glance_store/vmware_task_poll_interval').with_value('6')
is_expected.to contain_glare_config('glance_store/vmware_api_retry_count').with_value('11')
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 'glare with vsphere backend'
end
end
end

View File

@ -1,48 +0,0 @@
require 'spec_helper'
describe 'glare::client' do
shared_examples_for 'glare client' do
it { is_expected.to contain_class('glare::deps') }
it { is_expected.to contain_class('glare::params') }
it 'installs glare client package' do
is_expected.to contain_package('python-glareclient').with(
:ensure => 'present',
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
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
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :client_package_name => 'python3-glareclient' }
when 'RedHat'
if facts[:operatingsystem] == 'Fedora'
{ :client_package_name => 'python3-glareclient' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :client_package_name => 'python3-glareclient' }
else
{ :client_package_name => 'python-glareclient' }
end
end
end
end
it_behaves_like 'glare client'
end
end
end

View File

@ -1,75 +0,0 @@
require 'spec_helper'
describe 'glare::db::mysql' do
let :pre_condition do
'include mysql::server'
end
let :required_params do
{ :password => 'glarepass', }
end
shared_examples_for 'glare::db::mysql' do
context 'with only required params' do
let :params do
required_params
end
it { is_expected.to contain_class('glare::deps') }
it { is_expected.to contain_openstacklib__db__mysql('glare').with(
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
)}
end
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('glare').with(
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%']
)}
end
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('glare').with(
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:host => '127.0.0.1',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1'
)}
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_behaves_like 'glare::db::mysql'
end
end
end

View File

@ -1,42 +0,0 @@
require 'spec_helper'
describe 'glare::db::postgresql' do
let :pre_condition do
'include postgresql::server'
end
let :required_params do
{ :password => 'glarepass' }
end
shared_examples_for 'glare::db::postgresql' do
context 'with only required parameters' do
let :params do
required_params
end
it { is_expected.to contain_class('glare::deps') }
it { is_expected.to contain_openstacklib__db__postgresql('glare').with(
:user => 'glare',
:password => 'glarepass',
:dbname => 'glare',
:encoding => nil,
:privileges => 'ALL',
)}
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({ :concat_basedir => '/var/lib/puppet/concat' }))
end
it_behaves_like 'glare::db::postgresql'
end
end
end

View File

@ -1,63 +0,0 @@
require 'spec_helper'
describe 'glare::db' do
shared_examples 'glare::db' do
context 'with default parameters' do
it { should contain_class('glare::deps') }
it { should contain_oslo__db('glare_config').with(
:db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/glare/glare.sqlite',
:connection_recycle_time => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
:mysql_enable_ndb => '<SERVICE DEFAULT>',
)}
end
context 'with specific parameters' do
let :params do
{
:database_connection => 'mysql+pymysql://glare:glare@localhost/glare',
:database_connection_recycle_time => '3601',
:database_db_max_retries => '-1',
:database_max_retries => '11',
:database_retry_interval => '11',
:database_max_pool_size => '11',
:database_max_overflow => '21',
:database_pool_timeout => '21',
:mysql_enable_ndb => true,
}
end
it { should contain_class('glare::deps') }
it { should contain_oslo__db('glare_config').with(
:db_max_retries => '-1',
:connection => 'mysql+pymysql://glare:glare@localhost/glare',
:connection_recycle_time => '3601',
:max_pool_size => '11',
:max_retries => '11',
:retry_interval => '11',
:max_overflow => '21',
:pool_timeout => '21',
:mysql_enable_ndb => true,
)}
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_behaves_like 'glare::db'
end
end
end

View File

@ -1,71 +0,0 @@
require 'spec_helper'
describe 'glare::db::sync' do
shared_examples_for 'glare-dbsync' do
it { is_expected.to contain_class('glare::deps') }
it 'runs glare-manage db_sync' do
is_expected.to contain_exec('glare-db-sync').with(
:command => 'glare-db-manage upgrade',
:user => 'glare',
:path => ["/bin/","/usr/bin/" ,"/usr/local/bin"],
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 300,
:logoutput => 'on_failure',
:subscribe => ['Anchor[glare::install::end]',
'Anchor[glare::config::end]',
'Anchor[glare::dbsync::begin]'],
:notify => 'Anchor[glare::dbsync::end]',
:tag => 'openstack-db',
)
end
describe "overriding params" do
let :params do
{
:extra_params => '--config-file /etc/glare/glare.conf',
:db_sync_timeout => 750,
}
end
it {
is_expected.to contain_exec('glare-db-sync').with(
:command => 'glare-db-manage --config-file /etc/glare/glare.conf upgrade',
:user => 'glare',
:path => ["/bin/","/usr/bin/" ,"/usr/local/bin"],
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 750,
:logoutput => 'on_failure',
:subscribe => ['Anchor[glare::install::end]',
'Anchor[glare::config::end]',
'Anchor[glare::dbsync::begin]'],
:notify => 'Anchor[glare::dbsync::end]',
:tag => 'openstack-db',
)
}
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({
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'glare-dbsync'
end
end
end

View File

@ -1,103 +0,0 @@
require 'spec_helper'
describe 'glare' do
let :pre_condition do
"class { 'glare::keystone::authtoken':
password => 'ChangeMe' }"
end
shared_examples 'glare' do
context 'with default parameters' do
let :params do
{ :purge_config => false }
end
it 'contains the params class' do
is_expected.to contain_class('glare::params')
end
it 'contains the db class' do
is_expected.to contain_class('glare::db')
end
it 'installs package' do
is_expected.to contain_package('glare').with(
:ensure => 'present',
:name => platform_params[:glare_package_name]
)
end
it 'passes purge to resource' do
is_expected.to contain_resources('glare_config').with({
:purge => false
})
end
it { is_expected.to contain_glare_config('DEFAULT/bind_host').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glare_config('DEFAULT/bind_port').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_glare_config('DEFAULT/backlog').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_class('glare::db::sync') }
it 'configures storage' do
is_expected.to contain_glare_config('glance_store/os_region_name').with_value('RegionOne')
is_expected.to contain_glare_config('glance_store/stores').with_ensure('absent')
is_expected.not_to contain_glare_config('glance_store/default_store')
is_expected.to contain_glare_config('glance_store/filesystem_store_datadir').with_value('/var/lib/glare/images')
end
it 'is_expected.to configure itself for keystone if it needed' do
if :auth_strategy == 'keystone'
is_expected.to contain_class('glare::authtoken')
end
end
it 'configures ssl' do
is_expected.to contain_glare_config('DEFAULT/cert_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('DEFAULT/key_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('DEFAULT/ca_file').with_value('<SERVICE DEFAULT>')
end
it { is_expected.to contain_service('glare').with(
'ensure' => 'running',
'name' => platform_params[:glare_service_name],
'enable' => true,
) }
end
context 'with db sync disabled' do
let :params do
{ :sync_db => false }
end
it { is_expected.not_to contain_class('glare::db::sync') }
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
case facts[:osfamily]
when 'Debian'
let (:platform_params) do
{ :glare_package_name => 'glare-api',
:glare_service_name => 'glare-api' }
end
when 'RedHat'
let (:platform_params) do
{ :glare_package_name => 'openstack-glare',
:glare_service_name => 'openstack-glare-api' }
end
end
it_behaves_like 'glare'
end
end
end

View File

@ -1,128 +0,0 @@
#
# Unit tests for glare::keystone::auth
#
require 'spec_helper'
describe 'glare::keystone::auth' do
shared_examples_for 'glare-keystone-auth' do
context 'with default class parameters' do
let :params do
{ :password => 'glare_password',
:tenant => 'foobar' }
end
it { is_expected.to contain_keystone_user('glare').with(
:ensure => 'present',
:password => 'glare_password',
) }
it { is_expected.to contain_keystone_user_role('glare@foobar').with(
:ensure => 'present',
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('glare::artifact').with(
:ensure => 'present',
:description => 'Glare Artifact Repository Service'
) }
it { is_expected.to contain_keystone_endpoint('RegionOne/glare::artifact').with(
:ensure => 'present',
:public_url => 'http://127.0.0.1:9494',
:admin_url => 'http://127.0.0.1:9494',
:internal_url => 'http://127.0.0.1:9494',
) }
end
context 'when overriding URL parameters' do
let :params do
{ :password => 'glare_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_endpoint('RegionOne/glare::artifact').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 => 'glarey' }
end
it { is_expected.to contain_keystone_user('glarey') }
it { is_expected.to contain_keystone_user_role('glarey@services') }
it { is_expected.to contain_keystone_service('glare::artifact') }
it { is_expected.to contain_keystone_endpoint('RegionOne/glare::artifact') }
end
context 'when overriding service name' do
let :params do
{ :service_name => 'glare_service',
:auth_name => 'glare',
:password => 'glare_password' }
end
it { is_expected.to contain_keystone_user('glare') }
it { is_expected.to contain_keystone_user_role('glare@services') }
it { is_expected.to contain_keystone_service('glare_service::artifact') }
it { is_expected.to contain_keystone_endpoint('RegionOne/glare_service::artifact') }
end
context 'when disabling user configuration' do
let :params do
{
:password => 'glare_password',
:configure_user => false
}
end
it { is_expected.not_to contain_keystone_user('glare') }
it { is_expected.to contain_keystone_user_role('glare@services') }
it { is_expected.to contain_keystone_service('glare::artifact').with(
:ensure => 'present',
:description => 'Glare Artifact Repository Service'
) }
end
context 'when disabling user and user role configuration' do
let :params do
{
:password => 'glare_password',
:configure_user => false,
:configure_user_role => false
}
end
it { is_expected.not_to contain_keystone_user('glare') }
it { is_expected.not_to contain_keystone_user_role('glare@services') }
it { is_expected.to contain_keystone_service('glare::artifact').with(
:ensure => 'present',
:description => 'Glare Artifact Repository Service'
) }
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_behaves_like 'glare-keystone-auth'
end
end
end

View File

@ -1,150 +0,0 @@
require 'spec_helper'
describe 'glare::keystone::authtoken' do
let :params do
{ :password => 'secrete', }
end
shared_examples 'glare authtoken' do
context 'with default parameters' do
it 'configure keystone_authtoken' do
is_expected.to contain_glare_config('keystone_authtoken/username').with_value('glare')
is_expected.to contain_glare_config('keystone_authtoken/password').with_value('secrete')
is_expected.to contain_glare_config('keystone_authtoken/auth_url').with_value('http://localhost:5000')
is_expected.to contain_glare_config('keystone_authtoken/project_name').with_value('services')
is_expected.to contain_glare_config('keystone_authtoken/user_domain_name').with_value('Default')
is_expected.to contain_glare_config('keystone_authtoken/project_domain_name').with_value('Default')
is_expected.to contain_glare_config('keystone_authtoken/insecure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/auth_section').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/auth_type').with_value('password')
is_expected.to contain_glare_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000')
is_expected.to contain_glare_config('keystone_authtoken/auth_version').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/delay_auth_decision').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/enforce_token_bind').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/http_connect_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/http_request_max_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/include_service_catalog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_conn_get_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_dead_retry').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_maxsize').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_socket_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_unused_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_secret_key').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_security_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcache_use_advanced_pool').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/memcached_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/token_cache_time').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/service_token_roles').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/service_token_roles_required').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/service_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_glare_config('keystone_authtoken/interface').with_value('<SERVICE DEFAULT>')
end
end
context 'when overriding parameters' do
before do
params.merge!({
:www_authenticate_uri => 'https://10.0.0.1:9999/',
:username => 'myuser',
:password => 'mypasswd',
:auth_url => 'https://127.0.0.1:5000',
:project_name => 'service_project',
:user_domain_name => 'domainX',
:project_domain_name => 'domainX',
:insecure => false,
:auth_section => 'new_section',
:auth_type => 'password',
:auth_version => 'v3',
:cache => 'somevalue',
:cafile => '/opt/stack/data/cafile.pem',
:certfile => 'certfile.crt',
:delay_auth_decision => false,
:enforce_token_bind => 'permissive',
:http_connect_timeout => '300',
:http_request_max_retries => '3',
:include_service_catalog => true,
:keyfile => 'keyfile',
:memcache_pool_conn_get_timeout => '9',
:memcache_pool_dead_retry => '302',
:memcache_pool_maxsize => '11',
:memcache_pool_socket_timeout => '2',
:memcache_pool_unused_timeout => '61',
:memcache_secret_key => 'secret_key',
:memcache_security_strategy => 'ENCRYPT',
:memcache_use_advanced_pool => true,
:memcached_servers => ['memcached01:11211','memcached02:11211'],
:manage_memcache_package => true,
:region_name => 'region2',
:token_cache_time => '301',
:service_token_roles => ['service'],
:service_token_roles_required => false,
:service_type => 'identity',
:interface => 'internal',
})
end
it 'configure keystone_authtoken' do
is_expected.to contain_glare_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/')
is_expected.to contain_glare_config('keystone_authtoken/username').with_value(params[:username])
is_expected.to contain_glare_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true)
is_expected.to contain_glare_config('keystone_authtoken/auth_url').with_value(params[:auth_url])
is_expected.to contain_glare_config('keystone_authtoken/project_name').with_value(params[:project_name])
is_expected.to contain_glare_config('keystone_authtoken/user_domain_name').with_value(params[:user_domain_name])
is_expected.to contain_glare_config('keystone_authtoken/project_domain_name').with_value(params[:project_domain_name])
is_expected.to contain_glare_config('keystone_authtoken/insecure').with_value(params[:insecure])
is_expected.to contain_glare_config('keystone_authtoken/auth_section').with_value(params[:auth_section])
is_expected.to contain_glare_config('keystone_authtoken/auth_type').with_value(params[:auth_type])
is_expected.to contain_glare_config('keystone_authtoken/auth_version').with_value(params[:auth_version])
is_expected.to contain_glare_config('keystone_authtoken/cache').with_value(params[:cache])
is_expected.to contain_glare_config('keystone_authtoken/cafile').with_value(params[:cafile])
is_expected.to contain_glare_config('keystone_authtoken/certfile').with_value(params[:certfile])
is_expected.to contain_glare_config('keystone_authtoken/delay_auth_decision').with_value(params[:delay_auth_decision])
is_expected.to contain_glare_config('keystone_authtoken/enforce_token_bind').with_value(params[:enforce_token_bind])
is_expected.to contain_glare_config('keystone_authtoken/http_connect_timeout').with_value(params[:http_connect_timeout])
is_expected.to contain_glare_config('keystone_authtoken/http_request_max_retries').with_value(params[:http_request_max_retries])
is_expected.to contain_glare_config('keystone_authtoken/include_service_catalog').with_value(params[:include_service_catalog])
is_expected.to contain_glare_config('keystone_authtoken/keyfile').with_value(params[:keyfile])
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_conn_get_timeout').with_value(params[:memcache_pool_conn_get_timeout])
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_dead_retry').with_value(params[:memcache_pool_dead_retry])
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_maxsize').with_value(params[:memcache_pool_maxsize])
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_socket_timeout').with_value(params[:memcache_pool_socket_timeout])
is_expected.to contain_glare_config('keystone_authtoken/memcache_pool_unused_timeout').with_value(params[:memcache_pool_unused_timeout])
is_expected.to contain_glare_config('keystone_authtoken/memcache_secret_key').with_value(params[:memcache_secret_key])
is_expected.to contain_glare_config('keystone_authtoken/memcache_security_strategy').with_value(params[:memcache_security_strategy])
is_expected.to contain_glare_config('keystone_authtoken/memcache_use_advanced_pool').with_value(params[:memcache_use_advanced_pool])
is_expected.to contain_glare_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211')
is_expected.to contain_glare_config('keystone_authtoken/region_name').with_value(params[:region_name])
is_expected.to contain_glare_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time])
is_expected.to contain_glare_config('keystone_authtoken/service_token_roles').with_value(params[:service_token_roles])
is_expected.to contain_glare_config('keystone_authtoken/service_token_roles_required').with_value(params[:service_token_roles_required])
is_expected.to contain_glare_config('keystone_authtoken/service_type').with_value(params[:service_type])
is_expected.to contain_glare_config('keystone_authtoken/interface').with_value(params[:interface])
end
it 'installs python memcache package' do
is_expected.to contain_package('python-memcache')
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 'glare authtoken'
end
end
end

View File

@ -1,133 +0,0 @@
require 'spec_helper'
describe 'glare::logging' do
let :params do
{
}
end
let :log_params do
{
:logging_context_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s',
:logging_default_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s',
:logging_debug_format_suffix => '%(funcName)s %(pathname)s:%(lineno)d',
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
:log_config_append => '/etc/glare/logging.conf',
:publish_errors => true,
:default_log_levels => {
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
'sqlalchemy' => 'WARN', 'suds' => 'INFO', 'iso8601' => 'WARN',
'requests.packages.urllib3.connectionpool' => 'WARN' },
:fatal_deprecations => true,
:instance_format => '[instance: %(uuid)s] ',
:instance_uuid_format => '[instance: %(uuid)s] ',
:log_date_format => '%Y-%m-%d %H:%M:%S',
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:syslog_log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glare_random.log',
:debug => true,
}
end
shared_examples_for 'glare-logging' do
context 'with basic logging options and default settings' do
it_configures 'basic default logging settings'
end
context 'with basic logging options and non-default settings' do
before { params.merge!( log_params ) }
it_configures 'basic non-default logging settings'
end
context 'with extended logging options' do
before { params.merge!( log_params ) }
it_configures 'logging params set'
end
context 'without extended logging options' do
it_configures 'logging params unset'
end
end
shared_examples 'basic default logging settings' do
it 'configures glare logging settings with default values' do
is_expected.to contain_oslo__log('glare_config').with(
:use_syslog => '<SERVICE DEFAULT>',
:use_json => '<SERVICE DEFAULT>',
:use_journal => '<SERVICE DEFAULT>',
:use_stderr => '<SERVICE DEFAULT>',
:syslog_log_facility => '<SERVICE DEFAULT>',
:log_dir => '/var/log/glare',
:log_file => '/var/log/glare/glare.log',
:debug => '<SERVICE DEFAULT>',
)
end
end
shared_examples 'basic non-default logging settings' do
it 'configures glare logging settings with non-default values' do
is_expected.to contain_oslo__log('glare_config').with(
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:syslog_log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/glare_random.log',
:debug => true,
)
end
end
shared_examples_for 'logging params set' do
it 'enables logging params' do
is_expected.to contain_oslo__log('glare_config').with(
:logging_context_format_string =>
'%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s',
:logging_default_format_string => '%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s',
:logging_debug_format_suffix => '%(funcName)s %(pathname)s:%(lineno)d',
:logging_exception_prefix => '%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s %(instance)s',
:log_config_append => '/etc/glare/logging.conf',
:publish_errors => true,
:default_log_levels => {
'amqp' => 'WARN', 'amqplib' => 'WARN', 'boto' => 'WARN',
'sqlalchemy' => 'WARN', 'suds' => 'INFO', 'iso8601' => 'WARN',
'requests.packages.urllib3.connectionpool' => 'WARN' },
:fatal_deprecations => true,
:instance_format => '[instance: %(uuid)s] ',
:instance_uuid_format => '[instance: %(uuid)s] ',
:log_date_format => '%Y-%m-%d %H:%M:%S',
)
end
end
shared_examples_for 'logging params unset' do
[ :logging_context_format_string, :logging_default_format_string,
:logging_debug_format_suffix, :logging_exception_prefix,
:log_config_append, :publish_errors,
:default_log_levels, :fatal_deprecations,
:instance_format, :instance_uuid_format,
:log_date_format, ].each { |param|
it { is_expected.to contain_oslo__log('glare_config').with("#{param}" => '<SERVICE DEFAULT>') }
}
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 'glare-logging'
end
end
end

View File

@ -1,48 +0,0 @@
require 'spec_helper'
describe 'glare::policy' do
shared_examples 'glare::policy' do
let :params do
{
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_path => '/etc/glare/policy.yaml',
:policy_dirs => '/etc/glare/policy.d',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
'value' => 'foo:bar'
}
}
}
end
it 'set up the policies' do
is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
:key => 'context_is_admin',
:value => 'foo:bar',
:file_user => 'root',
:file_group => 'glare',
:file_format => 'yaml',
})
is_expected.to contain_oslo__policy('glare_config').with(
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_file => '/etc/glare/policy.yaml',
:policy_dirs => '/etc/glare/policy.d',
)
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_behaves_like 'glare::policy'
end
end
end

View File

@ -1,5 +0,0 @@
shared_examples_for "a Puppet::Error" do |description|
it "with message matching #{description.inspect}" do
expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
end
end

View File

@ -1,10 +0,0 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
require 'puppet-openstack_spec_helper/facts'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
end
at_exit { RSpec::Puppet::Coverage.report! }

View File

@ -1 +0,0 @@
require 'puppet-openstack_spec_helper/litmus_spec_helper'

View File

@ -1,68 +0,0 @@
#
# these tests are a little concerning b/c they are hacking around the
# modulepath, so these tests will not catch issues that may eventually arise
# related to loading these plugins.
# I could not, for the life of me, figure out how to programatcally set the modulepath
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:glare_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::Glare_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::Glare_config.new(
{:name => 'dude/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Glare_config.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Glare_config.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,67 +0,0 @@
#
# these tests are a little concerning b/c they are hacking around the
# modulepath, so these tests will not catch issues that may eventually arise
# related to loading these plugins.
# I could not, for the life of me, figure out how to programatcally set the modulepath
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper'
provider_class = Puppet::Type.type(:glare_paste_ini).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Glare_paste_ini.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::Glare_paste_ini.new(
{:name => 'dude/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Glare_paste_ini.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Glare_paste_ini.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end

View File

@ -1,65 +0,0 @@
require 'puppet'
require 'puppet/type/glare_config'
describe 'Puppet::Type.type(:glare_config)' do
before :each do
@glare_config = Puppet::Type.type(:glare_config).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should require a name' do
expect {
Puppet::Type.type(:glare_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(:glare_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(:glare_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(:glare_config).new(:name => 'DEFAULT/foo', :ensure => :absent)
end
it 'should accept a valid value' do
@glare_config[:value] = 'bar'
expect(@glare_config[:value]).to eq('bar')
end
it 'should not accept a value with whitespace' do
@glare_config[:value] = 'b ar'
expect(@glare_config[:value]).to eq('b ar')
end
it 'should accept valid ensure values' do
@glare_config[:ensure] = :present
expect(@glare_config[:ensure]).to eq(:present)
@glare_config[:ensure] = :absent
expect(@glare_config[:ensure]).to eq(:absent)
end
it 'should not accept invalid ensure values' do
expect {
@glare_config[:ensure] = :latest
}.to raise_error(Puppet::Error, /Invalid value/)
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'glare::install::end')
catalog.add_resource anchor, @glare_config
dependency = @glare_config.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@glare_config)
expect(dependency[0].source).to eq(anchor)
end
end

View File

@ -1,63 +0,0 @@
require 'puppet'
require 'puppet/type/glare_config'
describe 'Puppet::Type.type(:glare_paste_ini)' do
before :each do
@glare_paste_ini = Puppet::Type.type(:glare_paste_ini).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should require a name' do
expect {
Puppet::Type.type(:glare_paste_ini).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(:glare_paste_ini).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(:glare_paste_ini).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(:glare_paste_ini).new(:name => 'DEFAULT/foo', :ensure => :absent)
end
it 'should accept a valid value' do
@glare_paste_ini[:value] = 'bar'
expect(@glare_paste_ini[:value]).to eq('bar')
end
it 'should not accept a value with whitespace' do
@glare_paste_ini[:value] = 'b ar'
expect(@glare_paste_ini[:value]).to eq('b ar')
end
it 'should accept valid ensure values' do
@glare_paste_ini[:ensure] = :present
expect(@glare_paste_ini[:ensure]).to eq(:present)
@glare_paste_ini[:ensure] = :absent
expect(@glare_paste_ini[:ensure]).to eq(:absent)
end
it 'should not accept invalid ensure values' do
expect {
@glare_paste_ini[:ensure] = :latest
}.to raise_error(Puppet::Error, /Invalid value/)
end
it 'should autorequire the package that install the file' do
catalog = Puppet::Resource::Catalog.new
anchor = Puppet::Type.type(:anchor).new(:name => 'glare::install::end')
catalog.add_resource anchor, @glare_paste_ini
dependency = @glare_paste_ini.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@glare_paste_ini)
expect(dependency[0].source).to eq(anchor)
end
end

13
tox.ini
View File

@ -1,13 +0,0 @@
[tox]
minversion = 3.1
skipsdist = True
envlist = releasenotes
ignore_basepython_conflict = True
[testenv]
basepython = python3
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html