Retire repository

Fuel repositories are all retired in openstack namespace, retire
remaining fuel repos in x namespace since they are unused now.

This change removes all content from the repository and adds the usual
README file to point out that the repository is retired following the
process from
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project

See also
http://lists.openstack.org/pipermail/openstack-discuss/2019-December/011675.html

A related change is: https://review.opendev.org/699752 .

Change-Id: I44f6dd1d0ad49857b5b04abfefbade04e4a6a157
This commit is contained in:
Andreas Jaeger 2019-12-18 19:33:47 +01:00
parent cd596e01df
commit fee86782f5
113 changed files with 10 additions and 8277 deletions

6
.gitignore vendored
View File

@ -1,6 +0,0 @@
.tox
.build
*.pyc
docs/build
fuel-plugin-dbaas-trove-*.rpm
repositories/ubuntu/*.deb

202
LICENSE
View File

@ -1,202 +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.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.

View File

@ -1,4 +0,0 @@
fuel-plugin-dbaas-trove
============
Plugin description

10
README.rst Normal file
View File

@ -0,0 +1,10 @@
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,8 +0,0 @@
- name: additional_service:fuel-plugin-dbaas-trove
compatible: []
requires: []
incompatible: []
label: "Install Trove"
description: |
Trove provides scalable and reliable cloud Database as a Service provisioning
functionality for both relational and non-relational database engines.

View File

@ -1,4 +0,0 @@
#!/bin/bash
# It's a script which deploys your plugin
echo fuel-plugin-dbaas-trove > /tmp/fuel-plugin-dbaas-trove

View File

@ -1,71 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::db
class dbaas_trove::db {
notice('MODULAR: dbaas_trove/db')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
if ($trove_enabled) {
$mysql_hash = hiera_hash('mysql', {})
$management_vip = hiera('management_vip', undef)
$database_vip = hiera('database_vip', undef)
$mysql_root_user = pick($mysql_hash['root_user'], 'root')
$mysql_db_create = pick($mysql_hash['db_create'], true)
$mysql_root_password = $mysql_hash['root_password']
$db_user = pick($trove['db_user'], 'trove')
$db_name = pick($trove['db_name'], 'trove')
$db_password = $trove['db_password']
$db_host = pick($trove['metadata']['db_host'], $database_vip)
$db_create = pick($trove['metadata']['db_create'], $mysql_db_create)
$db_root_user = pick($trove['metadata']['root_user'], $mysql_root_user)
$db_root_password = pick($trove['metadata']['root_password'], $mysql_root_password)
$allowed_hosts = [ 'localhost', '127.0.0.1', '%' ]
if $db_create {
class { '::galera::client':
custom_setup_class => hiera('mysql_custom_setup_class', 'galera'),
}
class { '::trove::db::mysql':
user => $db_user,
password => $db_password,
dbname => $db_name,
allowed_hosts => $allowed_hosts,
}
class { '::osnailyfacter::mysql_access':
db_host => $db_host,
db_user => $db_root_user,
db_password => $db_root_password,
}
Class['::galera::client'] ->
Class['::osnailyfacter::mysql_access'] ->
Class['::trove::db::mysql']
}
}
}

View File

@ -1,107 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::firewall
class dbaas_trove::firewall {
notice('MODULAR: dbaas_trove/firewall.pp')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
if ($trove_enabled) {
$network_scheme = hiera_hash('network_scheme')
$trove_amqp_port = hiera('amqp_port')
$trove_api_port = hiera('trove_api_port')
$corosync_input_port = 5404
$corosync_output_port = 5405
$erlang_epmd_port = 4369
$erlang_inet_dist_port = 41055
$erlang_rabbitmq_backend_port = $trove_amqp_port
$erlang_rabbitmq_port = $trove_amqp_port
$pcsd_port = 2224
$trove_networks = get_routable_networks_for_network_role($network_scheme, 'trove/api')
$corosync_networks = $trove_networks
openstack::firewall::multi_net {'210 trove-api':
port => $trove_api_port,
proto => 'tcp',
action => 'accept',
source_nets => $trove_networks,
}
openstack::firewall::multi_net {'106 rabbitmq':
port => [$erlang_epmd_port, $erlang_rabbitmq_port, $erlang_rabbitmq_backend_port, $erlang_inet_dist_port],
proto => 'tcp',
action => 'accept',
source_nets => $trove_networks,
}
# Workaround for fuel bug with firewall
firewall {'003 remote rabbitmq ':
sport => [$erlang_epmd_port, $erlang_rabbitmq_port, $erlang_rabbitmq_backend_port, $erlang_inet_dist_port, 55672, 61613],
source => hiera('master_ip'),
proto => 'tcp',
action => 'accept',
}
# allow local rabbitmq admin traffic for LP#1383258
firewall {'005 local rabbitmq admin':
sport => [ 15672 ],
iniface => 'lo',
proto => 'tcp',
action => 'accept',
}
# reject all non-local rabbitmq admin traffic for LP#1450443
firewall {'006 reject non-local rabbitmq admin':
sport => [ 15672 ],
proto => 'tcp',
action => 'drop',
}
# allow connections from haproxy namespace
firewall {'030 allow connections from haproxy namespace':
source => '240.0.0.2',
action => 'accept',
}
openstack::firewall::multi_net {'113 corosync-input':
port => $corosync_input_port,
proto => 'udp',
action => 'accept',
source_nets => $corosync_networks,
}
openstack::firewall::multi_net {'114 corosync-output':
port => $corosync_output_port,
proto => 'udp',
action => 'accept',
source_nets => $corosync_networks,
}
openstack::firewall::multi_net {'115 pcsd-server':
port => $pcsd_port,
proto => 'tcp',
action => 'accept',
source_nets => $corosync_networks,
}
}
}

View File

@ -1,103 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::hiera_override
class dbaas_trove::hiera_override {
notice('MODULAR: dbaas_trove/hiera_override.pp')
$plugin_name = 'fuel-plugin-dbaas-trove'
$trove = hiera_hash($plugin_name, undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
$hiera_dir = '/etc/hiera/override'
if ($trove_enabled) {
$plugin_yaml = "${plugin_name}.yaml"
$network_metadata = hiera_hash('network_metadata')
if empty($network_metadata) {
fail('Network_metadata not given in the astute.yaml')
}
$trove_roles = [ 'primary-trove', 'trove' ]
$trove_nodes = get_nodes_hash_by_roles($network_metadata, $trove_roles)
$trove_address_map = get_node_to_ipaddr_map_by_network_role(
$trove_nodes,
'trove/api'
)
$trove_nodes_ips = values($trove_address_map)
$trove_nodes_names = keys($trove_address_map)
$corosync_roles = $trove_roles
$corosync_nodes = $trove_nodes
$amqp_port = hiera('amqp_port', '5673')
$trove_amqp_port = hiera($trove['rabbit_port'], '55671')
$rabbit_username = $trove['rabbit_user']
$rabbit_password = $trove['rabbit_password']
$trove_api_port = hiera($trove['trove_api_port'], 8779)
$trove_amqp_hosts = inline_template("<%= @trove_nodes_ips.map {|x| x + ':' + @trove_amqp_port}.join ',' %>")
}
$calculated_content = inline_template('<%
require "yaml"
data = {
"trove_amqp_hosts" => @trove_amqp_hosts,
"amqp_port" => @trove_amqp_port ,
"infra_amqp_port" => @amqp_port,
"trove_api_port" => @trove_api_port,
"rabbit_hash" => {
"user" => @rabbit_username ,
"password" => @rabbit_password ,
} ,
}
#data["trove_nodes"] = @trove_nodes if @trove_nodes
data["corosync_nodes"] = @corosync_nodes if @corosync_nodes
data["corosync_roles"] = @corosync_roles if @corosync_roles
-%>
<%= YAML.dump(data) %>')
file { $hiera_dir :
ensure => 'directory',
path => $hiera_dir,
} ->
file { "${hiera_dir}/${plugin_yaml}" :
ensure => 'present',
content => $calculated_content,
}
package {'ruby-deep-merge':
ensure => 'installed',
}
# hiera file changes between 7.0 and 8.0 so we need to handle the override the
# different yaml formats via these exec hacks. It should be noted that the
# fuel hiera task will wipe out these this update to the hiera.yaml
exec { "${plugin_name}_hiera_override_7.0":
command => "sed -i '/ - override\\/plugins/a\\ - override\\/${plugin_name}' /etc/hiera.yaml",
path => '/bin:/usr/bin',
unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml",
onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml'
}
exec { "${plugin_name}_hiera_override_8.0":
command => "sed -i '/ - override\\/plugins/a\\ - override\\/${plugin_name}' /etc/hiera.yaml",
path => '/bin:/usr/bin',
unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml",
onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml'
}
}

View File

@ -1,74 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::keystone
class dbaas_trove::keystone {
notice('MODULAR: dbaas_trove/keystone')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
if ($trove_enabled) {
$management_vip = hiera('management_vip')
$public_ssl_hash = hiera_hash('public_ssl', {})
$ssl_hash = hiera_hash('use_ssl', {})
$public_vip = hiera('public_vip')
$public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'protocol', 'http')
$public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'hostname', [$public_vip])
$internal_protocol = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'protocol', 'http')
$internal_address = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'hostname', [$management_vip])
$admin_protocol = get_ssl_property($ssl_hash, {}, 'trove', 'admin', 'protocol', 'http')
$admin_address = get_ssl_property($ssl_hash, {}, 'trove', 'admin', 'hostname', [$management_vip])
$region = pick($trove['region'], hiera('region', 'RegionOne'))
$password = $trove['auth_password']
$auth_name = pick($trove['auth_name'], 'trove')
$configure_endpoint = pick($trove['configure_endpoint'], true)
$service_name = pick($trove['service_name'], 'trove')
$tenant = pick($trove['tenant'], 'services')
validate_string($public_address)
validate_string($password)
$bind_port = '8779'
$public_url = "${public_protocol}://${public_address}:${bind_port}/v1.0/%(tenant_id)s"
$internal_url = "${internal_protocol}://${internal_address}:${bind_port}/v1.0/%(tenant_id)s"
$admin_url = "${admin_protocol}://${admin_address}:${bind_port}/v1.0/%(tenant_id)s"
Class['::osnailyfacter::wait_for_keystone_backends'] -> Class['::trove::keystone::auth']
class {'::osnailyfacter::wait_for_keystone_backends': }
class { '::trove::keystone::auth':
configure_endpoint => $configure_endpoint,
service_name => $service_name,
region => $region,
auth_name => $auth_name,
password => $password,
email => "${auth_name}@localhost",
tenant => $tenant,
public_url => $public_url,
internal_url => $internal_url,
admin_url => $admin_url,
}
}
}

View File

@ -1,103 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::openstack_haproxy_trove
class dbaas_trove::openstack_haproxy_trove {
notice('MODULAR: dbaas_trove/openstack_haproxy_trove.pp')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
if ($trove_enabled) {
$network_metadata = hiera_hash('network_metadata', {})
$public_ssl_hash = hiera_hash('public_ssl', {})
$ssl_hash = hiera_hash('use_ssl', {})
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'usage', false)
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'path', [''])
$internal_ssl = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'usage', false)
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'path', [''])
$external_lb = hiera('external_lb', false)
$trove_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-trove', 'trove'])
$trove_amqp_use_ssl = pick($trove['metadata']['rabbit_use_ssl'], true)
$trove_amqp_port = hiera($trove['rabbit_port'], '55671')
$trove_api_port = hiera($trove['metadata']['trove_api_port'], 8779)
if (!$external_lb) {
$trove_address_map = get_node_to_ipaddr_map_by_network_role($trove_nodes, 'trove/api')
$server_names = hiera_array('trove_names', keys($trove_address_map))
$ipaddresses = hiera_array('trove_ipaddresses', values($trove_address_map))
$public_virtual_ip = hiera('public_vip')
$internal_virtual_ip = hiera('management_vip')
# configure trove ha proxy
Openstack::Ha::Haproxy_service {
internal_virtual_ip => $internal_virtual_ip,
ipaddresses => $ipaddresses,
public_virtual_ip => $public_virtual_ip,
server_names => $server_names,
public => true,
internal_ssl => $internal_ssl,
internal_ssl_path => $internal_ssl_path,
}
openstack::ha::haproxy_service { 'trove-api':
order => '206',
listen_port => $trove_api_port,
public_ssl => $public_ssl,
public_ssl_path => $public_ssl_path,
#require_service => 'trove-api',
haproxy_config_options => {
option => ['httpchk', 'httplog', 'httpclose'],
'timeout server' => '660s',
'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
},
balancermember_options => 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3',
}
if($public_ssl and $trove_amqp_use_ssl) {
$rabbit_public_ssl = true
} else {
$rabbit_public_ssl = false
}
openstack::ha::haproxy_service { 'trove-rabbitmq':
order => '205',
listen_port => $trove_amqp_port,
public_ssl => $rabbit_public_ssl,
public_ssl_path => $public_ssl_path,
internal => false,
define_backups => true,
haproxy_config_options => {
'option' => ['tcpka'],
'timeout client' => '48h',
'timeout server' => '48h',
'balance' => 'roundrobin',
'mode' => 'tcp',
},
balancermember_options => 'check inter 5000 rise 2 fall 3',
}
}
}
}

View File

@ -1,103 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::ssl_add_trust_chain
class dbaas_trove::ssl_add_trust_chain {
notice('MODULAR: dbaas_trove/ssl_add_trust_chain.pp')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
}
File {
ensure => file,
}
define file_link {
$service = $name
if !empty(file("/etc/pki/tls/certs/public_${service}.pem",'/dev/null')) {
file { "/usr/local/share/ca-certificates/${service}_public_haproxy.crt":
source => "/etc/pki/tls/certs/public_${service}.pem",
}
}
if !empty(file("/etc/pki/tls/certs/internal_${service}.pem",'/dev/null')) {
file { "/usr/local/share/ca-certificates/${service}_internal_haproxy.crt":
source => "/etc/pki/tls/certs/internal_${service}.pem",
}
}
if !empty(file("/etc/pki/tls/certs/admin_${service}.pem",'/dev/null')) {
file { "/usr/local/share/ca-certificates/${service}_admin_haproxy.crt":
source => "/etc/pki/tls/certs/admin_${service}.pem",
}
}
}
if !empty($ssl_hash and $trove_enabled) {
$custome_services = [ 'trove' ]
file_link { $custome_services: }
} elsif !empty($custome_services and $trove_enabled) {
case $::osfamily {
'RedHat': {
file { '/etc/pki/ca-trust/source/anchors/public_haproxy.pem':
source => '/etc/pki/tls/certs/public_haproxy.pem',
}
}
'Debian': {
file { '/usr/local/share/ca-certificates/public_haproxy.crt':
source => '/etc/pki/tls/certs/public_haproxy.pem',
}
}
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}
}
}
case $::osfamily {
'RedHat': {
exec { 'enable_trust':
command => 'update-ca-trust force-enable',
refreshonly => true,
notify => Exec['add_trust']
}
File <||> ~> Exec['enable_trust']
}
'Debian': {
File <||> ~> Exec['add_trust']
}
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}
}
exec { 'add_trust':
command => 'update-ca-certificates',
refreshonly => true,
}
}

View File

@ -1,126 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::ssl_dns_setup
class dbaas_trove::ssl_dns_setup {
notice('MODULAR: dbaas_trove/ssl_dns_setup.pp')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
$public_ssl_hash = hiera_hash('public_ssl')
$ssl_hash = hiera_hash('use_ssl', {})
$public_vip = hiera('public_vip')
$management_vip = hiera('management_vip')
$openstack_service_endpoints = hiera_hash('openstack_service_endpoints', {})
$custom_services = [ 'trove']
define hosts (
$ssl_hash,
){
$service = $name
$public_vip = hiera('public_vip')
$management_vip = hiera('management_vip')
$public_hostname = try_get_value($ssl_hash, "${service}_public_hostname", '')
$internal_hostname = try_get_value($ssl_hash, "${service}_internal_hostname", '')
$admin_hostname = try_get_value($ssl_hash, "${service}_admin_hostname", $internal_hostname)
$service_public_ip = try_get_value($ssl_hash, "${service}_public_ip", '')
if !empty($service_public_ip) {
$public_ip = $service_public_ip
} else {
$public_ip = $public_vip
}
$service_internal_ip = try_get_value($ssl_hash, "${service}_internal_ip", '')
if !empty($service_internal_ip) {
$internal_ip = $service_internal_ip
} else {
$internal_ip = $management_vip
}
$service_admin_ip = try_get_value($ssl_hash, "${service}_admin_ip", '')
if !empty($service_admin_ip) {
$admin_ip = $service_admin_ip
} else {
$admin_ip = $management_vip
}
# We always need to set public hostname resolution
if !empty($public_hostname) and !defined(Host[$public_hostname]) {
host { $public_hostname:
name => $public_hostname,
ensure => present,
ip => $public_ip,
}
}
if ($public_hostname == $internal_hostname) and ($public_hostname == $admin_hostname) {
notify{"All ${service} hostnames is equal, just public one inserted to DNS":}
}
elsif $public_hostanme == $internal_hostname {
if !empty($admin_hostname) and !defined(Host[$admin_hostname]) {
host { $admin_hostname:
name => $admin_hostname,
ensure => present,
ip => $admin_ip,
}
}
}
elsif ($public_hostname == $admin_hostname) or ($internal_hostname == $admin_hostname) {
if !empty($internal_hostname) and !defined(Host[$internal_hostname]) {
host { $internal_hostname:
name => $internal_hostname,
ensure => present,
ip => $internal_ip,
}
}
}
else {
if !empty($admin_hostname) and !defined(Host[$admin_hostname]) {
host { $admin_hostname:
name => $admin_hostname,
ensure => present,
ip => $admin_ip,
}
}
if !empty($internal_hostname) and !defined(Host[$internal_hostname]) {
host { $internal_hostname:
name => $internal_hostname,
ensure => present,
ip => $internal_ip,
}
}
}
}
if($trove_enabled) {
if !empty($ssl_hash) {
hosts { $custom_services:
ssl_hash => $ssl_hash,
}
} elsif !empty($public_ssl_hash) {
host { $public_ssl_hash['hostname']:
ensure => present,
ip => $public_vip,
}
}
}
}

View File

@ -1,98 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::ssl_keys_saving
class dbaas_trove::ssl_keys_saving {
notice('MODULAR: dbaas_trove/ssl_keys_saving.pp')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
$public_ssl_hash = hiera_hash('public_ssl')
$ssl_hash = hiera_hash('use_ssl', {})
$pub_certificate_content = try_get_value($public_ssl_hash, 'cert_data/content', '')
$base_path = '/etc/pki/tls/certs'
$pki_path = [ '/etc/pki', '/etc/pki/tls' ]
$astute_base_path = '/var/lib/astute/haproxy'
File {
owner => 'root',
group => 'root',
mode => '0644',
}
file { [ $pki_path, $base_path, $astute_base_path ]:
ensure => directory,
}
#TODO(sbog): convert it to '.each' syntax when moving to Puppet 4
#TODO(anoskov): move it outside class 'osnailyfacter::ssl::ssl_keys_saving'
define cert_file (
$ssl_hash,
$base_path,
$astute_base_path,
){
$service = $name
$public_service = try_get_value($ssl_hash, "${service}_public", false)
$public_usercert = try_get_value($ssl_hash, "${service}_public_usercert", false)
$public_certdata = try_get_value($ssl_hash, "${service}_public_certdata/content", '')
$internal_service = try_get_value($ssl_hash, "${service}_internal", false)
$internal_usercert = try_get_value($ssl_hash, "${service}_internal_usercert", false)
$internal_certdata = try_get_value($ssl_hash, "${service}_internal_certdata/content", '')
$admin_service = try_get_value($ssl_hash, "${service}_admin", false)
$admin_usercert = try_get_value($ssl_hash, "${service}_admin_usercert", false)
$admin_certdata = try_get_value($ssl_hash, "${service}_admin_certdata/content", '')
if $ssl_hash["${service}"] {
if $public_service and $public_usercert and !empty($public_certdata) {
file { ["${base_path}/public_${service}.pem", "${astute_base_path}/public_${service}.pem"]:
ensure => present,
content => $public_certdata,
}
}
if $internal_service and $internal_usercert and !empty($internal_certdata) {
file { ["${base_path}/internal_${service}.pem", "${astute_base_path}/internal_${service}.pem"]:
ensure => present,
content => $internal_certdata,
}
}
if $admin_service and $admin_usercert and !empty($admin_certdata) {
file { ["${base_path}/admin_${service}.pem", "${astute_base_path}/admin_${service}.pem"]:
ensure => present,
content => $admin_certdata,
}
}
}
}
if !empty($ssl_hash and $trove_enabled) {
$custom_services = [ 'trove']
cert_file { $custom_services:
ssl_hash => $ssl_hash,
base_path => $base_path,
astute_base_path => $astute_base_path,
}
} elsif !empty($public_ssl_hash and $trove_enabled) {
file { ["${base_path}/public_haproxy.pem", "${astute_base_path}/public_haproxy.pem"]:
ensure => present,
content => $pub_certificate_content,
}
}
}

View File

@ -1,177 +0,0 @@
#
# Copyright (C) 2016 AT&T Services, Inc.
#
# 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.
#
# dbaas_trove::trove
class dbaas_trove::trove {
notice('MODULAR: dbaas_trove/trove')
$trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
$trove_enabled = pick($trove['metadata']['enabled'], false)
prepare_network_config(hiera('network_scheme', {}))
if ($trove_enabled) {
$nova_hash = hiera_hash('nova', {})
$neutron_config = hiera_hash('neutron_config', {})
$public_vip = hiera('public_vip')
$database_vip = hiera('database_vip')
$management_vip = hiera('management_vip')
$region = hiera('region', 'RegionOne')
$service_endpoint = hiera('service_endpoint')
$debug = hiera('debug', false)
$verbose = hiera('verbose', true)
$use_syslog = hiera('use_syslog', true)
$use_stderr = hiera('use_stderr', false)
$trove_amqp_port = hiera('amqp_port')
$trove_amqp_hosts = hiera('trove_amqp_hosts')
$public_ssl_hash = hiera_hash('public_ssl', {})
$ssl_hash = hiera_hash('use_ssl', {})
$external_dns = hiera_hash('external_dns', {})
$external_lb = hiera('external_lb', false)
$api_bind_port = hiera('trove_api_port')
$internal_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')
$internal_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [hiera('keystone_endpoint', ''), $service_endpoint, $management_vip])
$auth_url = "${internal_auth_protocol}://${internal_auth_address}:5000/v2.0/"
$admin_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
$admin_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [hiera('keystone_endpoint', ''), $service_endpoint, $management_vip])
$identity_uri = "${admin_auth_protocol}://${admin_auth_address}:35357/"
$neutron_protocol = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http')
$neutron_address = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', [$service_endpoint, $management_vip])
$neutron_url = "${neutron_protocol}://${neutron_address}:9696/"
$cinder_protocol = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'protocol', 'http')
$cinder_address = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'hostname', [$service_endpoint, $management_vip])
$cinder_url = "${cinder_protocol}://${cinder_address}:8776/v1"
$swift_protocol = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'protocol', 'http')
$swift_address = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'hostname', [$service_endpoint, $management_vip])
$swift_url = "${swift_protocol}://${swift_address}:8080/v1/AUTH_"
$nova_protocol = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'protocol', 'http')
$nova_address = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'hostname', [$service_endpoint, $management_vip])
$nova_url = "${nova_protocol}://${nova_address}:8774/v2"
$trove_public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'usage', false)
$trove_public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'protocol', 'http')
$trove_public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'hostname', [$public_vip])
$api_bind_host = get_network_role_property('trove/api', 'ipaddr')
$tenant = pick($trove['tenant'], 'services')
$db_user = pick($trove['db_user'], 'trove')
$db_name = pick($trove['db_name'], 'trove')
$db_password = $trove['db_password']
$read_timeout = '60'
$sql_connection = "mysql://${db_user}:${db_password}@${database_vip}/${db_name}?read_timeout=${read_timeout}"
$sql_idle_timeout = pick($idle_timeout, '3600')
$rabbit_password = $trove['rabbit_password']
$rabbit_userid = $trove['rabbit_user']
$rabbit_use_ssl = pick($trove['metadata']['rabbit_use_ssl'], true)
$amqp_durable_queues = pick($trove['amqp_durable_queues'], true)
$rabbit_ha_queues = pick($trove['rabbit_ha_queues'], true)
$public_rabbit_hosts = "$public_vip:$trove_amqp_port"
if($trove_public_ssl and $rabbit_use_ssl) {
$guest_rabbit_use_ssl = true
} else {
$guest_rabbit_use_ssl = false
}
$nova_proxy_admin_pass = $nova_hash['user_password']
$nova_proxy_admin_user = $nova_hash['auth_name']
$nova_proxy_admin_tenant_name = pick($nova_hash['tenant_name'], 'services')
class { '::trove::client': }
class { '::trove':
database_connection => $sql_connection,
database_idle_timeout => $sql_idle_timeout,
rabbit_hosts => $trove_amqp_hosts,
rabbit_password => $trove['rabbit_password'],
rabbit_userid => $trove['rabbit_user'],
rabbit_ha_queues => $rabbit_ha_queues,
amqp_durable_queues => $amqp_durable_queues,
os_region_name => $region,
nova_compute_url => $nova_url,
cinder_url => $cinder_url,
swift_url => $swift_url,
neutron_url => $neutron_url,
nova_proxy_admin_pass => $nova_hash['user_password'],
nova_proxy_admin_user => $nova_hash['auth_name'],
nova_proxy_admin_tenant_name => pick($nova_hash['tenant_name'], 'services'),
}
class { '::trove::api':
debug => $debug,
verbose => $verbose,
bind_host => $api_bind_host,
auth_url => $auth_url,
auth_host => $service_endpoint,
keystone_password => $trove['auth_password'],
keystone_user => $trove['auth_name'],
}
class { '::trove::conductor':
debug => $debug,
verbose => $verbose,
auth_url => $auth_url,
}
class { '::trove::taskmanager':
debug => $debug,
verbose => $verbose,
auth_url => $auth_url,
use_guestagent_template => false,
}
class { '::trove::guestagent':
enabled => false,
manage_service => true,
debug => $debug,
verbose => $verbose,
rabbit_hosts => $public_rabbit_hosts,
rabbit_host => $public_vip,
rabbit_port => $trove_amqp_port,
rabbit_use_ssl => $guest_rabbit_use_ssl,
auth_url => false,
swift_url => false,
}
class { '::trove::quota': }
class { '::trove::config':
trove_config => {
'DEFAULT/taskmanager_manager' => { value => 'trove.taskmanager.manager.Manager' },
'DEFAULT/update_status_on_fail' => { value => 'True' },
'DEFAULT/guest_config' => { value => '/etc/trove/trove-guestagent.conf' },
'DEFAULT/injected_config_location' => { value => '/etc/trove' },
'DEFAULT/guest_info' => { value => '/etc/guest_info' },
'DEFAULT/volume_time_out' => { value => '240' },
'DEFAULT/agent_call_high_timeout' => { value => '240' },
'DEFAULT/agent_call_low_timeout' => { value => '20' },
},
trove_guestagent_config => {
'mysql/replication_strategy' => { value => 'MysqlGTIDReplication' },
'mysql/replication_namespace' => { value => 'trove.guestagent.strategies.replication.mysql_gtid' },
},
}
}
}

View File

@ -1,9 +0,0 @@
include ::dbaas_trove::db
# mysql::config
class mysql::config {}
include ::mysql::config
# mysql::server
class mysql::server {}
include ::mysql::server

View File

@ -1 +0,0 @@
include ::dbaas_trove::firewall

View File

@ -1 +0,0 @@
include ::dbaas_trove::hiera_override

View File

@ -1 +0,0 @@
include ::dbaas_trove::keystone

View File

@ -1 +0,0 @@
include ::dbaas_trove::openstack_haproxy_trove

View File

@ -1 +0,0 @@
include ::dbaas_trove::ssl_add_trust_chain

View File

@ -1 +0,0 @@
include ::dbaas_trove::ssl_dns_setup

View File

@ -1 +0,0 @@
include ::dbaas_trove::ssl_keys_saving

View File

@ -1 +0,0 @@
include ::dbaas_trove::trove

View File

@ -1,11 +0,0 @@
pkg/
Gemfile.lock
vendor/
spec/fixtures/
.vagrant/
.bundle/
coverage/
.idea/
*.swp
*.iml
openstack/

View File

@ -1,4 +0,0 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/puppet-trove.git

View File

@ -1,68 +0,0 @@
##2016-05-20 - 7.1.0
###Summary
This is a feature and bugfix release in the Liberty series.
####Features
- Support of PyMySQL driver for MySQL backend
####Bugfixes
- Remove nova_* options from trove-guestagent.conf.erb
- Use swift_url variable in the template instead of the hardcoded url
####Maintenance
- Add deprecation warning for Qpid rpc driver
##2015-11-25 - 7.0.0
###Summary
This is a backwards-compatible major release for OpenStack Liberty.
####Features
- add tag to package and service resources
- add trove::config class
- reflect provider change in puppet-openstacklib
- introduce trove::quota class
- introduce use_guestagent_template option
- make taskmanager_queue option configurable
- add api ratelimit options
- add region and resource url related options
- add default_neutron_networks in trove::taskmanager
- complete qpid support
- keystone/auth: make service description configurable
####Bugfixes
- fix rabbit_userid parameter
- fix default value of guestagent_config_file option
####Maintenance
- initial msync run for all Puppet OpenStack modules
- try to use zuul-cloner to prepare fixtures
- remove class_parameter_defaults puppet-lint check
- acceptance: use common bits from puppet-openstack-integration
- acceptance: enable debug & verbosity for OpenStack logs
- fix rspec 3.x syntax
##2015-10-10 - 6.1.0
###Summary
This is a feature and bugfix release in the Kilo series.
####Features
- Introduce trove:config to manage custom options
####Maintenance
- acceptance: checkout stable/kilo puppet modules
####Bugfixes
- Fix catalog compilation when not configuring endpoint
##2015-07-08 - 6.0.0
###Summary
- Initial release of the puppet-trove module

View File

@ -1,22 +0,0 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :test, :system_tests do
gem 'puppet-openstack_spec_helper',
:git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper',
:branch => 'stable/liberty',
:require => false
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

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,184 +0,0 @@
puppet-trove
=============
7.1.0 - 2015.2 - Liberty
#### Table of Contents
1. [Overview - What is the trove module?](#overview)
2. [Module Description - What does the module do?](#module-description)
3. [Setup - The basics of getting started with trove](#setup)
4. [Implementation - An under-the-hood peek at what the module is doing](#implementation)
5. [Limitations - OS compatibility, etc.](#limitations)
6. [Development - Guide for contributing to the module](#development)
7. [Contributors - Those with commits](#contributors)
Overview
--------
The trove module is a part of [OpenStack](https://github.com/openstack), an effort by the Openstack infrastructure team to provide continuous integration testing and code review for Openstack and Openstack community projects as part of the core software. The module itself is used to flexibly configure and manage the database service for Openstack.
Module Description
------------------
Setup
-----
**What the trove module affects:**
* trove, the database service for Openstack.
Implementation
--------------
### trove
trove is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers.
### Types
#### trove_config
The `trove_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove.conf` file.
```puppet
trove_config { 'DEFAULT/verbose' :
value => true,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
##### name
Section/setting name to manage from `trove.conf`
##### value
The value of the setting to be defined.
##### secret
Whether to hide the value from Puppet logs. Defaults to `false`.
##### ensure_absent_val
If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
#### trove_conductor_config
The `trove_conductor_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-conductor.conf` file.
```puppet
trove_conductor_config { 'DEFAULT/verbose' :
value => true,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
##### name
Section/setting name to manage from `trove.conf`
##### value
The value of the setting to be defined.
##### secret
Whether to hide the value from Puppet logs. Defaults to `false`.
##### ensure_absent_val
If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
#### trove_guestagent_config
The `trove_guestagent_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-guestagent.conf` file.
```puppet
trove_guestagent_config { 'DEFAULT/verbose' :
value => true,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
##### name
Section/setting name to manage from `trove.conf`
##### value
The value of the setting to be defined.
##### secret
Whether to hide the value from Puppet logs. Defaults to `false`.
##### ensure_absent_val
If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
#### trove_taskmanager_config
The `trove_taskmanager_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-taskmanager.conf` file.
```puppet
trove_taskmanager_config { 'DEFAULT/verbose' :
value => true,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
##### name
Section/setting name to manage from `trove.conf`
##### value
The value of the setting to be defined.
##### secret
Whether to hide the value from Puppet logs. Defaults to `false`.
##### ensure_absent_val
If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
Limitations
-----------
Security
--------
For security reasons, a separate in-cloud RabbitMQ cluster should be set up for Trove to use. The reason for this is that the guest agent needs to communicate with RabbitMQ, so it is not advisable to give instances access to the same RabbitMQ server that the core OpenStack services are using for communication.
Please note that puppet-trove cannot check if this rule is being followed, so it is the deployer's responsibility to do it.
Beaker-Rspec
------------
This module has beaker-rspec tests
To run:
``shell
bundle install
bundle exec rspec spec/acceptance
``
Development
-----------
Developer documentation for the entire puppet-openstack project.
* https://wiki.openstack.org/wiki/Puppet-openstack#Developer_documentation
Contributors
------------
* https://github.com/enovance/puppet-trove/graphs/contributors

View File

@ -1,85 +0,0 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'json'
modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1]
PuppetSyntax.exclude_paths ||= []
PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
PuppetSyntax.exclude_paths << "pkg/**/*"
PuppetSyntax.exclude_paths << "vendor/**/*"
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
config.fail_on_warnings = true
config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"]
end
desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
Rake::Task[:spec_prep].clear
desc 'Create the fixtures directory'
task :spec_prep do
# Allow to test the module with custom dependencies
# like you could do with .fixtures file
if ENV['PUPPETFILE']
puppetfile = ENV['PUPPETFILE']
if ENV['GEM_HOME']
gem_home = ENV['GEM_HOME']
gem_bin_dir = "#{gem_home}" + '/bin/'
else
gem_bin_dir = ''
end
r10k = ['env']
r10k += ["PUPPETFILE=#{puppetfile}"]
r10k += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
r10k += ["#{gem_bin_dir}r10k"]
r10k += ['puppetfile', 'install', '-v']
sh(*r10k)
else
# otherwise, use official OpenStack Puppetfile
zuul_ref = ENV['ZUUL_REF']
zuul_branch = ENV['ZUUL_BRANCH']
zuul_url = ENV['ZUUL_URL']
repo = 'openstack/puppet-openstack-integration'
rm_rf(repo)
if File.exists?('/usr/zuul-env/bin/zuul-cloner')
zuul_clone_cmd = ['/usr/zuul-env/bin/zuul-cloner']
zuul_clone_cmd += ['--cache-dir', '/opt/git']
zuul_clone_cmd += ['--zuul-ref', "#{zuul_ref}"]
zuul_clone_cmd += ['--zuul-branch', "#{zuul_branch}"]
zuul_clone_cmd += ['--zuul-url', "#{zuul_url}"]
zuul_clone_cmd += ['https://git.openstack.org', "#{repo}"]
sh(*zuul_clone_cmd)
else
sh("git clone https://git.openstack.org/#{repo} -b stable/liberty #{repo}")
end
script = ['env']
script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
script += ["ZUUL_REF=#{zuul_ref}"]
script += ["ZUUL_BRANCH=#{zuul_branch}"]
script += ["ZUUL_URL=#{zuul_url}"]
script += ['bash', "#{repo}/install_modules_unit.sh"]
sh(*script)
end
rm_rf("spec/fixtures/modules/#{modname}")
ln_s(Dir.pwd, "spec/fixtures/modules/#{modname}")
mkdir_p('spec/fixtures/manifests')
touch('spec/fixtures/manifests/site.pp')
end
Rake::Task[:spec_clean].clear
desc 'Clean up the fixtures directory'
task :spec_clean do
rm_rf('spec/fixtures/modules')
rm_rf('openstack')
if File.zero?('spec/fixtures/manifests/site.pp')
rm_f('spec/fixtures/manifests/site.pp')
end
end

View File

@ -1,38 +0,0 @@
# This is an example of site.pp to deploy Trove
class { '::trove::client': }
class { '::trove::keystone::auth':
admin_address => '10.0.0.1',
internal_address => '10.0.0.1',
public_address => '10.0.0.1',
password => 'verysecrete',
region => 'OpenStack'
}
class { '::trove::db::mysql':
password => 'dbpass',
host => '10.0.0.1',
allowed_hosts => '10.0.0.1'
}
class { '::trove':
database_connection => 'mysql://trove:secrete@10.0.0.1/trove?charset=utf8',
rabbit_hosts => '10.0.0.1',
rabbit_password => 'secrete',
nova_proxy_admin_pass => 'novapass',
}
class { '::trove::api':
bind_host => '10.0.0.1',
auth_url => 'https://identity.openstack.org:5000/v2.0',
keystone_password => 'verysecrete'
}
class { '::trove::conductor':
auth_url => 'https://identity.openstack.org:5000/v2.0'
}
class { '::trove::taskmanager':
auth_url => 'https://identity.openstack.org:5000/v2.0'
}

View File

@ -1,113 +0,0 @@
require 'json'
require 'puppet/util/inifile'
class Puppet::Provider::Trove < Puppet::Provider
def self.conf_filename
'/etc/trove/trove.conf'
end
def self.withenv(hash, &block)
saved = ENV.to_hash
hash.each do |name, val|
ENV[name.to_s] = val
end
yield
ensure
ENV.clear
saved.each do |name, val|
ENV[name] = val
end
end
def self.trove_credentials
@trove_credentials ||= get_trove_credentials
end
def self.get_trove_credentials
auth_keys = ['auth_host', 'auth_port', 'auth_protocol',
'admin_tenant_name', 'admin_user', 'admin_password']
conf = trove_conf
if conf and conf['keystone_authtoken'] and
auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?}
return Hash[ auth_keys.map \
{ |k| [k, conf['keystone_authtoken'][k].strip] } ]
else
raise(Puppet::Error, "File: #{conf_filename} does not contain all \
required sections. Trove types will not work if trove is not \
correctly configured.")
end
end
def trove_credentials
self.class.trove_credentials
end
def self.auth_endpoint
@auth_endpoint ||= get_auth_endpoint
end
def self.get_auth_endpoint
q = trove_credentials
"#{q['auth_protocol']}://#{q['auth_host']}:#{q['auth_port']}/v2.0/"
end
def self.trove_conf
return @trove_conf if @trove_conf
@trove_conf = Puppet::Util::IniConfig::File.new
@trove_conf.read(conf_filename)
@trove_conf
end
def self.auth_trove(*args)
q = trove_credentials
authenv = {
:OS_AUTH_URL => self.auth_endpoint,
:OS_USERNAME => q['admin_user'],
:OS_TENANT_NAME => q['admin_tenant_name'],
:OS_PASSWORD => q['admin_password']
}
begin
withenv authenv do
trove(args)
end
rescue Exception => e
if (e.message =~ /\[Errno 111\] Connection refused/) or
(e.message =~ /\(HTTP 400\)/)
sleep 10
withenv authenv do
trove(args)
end
else
raise(e)
end
end
end
def auth_trove(*args)
self.class.auth_trove(args)
end
def trove_manage(*args)
cmd = args.join(" ")
output = `#{cmd}`
$?.exitstatus
end
def self.reset
@trove_conf = nil
@trove_credentials = nil
end
def self.list_trove_resources(type, *args)
json = auth_trove("--json", "#{type}-list", *args)
return JSON.parse(json)
end
def self.get_trove_resource_attrs(type, id)
json = auth_trove("--json", "#{type}-show", id)
return JSON.parse(json)
end
end

View File

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

View File

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

View File

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

View File

@ -1,52 +0,0 @@
require File.join(File.dirname(__FILE__), "..","..","..",
"puppet/provider/trove")
Puppet::Type.type(:trove_datastore).provide(
:trove,
:parent => Puppet::Provider::Trove
) do
desc <<-EOT
Trove provider to manage datastore type.
EOT
commands :trove => "trove"
mk_resource_methods
def self.instances
list_trove_resources("datastore").collect do |attrs|
new(
:ensure => :present,
:name => attrs["name"],
:id => attrs["id"]
)
end
end
def self.prefetch(resources)
instances_ = instances
resources.keys.each do |name|
if provider = instances_.find{ |instance| instance.name == name }
resources[name].provider = provider
end
end
end
def exists?
@property_hash[:ensure] == :present
end
def create
if trove_manage(['trove-manage', 'datastore_update',
"#{@resource[:name]}", "''"]) != 0
fail("Failed to create datastore #{@resource[:name]}")
end
if trove_manage(['trove-manage', 'datastore_update',
"#{@resource[:name]}", "#{@resource[:version]}"]) != 0
fail("Failed to set version for datastore #{@resource[:name]}")
end
end
end

View File

@ -1,60 +0,0 @@
require File.join(File.dirname(__FILE__), "..","..","..",
"puppet/provider/trove")
Puppet::Type.type(:trove_datastore_version).provide(
:trove,
:parent => Puppet::Provider::Trove
) do
desc <<-EOT
Trove provider to manage datastore version type.
EOT
commands :trove => "trove"
mk_resource_methods
def self.prefetch(resource)
@datastore_version_hash = nil
end
def self.datastore_version_hash(datastore)
@datastore_version_hash ||= build_datastore_version_hash(datastore)
end
def datastore_version_hash(datastore)
self.class.datastore_version_hash(datastore)
end
def self.instances
[]
end
def exists?
datastore_version_hash(resource[:datastore])[resource[:name]]
end
def create
cmd = ['trove-manage', 'datastore_version_update',
"#{@resource[:datastore]}", "#{@resource[:name]}",
"#{@resource[:manager]}", "#{@resource[:image_id]}",
"#{@resource[:packages]}", "#{@resource[:active]}"]
if trove_manage(cmd) != 0
fail("Failed to create datastore version #{@resource[:name]}")
end
end
def destroy
fail("Datastore version cannot be removed")
end
private
def self.build_datastore_version_hash(datastore)
dvs = {}
list_trove_resources("datastore-version", datastore).collect do |attrs|
dvs[attrs["name"]] = attrs
end
dvs
end
end

View File

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

View File

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

View File

@ -1,51 +0,0 @@
Puppet::Type.newtype(:trove_api_paste_ini) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/trove/api-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
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(:package) do
'trove-api'
end
end

View File

@ -1,52 +0,0 @@
Puppet::Type.newtype(:trove_conductor_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/trove/trove-conductor.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(:package) do
'trove-conductor'
end
end

View File

@ -1,52 +0,0 @@
Puppet::Type.newtype(:trove_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/trove/trove.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(:package) do
'trove-api'
end
end

View File

@ -1,26 +0,0 @@
Puppet::Type.newtype(:trove_datastore) do
@doc = "Manage creation of Trove datastores"
ensurable
newparam(:name, :namevar => true) do
desc "Datastore version name)"
newvalues(/^.*$/)
end
newparam(:version) do
desc "Datastore version name"
end
newproperty(:id) do
validate do |v|
raise(Puppet::Error, 'This is a read only property')
end
end
validate do
raise(Puppet::Error, 'Version must be set') unless self[:version]
end
end

View File

@ -1,38 +0,0 @@
Puppet::Type.newtype(:trove_datastore_version) do
@doc = "Manage creation of Trove datastore versions"
ensurable
newparam(:name, :namevar => true) do
desc "Datastore version"
end
newparam(:datastore) do
desc "Datastore name)"
end
newparam(:manager) do
desc "Manager name"
end
newparam(:image_id) do
desc "Glance image id"
end
newparam(:packages) do
desc "Packages to install"
end
newparam(:active) do
desc "State"
end
validate do
raise(Puppet::Error, 'Datastore must be set') unless self[:datastore]
raise(Puppet::Error, 'Manager must be set') unless self[:manager]
raise(Puppet::Error, 'Image must be set') unless self[:image_id]
raise(Puppet::Error, 'Packages must be set') unless self[:packages]
raise(Puppet::Error, 'State must be set') unless self[:active]
end
end

View File

@ -1,52 +0,0 @@
Puppet::Type.newtype(:trove_guestagent_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/trove/trove-guestagent.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(:package) do
'trove-guestagent'
end
end

View File

@ -1,49 +0,0 @@
Puppet::Type.newtype(:trove_taskmanager_config) do
ensurable
newparam(:name, :namevar => true) do
desc 'Section/setting name to manage from /etc/trove/trove-taskmanager.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
end

View File

@ -1,410 +0,0 @@
#
# Copyright (C) 2014 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.
#
# == Class trove::api
#
# Configure API service in trove
#
# == Parameters
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*ensure_package*]
# (optional) Whether the trove api package will be installed
# Defaults to 'present'
#
# [*keystone_password*]
# (required) Password used to authentication.
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Default: false
#
# [*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: 8779
#
# [*backlog*]
# (optional) Backlog requests when creating socket
# Default: 4096
#
# [*workers*]
# (optional) Number of trove API worker processes to start
# Default: $::processorcount
#
# [*log_file*]
# (optional) The path of file used for logging
# If set to boolean false, it will not log to any file.
# Default: /var/log/trove/trove-api.log
#
# [*log_dir*]
# (optional) directory to which trove logs are sent.
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*auth_host*]
# (optional) Host running auth service.
# Defaults to '127.0.0.1'.
#
# [*auth_url*]
# (optional) Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [*auth_port*]
# (optional) Port to use for auth service on auth_host.
# Defaults to '35357'.
#
# [*auth_protocol*]
# (optional) Protocol to use for auth.
# Defaults to 'http'.
#
# [*keystone_tenant*]
# (optional) Tenant to authenticate to.
# Defaults to services.
#
# [*keystone_user*]
# (optional) User to authenticate as with keystone.
# Defaults to 'trove'.
#
# [*enabled*]
# (optional) Whether to enable services.
# Defaults to true.
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the api config.
# Defaults to false.
#
# [*cert_file*]
# (optinal) Certificate file to use when starting API server securely
# Defaults to false, not set
#
# [*key_file*]
# (optional) Private key file to use when starting API server securely
# Defaults to false, not set
#
# [*ca_file*]
# (optional) CA certificate file to use to verify connecting clients
# Defaults to false, not set
#
# [*http_get_rate*]
# (optional) Default rate limit of GET request.
# Defaults to 200.
#
# [*http_post_rate*]
# (optional) Default rate limit of POST request.
# Defaults to 200.
#
# [*http_put_rate*]
# (optional) Default rate limit of PUT request.
# Defaults to 200.
#
# [*http_delete_rate*]
# (optional) Default rate limit of DELETE request.
# Defaults to 200.
#
# [*http_mgmt_post_rate*]
# (optional) Default rate limit of mgmt post request.
# Defaults to 200.
#
class trove::api(
$keystone_password,
$verbose = false,
$debug = false,
$bind_host = '0.0.0.0',
$bind_port = '8779',
$backlog = '4096',
$workers = $::processorcount,
$log_file = '/var/log/trove/trove-api.log',
$log_dir = '/var/log/trove',
$auth_host = '127.0.0.1',
$auth_url = false,
$auth_port = '35357',
$auth_protocol = 'http',
$keystone_tenant = 'services',
$keystone_user = 'trove',
$enabled = true,
$use_syslog = false,
$log_facility = 'LOG_USER',
$purge_config = false,
$cert_file = false,
$key_file = false,
$ca_file = false,
$http_get_rate = 200,
$http_post_rate = 200,
$http_put_rate = 200,
$http_delete_rate = 200,
$http_mgmt_post_rate = 200,
$manage_service = true,
$ensure_package = 'present',
) inherits trove {
require ::keystone::python
include ::trove::db
include ::trove::params
Trove_config<||> ~> Exec['post-trove_config']
Trove_config<||> ~> Service['trove-api']
Trove_api_paste_ini<||> ~> Service['trove-api']
# basic service config
trove_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/bind_host': value => $bind_host;
'DEFAULT/bind_port': value => $bind_port;
'DEFAULT/backlog': value => $backlog;
'DEFAULT/trove_api_workers': value => $workers;
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/control_exchange': value => $::trove::control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
}
if $auth_url {
trove_config { 'DEFAULT/trove_auth_url': value => $auth_url; }
} else {
trove_config { 'DEFAULT/trove_auth_url': value => "${auth_protocol}://${auth_host}:5000/v2.0"; }
}
# auth config
trove_config {
'keystone_authtoken/auth_host': value => $auth_host;
'keystone_authtoken/auth_port': value => $auth_port;
'keystone_authtoken/auth_protocol': value => $auth_protocol;
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
'keystone_authtoken/admin_user': value => $keystone_user;
'keystone_authtoken/admin_password': value => $keystone_password, secret => true;
}
# SSL Options
if $cert_file {
trove_config {
'DEFAULT/cert_file' : value => $cert_file;
}
} else {
trove_config {
'DEFAULT/cert_file': ensure => absent;
}
}
if $key_file {
trove_config {
'DEFAULT/key_file' : value => $key_file;
}
} else {
trove_config {
'DEFAULT/key_file': ensure => absent;
}
}
if $ca_file {
trove_config {
'DEFAULT/ca_file' : value => $ca_file;
}
} else {
trove_config {
'DEFAULT/ca_file': ensure => absent;
}
}
# Logging
if $log_file {
trove_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_config {
'DEFAULT/use_syslog': value => false;
}
}
# rate limits
trove_config {
'DEFAULT/http_get_rate': value => $http_get_rate;
'DEFAULT/http_post_rate': value => $http_post_rate;
'DEFAULT/http_put_rate': value => $http_put_rate;
'DEFAULT/http_delete_rate': value => $http_delete_rate;
'DEFAULT/http_mgmt_post_rate': value => $http_mgmt_post_rate;
}
resources { 'trove_config':
purge => $purge_config,
}
# region name
if $::trove::os_region_name {
trove_config { 'DEFAULT/os_region_name': value => $::trove::os_region_name }
}
else {
trove_config {'DEFAULT/os_region_name': ensure => absent }
}
# services type
trove_config {
'DEFAULT/nova_compute_service_type': value => $::trove::nova_compute_service_type;
'DEFAULT/cinder_service_type': value => $::trove::cinder_service_type;
'DEFAULT/neutron_service_type': value => $::trove::neutron_service_type;
'DEFAULT/swift_service_type': value => $::trove::swift_service_type;
'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
if $::trove::rabbit_hosts {
trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => $::trove::rabbit_hosts }
} else {
trove_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host }
trove_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port }
trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" }
}
if $::trove::rabbit_ha_queues == undef {
if size($::trove::rabbit_hosts) > 1 {
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
# TODO(shaikapsar): remove this line once bug/1486319 merged to stable/liberty.
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
}
} else {
trove_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
}
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
trove_config {
'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
}
if is_array($::trove::qpid_sasl_mechanisms) {
trove_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
}
}
elsif $::trove::qpid_sasl_mechanisms {
trove_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => $::trove::qpid_sasl_mechanisms;
}
}
else {
trove_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': ensure => absent;
}
}
}
trove::generic_service { 'api':
enabled => $enabled,
manage_service => $manage_service,
ensure_package => $ensure_package,
package_name => $::trove::params::api_package_name,
service_name => $::trove::params::api_service_name,
}
}

View File

@ -1,40 +0,0 @@
#
# Copyright (C) 2014 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.
# trove::client
#
# Manages the trove client package on systems
#
# === Parameters:
#
# [*package_ensure*]
# (optional) The state of the package
# Defaults to present
#
#
class trove::client (
$package_ensure = present
) {
include ::trove::params
package { 'python-troveclient':
ensure => $package_ensure,
name => $::trove::params::client_package_name,
}
}

View File

@ -1,230 +0,0 @@
# == Class: trove::conductor
#
# Manages trove conductor package and service
#
# === Parameters:
#
# [*enabled*]
# (optional) Whether to enable the trove-conductor service
# Defaults to true
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*ensure_package*]
# (optional) The state of the trove conductor package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Default: false
#
# [*log_file*]
# (optional) The path of file used for logging
# If set to boolean false, it will not log to any file.
# Default: /var/log/trove/trove-conductor.log
#
# [*log_dir*]
# (optional) directory to which trove logs are sent.
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
#
# [*auth_url*]
# (optional) Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [*conductor_manager*]
# (optional) Trove conductor manager.
# Defaults to 'trove.conductor.manager.Manager'.
#
class trove::conductor(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = false,
$debug = false,
$log_file = '/var/log/trove/trove-conductor.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$auth_url = 'http://localhost:5000/v2.0',
$conductor_manager = 'trove.conductor.manager.Manager',
) inherits trove {
include ::trove::params
Trove_conductor_config<||> ~> Exec['post-trove_config']
Trove_conductor_config<||> ~> Service['trove-conductor']
if $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
require 'mysql::bindings::python'
} elsif($::trove::database_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
} elsif($::trove::database_connection =~ /sqlite:\/\//) {
} else {
fail("Invalid db connection ${::trove::database_connection}")
}
trove_conductor_config {
'database/connection': value => $::trove::database_connection;
'database/idle_timeout': value => $::trove::database_idle_timeoutl;
}
}
# basic service config
trove_conductor_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/control_exchange': value => $::trove::control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
if $::trove::rabbit_hosts {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => ::trove::rabbit_hosts }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host }
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port }
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" }
}
if $::trove::rabbit_ha_queues == undef {
if size($::trove::rabbit_hosts) > 1 {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_conductor_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
# TODO(shaikapsar): remove this line once bug/1486319 merged to stable/liberty.
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
}
} else {
trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
}
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
trove_conductor_config {
'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
}
if is_array($::trove::qpid_sasl_mechanisms) {
trove_conductor_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
}
}
}
# Logging
if $log_file {
trove_conductor_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_conductor_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_conductor_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_conductor_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_conductor_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_conductor_config {
'DEFAULT/use_syslog': value => false;
}
}
trove::generic_service { 'conductor':
enabled => $enabled,
manage_service => $manage_service,
package_name => $::trove::params::conductor_package_name,
service_name => $::trove::params::conductor_service_name,
ensure_package => $ensure_package,
}
}

View File

@ -1,84 +0,0 @@
#
# Copyright (C) 2015 UnitedStack <devops@unitedstack.com>
#
# Author: Xingchao Yu <xingchao@unitedstack.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.
#
# == Class: trove::config
#
# This class is used to manage arbitrary trove configurations.
#
# === Parameters
#
# [*trove_config*]
# (optional) Allow configuration of arbitrary trove configurations.
# The value is an hash of trove_config resources.
# Defaults to {}
#
# [*trove_taskmanager_config*]
# (optional) Allow configuration of arbitrary trove taskmanager configurations.
# The value is an hash of trove_taskmanager_config resources.
# Defaults to {}
#
# [*trove_conductor_config*]
# (optional) Allow configuration of arbitrary trove conductor configurations.
# The value is an hash of trove_conductor_config resources.
# Defaults to {}
#
# [*trove_guestagent_config*]
# (optional) Allow configuration of arbitrary trove guestagent configurations.
# The value is an hash of trove_guestagent_config resources.
# Defaults to {}
#
# [*trove_api_paste_ini*]
# (optional) Allow configuration of arbitrary trove paste api configurations.
# The value is an hash of trove_paste_api_ini resources.
# Defaults to {}
#
# Example:
# { 'DEFAULT/foo' => { value => 'fooValue'},
# 'DEFAULT/bar' => { value => 'barValue'}
# }
#
# In yaml format, Example:
# trove_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.
#
class trove::config (
$trove_config = {},
$trove_taskmanager_config = {},
$trove_conductor_config = {},
$trove_guestagent_config = {},
$trove_api_paste_ini = {},
) {
validate_hash($trove_config)
validate_hash($trove_taskmanager_config)
validate_hash($trove_conductor_config)
validate_hash($trove_guestagent_config)
validate_hash($trove_api_paste_ini)
create_resources('trove_config', $trove_config)
create_resources('trove_taskmanager_config', $trove_taskmanager_config)
create_resources('trove_conductor_config', $trove_conductor_config)
create_resources('trove_guestagent_config', $trove_guestagent_config)
create_resources('trove_api_paste_ini', $trove_api_paste_ini)
}

View File

@ -1,103 +0,0 @@
# == Class: trove::db
#
# Configure the Trove database
#
# === Parameters
#
# [*database_connection*]
# Url used to connect to database.
# (Optional) Defaults to 'sqlite:////var/lib/trove/trove.sqlite'.
#
# [*database_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) Defaults to 3600.
#
# [*database_max_retries*]
# Maximum number of database connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to 10.
#
# [*database_retry_interval*]
# Interval between retries of opening a database connection.
# (Optional) Defaults to 10.
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 1.
#
# [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 10.
#
# [*database_max_overflow*]
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to 20.
#
class trove::db (
$database_connection = 'sqlite:////var/lib/trove/trove.sqlite',
$database_idle_timeout = 3600,
$database_min_pool_size = 1,
$database_max_pool_size = 10,
$database_max_retries = 10,
$database_retry_interval = 10,
$database_max_overflow = 20,
) {
include ::trove::params
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use trove::<myparam> if trove::db::<myparam> isn't specified.
$database_connection_real = pick($::trove::database_connection, $database_connection)
$database_idle_timeout_real = pick($::trove::database_idle_timeout, $database_idle_timeout)
$database_min_pool_size_real = pick($::trove::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::trove::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::trove::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::trove::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::trove::database_max_overflow, $database_max_overflow)
validate_re($database_connection_real,
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
if $database_connection_real {
case $database_connection_real {
/^mysql(\+pymysql)?:\/\//: {
require 'mysql::bindings'
require 'mysql::bindings::python'
if $database_connection_real =~ /^mysql\+pymysql/ {
$backend_package = $::trove::params::pymysql_package_name
} else {
$backend_package = false
}
}
/^postgresql:\/\//: {
$backend_package = false
require 'postgresql::lib::python'
}
/^sqlite:\/\//: {
$backend_package = $::trove::params::sqlite_package_name
}
default: {
fail('Unsupported backend configured')
}
}
if $backend_package and !defined(Package[$backend_package]) {
package {'trove-backend-package':
ensure => present,
name => $backend_package,
tag => 'openstack',
}
}
trove_config {
'database/connection': value => $database_connection_real, secret => true;
'database/idle_timeout': value => $database_idle_timeout_real;
'database/min_pool_size': value => $database_min_pool_size_real;
'database/max_retries': value => $database_max_retries_real;
'database/retry_interval': value => $database_retry_interval_real;
'database/max_pool_size': value => $database_max_pool_size_real;
'database/max_overflow': value => $database_max_overflow_real;
}
}
}

View File

@ -1,83 +0,0 @@
#
# Copyright (C) 2014 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.
#
# == Class: trove::db::mysql
#
# The trove::db::mysql class creates a MySQL database for trove.
# It must be used on the MySQL server
#
# === Parameters
#
# [*password*]
# (required) Password that will be used for the trove db user.
#
# [*dbname*]
# (optional) Name of trove database.
# Defaults to trove
#
# [*user*]
# (optional) Name of trove user.
# Defaults to trove
#
# [*host*]
# (optional) Host where user should be allowed all privileges for database.
# Defaults to 127.0.0.1
#
# [*allowed_hosts*]
# (optional) Hosts allowed to use the database
# Defaults to undef.
#
# [*charset*]
# (optional) Charset of trove database
# Defaults 'utf8'.
#
# [*collate*]
# (optional) Charset collate of trove database
# Defaults 'utf8_general_ci'.
#
# [*mysql_module*]
# (optional) Deprecated. Does nothing
#
class trove::db::mysql(
$password,
$dbname = 'trove',
$user = 'trove',
$host = '127.0.0.1',
$allowed_hosts = undef,
$charset = 'utf8',
$collate = 'utf8_general_ci',
$mysql_module = undef,
) {
if $mysql_module {
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
}
validate_string($password)
::openstacklib::db::mysql { 'trove':
user => $user,
password_hash => mysql_password($password),
dbname => $dbname,
host => $host,
charset => $charset,
collate => $collate,
allowed_hosts => $allowed_hosts,
}
::Openstacklib::Db::Mysql['trove'] ~> Exec<| title == 'trove-manage db_sync' |>
}

View File

@ -1,47 +0,0 @@
# == Class: trove::db::postgresql
#
# Class that configures postgresql for trove
# Requires the Puppetlabs postgresql module.
#
# === Parameters
#
# [*password*]
# (Required) Password to connect to the database.
#
# [*dbname*]
# (Optional) Name of the database.
# Defaults to 'trove'.
#
# [*user*]
# (Optional) User to connect to the database.
# Defaults to 'trove'.
#
# [*encoding*]
# (Optional) The charset to use for the database.
# Default to undef.
#
# [*privileges*]
# (Optional) Privileges given to the database user.
# Default to 'ALL'
#
class trove::db::postgresql(
$password,
$dbname = 'trove',
$user = 'trove',
$encoding = undef,
$privileges = 'ALL',
) {
Class['trove::db::postgresql'] -> Service<| title == 'trove' |>
::openstacklib::db::postgresql { 'trove':
password_hash => postgresql_password($user, $password),
dbname => $dbname,
user => $user,
encoding => $encoding,
privileges => $privileges,
}
::Openstacklib::Db::Postgresql['trove'] ~> Exec<| title == 'trove-manage db_sync' |>
}

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2014 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.
#
# Class to execute "trove-manage db_sync
#
class trove::db::sync {
exec { 'trove-manage db_sync':
path => '/usr/bin',
user => 'trove',
refreshonly => true,
subscribe => Trove_config['database/connection'],
}
}

View File

@ -1,93 +0,0 @@
#
# Copyright (C) 2014 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.
#
# == Define: trove::generic_service
#
# This defined type implements basic trove services.
# It is introduced to attempt to consolidate
# common code.
#
# It also allows users to specify ad-hoc services
# as needed
#
# This define creates a service resource with title trove-${name} and
# conditionally creates a package resource with title trove-${name}
#
# === Parameters:
#
# [*package_name*]
# (mandatory) The package name (for the generic_service)
#
# [*service_name*]
# (mandatory) The service name (for the generic_service)
#
# [*enabled*]
# (optional) Define if the service must be enabled or not
# Defaults to false.
#
# [*manage_service*]
# (optional) Manage or not the service (if a service_name is provided).
# Defaults to true.
#
# [*ensure_package*]
# (optional) Control the ensure parameter for the package ressource.
# Defaults to 'present'.
#
define trove::generic_service(
$package_name,
$service_name,
$enabled = false,
$manage_service = true,
$ensure_package = 'present'
) {
include ::trove::params
include ::trove::db::sync
$trove_title = "trove-${name}"
Exec['post-trove_config'] ~> Service<| title == $trove_title |>
Exec<| title == 'trove-manage db_sync' |> ~> Service<| title == $trove_title |>
if ($package_name) {
if !defined(Package[$package_name]) {
package { $trove_title:
ensure => $ensure_package,
name => $package_name,
notify => Service[$trove_title],
tag => ['openstack', 'trove-package'],
}
}
}
if $service_name {
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
service { $trove_title:
ensure => $service_ensure,
name => $service_name,
enable => $enabled,
hasstatus => true,
tag => 'trove-service',
}
}
}

View File

@ -1,282 +0,0 @@
# == Class: trove::guestagent
#
# Manages trove guest agent package and service
#
# === Parameters:
#
# [*enabled*]
# (optional) Whether to enable the trove guest agent service
# Defaults to true
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*ensure_package*]
# (optional) The state of the trove guest agent package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove guest agent service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove guest agent service at debug level.
# Default: false
#
# [*log_file*]
# (optional) The path of file used for logging
# If set to boolean false, it will not log to any file.
# Default: /var/log/trove/guestagent.log
#
# [*log_dir*]
# (optional) directory to which trove logs are sent.
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
#
# [*auth_url*]
# (optional) Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [*swift_url*]
# (optional) Swift URL.
# Defaults to 'http://localhost:8080/v1/AUTH_'.
#
# [*control_exchange*]
# (optional) Control exchange.
# Defaults to 'trove'.
#
# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
# [*rabbit_hosts*]
# (optional) List of clustered rabbit servers.
# Defaults to the value set in the trove class.
# The default can generally be left unless the
# guests need to talk to the rabbit cluster via
# different IPs.
#
# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
# [*rabbit_host*]
# (optional) Location of rabbitmq installation.
# Defaults to the value set in the trove class.
# The default can generally be left unless the
# guests need to talk to the rabbit cluster via
# a different IP.
#
# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
# [*rabbit_port*]
# (optional) Port for rabbitmq instance.
# Defaults to the value set in the trove class.
# The default can generally be left unless the
# guests need to talk to the rabbit cluster via
# a different port.
#
# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
# [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ
# Defaults to the value set in the trove class.
# The default can generally be left unless the
# guests need to talk to the rabbit cluster via
# a different ssl connection option.
#
class trove::guestagent(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = false,
$debug = false,
$log_file = '/var/log/trove/guestagent.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$auth_url = 'http://localhost:5000/v2.0',
$swift_url = 'http://localhost:8080/v1/AUTH_',
$control_exchange = 'trove',
# TODO(shaikapsar): remove the below 4lines once bug/1585783 merged to stable/liberty.
$rabbit_hosts = $::trove::rabbit_hosts,
$rabbit_host = $::trove::rabbit_host,
$rabbit_port = $::trove::rabbit_port,
$rabbit_use_ssl = $::trove::rabbit_use_ssl,
) inherits trove {
include ::trove::params
Trove_guestagent_config<||> ~> Exec['post-trove_config']
Trove_guestagent_config<||> ~> Service['trove-guestagent']
# basic service config
trove_guestagent_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/control_exchange': value => $control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
}
# (shaikapsar): Option to fetch auth_url and swift_url from the keystone catalog.
# auth_url
if $auth_url {
trove_guestagent_config { 'DEFAULT/trove_auth_url': value => $auth_url }
}
else {
trove_guestagent_config { 'DEFAULT/trove_auth_url': ensure => absent }
}
# swift_url
if $swift_url {
trove_guestagent_config { 'DEFAULT/swift_url': value => $swift_url }
}
else {
trove_guestagent_config { 'DEFAULT/swift_url': ensure => absent }
}
# region name
if $::trove::os_region_name {
trove_guestagent_config { 'DEFAULT/os_region_name': value => $::trove::os_region_name }
}
else {
trove_guestagent_config {'DEFAULT/os_region_name': ensure => absent }
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
# TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
if $rabbit_hosts {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => $rabbit_hosts }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
}
if $::trove::rabbit_ha_queues == undef {
# TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
if size($rabbit_hosts) > 1 {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_guestagent_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
# TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
# TODO(shaikapsar): remove the below lines once bug/1486319 merged to stable/liberty.
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
# TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
if $rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
}
} else {
trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
}
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
trove_guestagent_config {
'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
}
if is_array($::trove::qpid_sasl_mechanisms) {
trove_guestagent_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
}
}
}
# Logging
if $log_file {
trove_guestagent_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_guestagent_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_guestagent_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_guestagent_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_guestagent_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_guestagent_config {
'DEFAULT/use_syslog': value => false;
}
}
trove::generic_service { 'guestagent':
enabled => $enabled,
manage_service => $manage_service,
package_name => $::trove::params::guestagent_package_name,
service_name => $::trove::params::guestagent_service_name,
ensure_package => $ensure_package,
}
}

View File

@ -1,321 +0,0 @@
#
# Copyright (C) 2014 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.
# trove::init
#
# Trove base config
#
# == Parameters
#
# [*rabbit_host*]
# (optional) Location of rabbitmq installation.
# Note that, for security reasons, this rabbitmq host should not be the
# same that the core openstack services are using for communication. See
# http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html
# Defaults to 'localhost'
#
# [*rabbit_hosts*]
# (optional) List of clustered rabbit servers.
# Note that, for security reasons, these rabbitmq hosts should not be the
# same that the core openstack services are using for communication. See
# http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html
# Defaults to false
#
# [*rabbit_port*]
# (optional) Port for rabbitmq instance.
# Defaults to '5672'
#
# [*rabbit_password*]
# (optional) Password used to connect to rabbitmq.
# Defaults to 'guest'
#
# [*rabbit_userid*]
# (optional) User used to connect to rabbitmq.
# Defaults to 'guest'
#
# [*rabbit_virtual_host*]
# (optional) The RabbitMQ virtual host.
# Defaults to '/'
#
# [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ
# Defaults to false
#
# [*rabbit_notification_topic*]
# (optional) Notification topic.
# Defaults to false.
#
# [*kombu_ssl_ca_certs*]
# (optional) SSL certification authority file (valid only if SSL enabled).
# Defaults to undef
#
# [*kombu_ssl_certfile*]
# (optional) SSL cert file (valid only if SSL enabled).
# Defaults to undef
#
# [*kombu_ssl_keyfile*]
# (optional) SSL key file (valid only if SSL enabled).
# Defaults to undef
#
# [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions.
# Defaults to 'TLSv1'
#
# [*rabbit_ha_queues*]
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to undef
#
# [*amqp_durable_queues*]
# (optional) Define queues as "durable" to rabbitmq.
# Defaults to false
#
# [*qpid_hostname*]
# (optional) Location of qpid server
# Defaults to 'localhost'
#
# [*qpid_port*]
# (optional) Port for qpid server
# Defaults to '5672'
#
# [*qpid_username*]
# (optional) Username to use when connecting to qpid
# Defaults to 'guest'
#
# [*qpid_password*]
# (optional) Password to use when connecting to qpid
# Defaults to 'guest'
#
# [*qpid_heartbeat*]
# (optional) Seconds between connection keepalive heartbeats
# Defaults to 60
#
# [*qpid_protocol*]
# (optional) Transport to use, either 'tcp' or 'ssl''
# Defaults to 'tcp'
#
# [*qpid_sasl_mechanisms*]
# (optional) Enable one or more SASL mechanisms
# Defaults to false
#
# [*qpid_tcp_nodelay*]
# (optional) Disable Nagle algorithm
# Defaults to true
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# rabbit (for rabbitmq)
# qpid (for qpid)
# Defaults to 'rabbit'
#
# [*mysql_module*]
# (optional) Deprecated. Does nothing.
# Defaults to undef.
#
# [*database_connection*]
# (optional) Connection url to connect to trove database.
# Defaults to undef.
#
# [*database_idle_timeout*]
# (optional) Timeout before idle db connections are reaped.
# Defaults to undef.
#
# [*database_max_retries*]
# (optional) Maximum number of database connection retries during startup.
# Setting -1 implies an infinite retry count.
# Defaults to undef.
#
# [*database_retry_interval*]
# (optional) Interval between retries of opening a database connection.
# Defaults to undef.
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to: undef.
#
# [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to: undef.
#
# [*database_max_overflow*]
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to: undef.
#
# [*nova_compute_url*]
# (optional) URL without the tenant segment.
# Defaults to false.
#
# [*nova_proxy_admin_user*]
# (optional) Admin username used to connect to nova.
# Defaults to 'admin'
#
# [*nova_proxy_admin_pass*]
# (required) Admin password used to connect to nova.
#
# [*nova_proxy_admin_tenant_name*]
# (optional) Admin tenant name used to connect to nova.
# Defaults to 'admin'
#
# [*control_exchange*]
# (optional) Control exchange.
# Defaults to 'trove'.
#
# [*cinder_url*]
# (optional) URL without the tenant segment.
# Defaults to false.
#
# [*swift_url*]
# (optional) Swift URL ending in AUTH_.
# Defaults to false.
#
# [*neutron_url*]
# (optional) Cinder URL without the tenant segment.
# Defaults to false.
#
# [*os_region_name*]
# (optional) Sets the os_region_name flag. For environments with
# more than one endpoint per service. If you don't set this and
# you have multiple endpoints, you will get Ambiguous Endpoint
# exceptions in the trove API service.
# Defaults to undef.
#
# [*nova_compute_service_type*]
# (optional) Nova service type to use when searching catalog.
# Defaults to 'compute'.
#
# [*cinder_service_type*]
# (optional) Cinder service type to use when searching catalog.
# Defaults to 'volumev2'.
#
# [*swift_service_type*]
# (optional) Swift service type to use when searching catalog.
# Defaults to 'object-store'.
#
# [*heat_service_type*]
# (optional) Heat service type to use when searching catalog.
# Defaults to 'orchestration'.
#
# [*neutron_service_type*]
# (optional) Neutron service type to use when searching catalog.
# Defaults to 'network'.
#
# [*use_neutron*]
# (optional) Use Neutron
# Defaults to true
#
# [*package_ensure*]
# (optional) The state of the package.
# Defaults to 'present'
#
class trove(
$nova_proxy_admin_pass,
$rabbit_host = 'localhost',
$rabbit_hosts = undef,
$rabbit_password = 'guest',
$rabbit_port = '5672',
$rabbit_userid = 'guest',
$rabbit_virtual_host = '/',
$rabbit_use_ssl = false,
$rabbit_ha_queues = undef,
$rabbit_notification_topic = 'notifications',
$kombu_ssl_ca_certs = undef,
$kombu_ssl_certfile = undef,
$kombu_ssl_keyfile = undef,
$kombu_ssl_version = 'TLSv1',
$amqp_durable_queues = false,
$qpid_hostname = 'localhost',
$qpid_port = '5672',
$qpid_username = 'guest',
$qpid_password = 'guest',
$qpid_sasl_mechanisms = false,
$qpid_heartbeat = 60,
$qpid_protocol = 'tcp',
$qpid_tcp_nodelay = true,
$database_connection = undef,
$database_idle_timeout = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
$database_min_pool_size = undef,
$database_max_pool_size = undef,
$database_max_overflow = undef,
$rpc_backend = 'rabbit',
$nova_compute_url = false,
$nova_proxy_admin_user = 'admin',
$nova_proxy_admin_tenant_name = 'admin',
$control_exchange = 'trove',
$cinder_url = false,
$swift_url = false,
$neutron_url = false,
$os_region_name = undef,
$nova_compute_service_type = 'compute',
$cinder_service_type = 'volumev2',
$swift_service_type = 'object-store',
$heat_service_type = 'orchestration',
$neutron_service_type = 'network',
$use_neutron = true,
$package_ensure = 'present',
# DEPRECATED PARAMETERS
$mysql_module = undef,
) {
include ::trove::params
if $mysql_module {
warning('The mysql_module parameter is deprecated. The latest 2.x mysql module will be used.')
}
exec { 'post-trove_config':
command => '/bin/echo "Trove config has changed"',
refreshonly => true,
}
Trove_datastore<||> -> Trove_datastore_version<||>
if $nova_compute_url {
trove_config { 'DEFAULT/nova_compute_url': value => $nova_compute_url }
}
else {
trove_config { 'DEFAULT/nova_compute_url': ensure => absent }
}
if $cinder_url {
trove_config { 'DEFAULT/cinder_url': value => $cinder_url }
}
else {
trove_config { 'DEFAULT/cinder_url': ensure => absent }
}
if $swift_url {
trove_config { 'DEFAULT/swift_url': value => $swift_url }
}
else {
trove_config { 'DEFAULT/swift_url': ensure => absent }
}
if $neutron_url {
trove_config { 'DEFAULT/neutron_url': value => $neutron_url }
}
else {
trove_config { 'DEFAULT/neutron_url': ensure => absent }
}
package { 'trove':
ensure => $package_ensure,
name => $::trove::params::common_package_name,
tag => ['openstack', 'trove-package'],
}
}

View File

@ -1,225 +0,0 @@
#
# Copyright (C) 2014 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.
#
# trove::keystone::auth
#
# Configures Trove user, service and endpoint in Keystone.
#
# === Parameters
#
# [*password*]
# (required) Password for Trove user.
#
# [*auth_name*]
# Username for Trove service. Defaults to 'trove'.
#
# [*email*]
# Email for Trove user. Defaults to 'trove@localhost'.
#
# [*tenant*]
# Tenant for Trove user. Defaults to 'services'.
#
# [*configure_endpoint*]
# Should Trove endpoint be configured? Defaults to 'true'.
#
# [*service_type*]
# Type of service. Defaults to 'database'.
#
# [*service_name*]
# (optional) Name of the service.
# Defaults to the value of auth_name.
#
# [*service_description*]
# (optional) Description for keystone service.
# Defaults to 'Trove Database Service'.
#
# [*region*]
# Region for endpoint. Defaults to 'RegionOne'.
#
# [*public_url*]
# (optional) The endpoint's public url. (Defaults to 'http://127.0.0.1:8779/v1.0/%(tenant_id)s')
# This url should *not* contain any trailing '/'.
#
# [*admin_url*]
# (optional) The endpoint's admin url. (Defaults to 'http://127.0.0.1:8779/v1.0/%(tenant_id)s')
# This url should *not* contain any trailing '/'.
#
# [*internal_url*]
# (optional) The endpoint's internal url. (Defaults to 'http://127.0.0.1:8779/v1.0/%(tenant_id)s')
# This url should *not* contain any trailing '/'.
#
# [*port*]
# (optional) DEPRECATED: Use public_url, internal_url and admin_url instead.
# Default port for endpoints. (Defaults to 9001)
# Setting this parameter overrides public_url, internal_url and admin_url parameters.
#
# [*public_port*]
# (optional) DEPRECATED: Use public_url instead.
# Default port for endpoints. (Defaults to $port)
# Setting this parameter overrides public_url parameter.
#
# [*public_protocol*]
# (optional) DEPRECATED: Use public_url instead.
# Protocol for public endpoint. (Defaults to 'http')
# Setting this parameter overrides public_url parameter.
#
# [*public_address*]
# (optional) DEPRECATED: Use public_url instead.
# Public address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides public_url parameter.
#
# [*internal_protocol*]
# (optional) DEPRECATED: Use internal_url instead.
# Protocol for internal endpoint. (Defaults to 'http')
# Setting this parameter overrides internal_url parameter.
#
# [*internal_address*]
# (optional) DEPRECATED: Use internal_url instead.
# Internal address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides internal_url parameter.
#
# [*admin_protocol*]
# (optional) DEPRECATED: Use admin_url instead.
# Protocol for admin endpoint. (Defaults to 'http')
# Setting this parameter overrides admin_url parameter.
#
# [*admin_address*]
# (optional) DEPRECATED: Use admin_url instead.
# Admin address for endpoint. (Defaults to '127.0.0.1')
# Setting this parameter overrides admin_url parameter.
#
# === Deprecation notes
#
# If any value is provided for public_protocol, public_address or port parameters,
# public_url will be completely ignored. The same applies for internal and admin parameters.
#
# === Examples
#
# class { 'trove::keystone::auth':
# public_url => 'https://10.0.0.10:8779/v1.0/%(tenant_id)s',
# internal_url => 'https://10.0.0.11:8779/v1.0/%(tenant_id)s',
# admin_url => 'https://10.0.0.11:8779/v1.0/%(tenant_id)s',
# }
#
class trove::keystone::auth (
$password,
$auth_name = 'trove',
$email = 'trove@localhost',
$tenant = 'services',
$configure_endpoint = true,
$service_name = undef,
$service_type = 'database',
$service_description = 'Trove Database Service',
$region = 'RegionOne',
$public_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s',
$admin_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s',
$internal_url = 'http://127.0.0.1:8779/v1.0/%(tenant_id)s',
# DEPRECATED PARAMETERS
$port = undef,
$public_port = undef,
$public_protocol = undef,
$public_address = undef,
$internal_protocol = undef,
$internal_address = undef,
$admin_protocol = undef,
$admin_address = undef,
) {
if $port {
warning('The port parameter is deprecated, use public_url, internal_url and admin_url instead.')
}
if $public_port {
warning('The public_port parameter is deprecated, use public_url instead.')
}
if $public_protocol {
warning('The public_protocol parameter is deprecated, use public_url instead.')
}
if $internal_protocol {
warning('The internal_protocol parameter is deprecated, use internal_url instead.')
}
if $admin_protocol {
warning('The admin_protocol parameter is deprecated, use admin_url instead.')
}
if $public_address {
warning('The public_address parameter is deprecated, use public_url instead.')
}
if $internal_address {
warning('The internal_address parameter is deprecated, use internal_url instead.')
}
if $admin_address {
warning('The admin_address parameter is deprecated, use admin_url instead.')
}
if ($public_protocol or $public_address or $port or $public_port) {
$public_url_real = sprintf('%s://%s:%s/v1.0/%%(tenant_id)s',
pick($public_protocol, 'http'),
pick($public_address, '127.0.0.1'),
pick($public_port, $port, '8779'))
} else {
$public_url_real = $public_url
}
if ($admin_protocol or $admin_address or $port) {
$admin_url_real = sprintf('%s://%s:%s/v1.0/%%(tenant_id)s',
pick($admin_protocol, 'http'),
pick($admin_address, '127.0.0.1'),
pick($port, '8779'))
} else {
$admin_url_real = $admin_url
}
if ($internal_protocol or $internal_address or $port) {
$internal_url_real = sprintf('%s://%s:%s/v1.0/%%(tenant_id)s',
pick($internal_protocol, 'http'),
pick($internal_address, '127.0.0.1'),
pick($port, '8779'))
} else {
$internal_url_real = $internal_url
}
$real_service_name = pick($service_name, $auth_name)
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'trove-server' |>
Keystone_endpoint<| title == "${region}/${real_service_name}::${service_type}" |>
~> Service <| name == 'trove-server' |>
keystone::resource::service_identity { 'trove':
configure_user => true,
configure_user_role => true,
configure_endpoint => $configure_endpoint,
service_name => $real_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_real,
internal_url => $internal_url_real,
admin_url => $admin_url_real,
}
}

View File

@ -1,39 +0,0 @@
# Parameters for puppet-trove
#
class trove::params {
case $::osfamily {
'RedHat': {
$client_package_name = 'python-troveclient'
$common_package_name = 'openstack-trove'
$conductor_package_name = 'openstack-trove-conductor'
$conductor_service_name = 'openstack-trove-conductor'
$api_package_name = 'openstack-trove-api'
$api_service_name = 'openstack-trove-api'
$guestagent_package_name = 'openstack-trove-guestagent'
$guestagent_service_name = 'openstack-trove-guestagent'
$taskmanager_package_name = 'openstack-trove-taskmanager'
$taskmanager_service_name = 'openstack-trove-taskmanager'
$sqlite_package_name = undef
$pymysql_package_name = undef
}
'Debian': {
$client_package_name = 'python-troveclient'
$common_package_name = 'trove-common'
$conductor_package_name = 'trove-conductor'
$conductor_service_name = 'trove-conductor'
$api_package_name = 'trove-api'
$api_service_name = 'trove-api'
$guestagent_package_name = 'trove-guestagent'
$guestagent_service_name = 'trove-guestagent'
$taskmanager_package_name = 'trove-taskmanager'
$taskmanager_service_name = 'trove-taskmanager'
$sqlite_package_name = 'python-pysqlite2'
$pymysql_package_name = 'python-pymysql'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")
}
} # Case $::osfamily
}

View File

@ -1,43 +0,0 @@
# == Class: trove::quota
#
# Setup and configure trove quotas.
#
# === Parameters
#
# [*max_instances_per_user*]
# (optional) Default maximum number of instances per tenant.
# Defaults to 5.
#
# [*max_accepted_volume_size*]
# (optional) Default maximum volume size (in GB) for an instance.
# Defaults to 5.
#
# [*max_volumes_per_user*]
# (optional) Default maximum volume capacity (in GB) spanning across
# all Trove volumes per tenant.
# Defaults to 20.
#
# [*max_backups_per_user*]
# (optional) Default maximum number of backups created by a tenant.
# Defaults to 50.
#
# [*quota_driver*]
# (optional) Default driver to use for quota checks.
# Defaults to 'trove.quota.quota.DbQuotaDriver'.
#
class trove::quota (
$max_instances_per_user = 5,
$max_accepted_volume_size = 5,
$max_volumes_per_user = 20,
$max_backups_per_user = 50,
$quota_driver = 'trove.quota.quota.DbQuotaDriver',
) {
trove_config {
'DEFAULT/max_instances_per_user': value => $max_instances_per_user;
'DEFAULT/max_accepted_volume_size': value => $max_accepted_volume_size;
'DEFAULT/max_volumes_per_user': value => $max_volumes_per_user;
'DEFAULT/max_backups_per_user': value => $max_backups_per_user;
'DEFAULT/quota_driver': value => $quota_driver;
}
}

View File

@ -1,340 +0,0 @@
#
# Copyright (C) 2014 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.
#
# == Class: trove::taskmanager
#
# Manages trove taskmanager package and service
#
# === Parameters:
#
# [*enabled*]
# (optional) Whether to enable the trove-taskmanager service
# Defaults to true
#
# [*manage_service*]
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*ensure_package*]
# (optional) The state of the trove taskmanager package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Default: false
#
# [*log_file*]
# (optional) The path of file used for logging
# If set to boolean false, it will not log to any file.
# Default: /var/log/trove/trove-taskmanager.log
#
# [*log_dir*]
# (optional) directory to which trove logs are sent.
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
#
# [*auth_url*]
# (optional) Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [*heat_url*]
# (optional) URL without the tenant segment.
# Defaults to false
#
# [*guestagent_config_file*]
# (optional) Trove guest agent configuration file.
# Defaults to '/etc/trove/trove-guestagent.conf'.
#
# [*use_guestagent_template*]
# (optional) Use template to provision trove guest agent configuration file.
# Defaults to true.
#
# [*default_neutron_networks*]
# (optional) The network that trove will attach by default.
# Defaults to undef.
#
# [*taskmanager_queue*]
# (optional) Message queue name the Taskmanager will listen to.
# Defaults to 'taskmanager'.
#
class trove::taskmanager(
$enabled = true,
$manage_service = true,
$debug = false,
$verbose = false,
$log_file = '/var/log/trove/trove-taskmanager.log',
$log_dir = '/var/log/trove',
$use_syslog = false,
$log_facility = 'LOG_USER',
$auth_url = 'http://localhost:5000/v2.0',
$heat_url = false,
$ensure_package = 'present',
$guestagent_config_file = '/etc/trove/trove-guestagent.conf',
$use_guestagent_template = true,
$default_neutron_networks = undef,
$taskmanager_queue = 'taskmanager',
) inherits trove {
include ::trove::params
Package[$::trove::params::taskmanager_package_name] -> Trove_taskmanager_config<||>
Trove_taskmanager_config<||> ~> Exec['post-trove_config']
Trove_taskmanager_config<||> ~> Service['trove-taskmanager']
if $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
require 'mysql::bindings::python'
} elsif($::trove::database_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
} elsif($::trove::database_connection =~ /sqlite:\/\//) {
} else {
fail("Invalid db connection ${::trove::database_connection}")
}
trove_taskmanager_config {
'database/connection': value => $::trove::database_connection;
'database/idle_timeout': value => $::trove::database_idle_timeoutl;
}
}
# basic service config
trove_taskmanager_config {
'DEFAULT/verbose': value => $verbose;
'DEFAULT/debug': value => $debug;
'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
}
trove_config {
'DEFAULT/taskmanager_queue': value => $taskmanager_queue;
}
# region name
if $::trove::os_region_name {
trove_taskmanager_config { 'DEFAULT/os_region_name': value => $::trove::os_region_name }
}
else {
trove_taskmanager_config {'DEFAULT/os_region_name': ensure => absent }
}
# services type
trove_taskmanager_config {
'DEFAULT/nova_compute_service_type': value => $::trove::nova_compute_service_type;
'DEFAULT/cinder_service_type': value => $::trove::cinder_service_type;
'DEFAULT/neutron_service_type': value => $::trove::neutron_service_type;
'DEFAULT/swift_service_type': value => $::trove::swift_service_type;
'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit'{
if ! $::trove::rabbit_password {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
if $::trove::rabbit_hosts {
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_hosts': value => $::trove::rabbit_hosts }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host }
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port }
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" }
}
if $::trove::rabbit_ha_queues == undef {
if size($::trove::rabbit_hosts) > 1 {
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_taskmanager_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
# TODO(shaikapsar): remove the below lines once bug/1486319 merged to stable/liberty.
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
}
} else {
trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
}
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
trove_taskmanager_config {
'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
}
if is_array($::trove::qpid_sasl_mechanisms) {
trove_taskmanager_config {
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
}
}
}
if $::trove::use_neutron {
trove_config {
'DEFAULT/network_label_regex': value => '.*';
'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver';
'DEFAULT/default_neutron_networks': value => $default_neutron_networks;
}
trove_taskmanager_config {
'DEFAULT/network_label_regex': value => '.*';
'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver';
'DEFAULT/default_neutron_networks': value => $default_neutron_networks;
}
} else {
trove_config {
'DEFAULT/network_label_regex': value => '^private$';
'DEFAULT/network_driver': value => 'trove.network.nova.NovaNetwork';
'DEFAULT/default_neutron_networks': ensure => absent;
}
trove_taskmanager_config {
'DEFAULT/network_label_regex': value => '^private$';
'DEFAULT/network_driver': value => 'trove.network.nova.NovaNetwork';
'DEFAULT/default_neutron_networks': ensure => absent;
}
}
# Logging
if $log_file {
trove_taskmanager_config {
'DEFAULT/log_file': value => $log_file;
}
} else {
trove_taskmanager_config {
'DEFAULT/log_file': ensure => absent;
}
}
if $log_dir {
trove_taskmanager_config {
'DEFAULT/log_dir': value => $log_dir;
}
} else {
trove_taskmanager_config {
'DEFAULT/log_dir': ensure => absent;
}
}
# Syslog
if $use_syslog {
trove_taskmanager_config {
'DEFAULT/use_syslog' : value => true;
'DEFAULT/syslog_log_facility' : value => $log_facility;
}
} else {
trove_taskmanager_config {
'DEFAULT/use_syslog': value => false;
}
}
trove::generic_service { 'taskmanager':
enabled => $enabled,
manage_service => $manage_service,
package_name => $::trove::params::taskmanager_package_name,
service_name => $::trove::params::taskmanager_service_name,
ensure_package => $ensure_package,
}
# (shaikapsar): Remove ::trove::guestagent declaraion from here.
if $guestagent_config_file {
if $use_guestagent_template {
file { $guestagent_config_file:
content => template('trove/trove-guestagent.conf.erb'),
require => Package[$::trove::params::taskmanager_package_name]
}
}
trove_taskmanager_config {
'DEFAULT/guest_config': value => $guestagent_config_file
}
}
# TO-DO(mmagr): Disabling transformer workarounds bug #1402055.
# Remove this hack as soon as bug is fixed.
if $::osfamily == 'RedHat' {
trove_taskmanager_config {
'DEFAULT/exists_notification_transformer': ensure => absent,
}
}
trove_taskmanager_config {
'DEFAULT/use_nova_server_config_drive': value => true,
}
}

View File

@ -1,39 +0,0 @@
{
"name": "openstack-trove",
"version": "7.1.0",
"author": "eNovance and OpenStack Contributors",
"summary": "Puppet module for OpenStack Trove",
"license": "Apache-2.0",
"source": "git://github.com/openstack/puppet-trove.git",
"project_page": "https://launchpad.net/puppet-trove",
"issues_url": "https://bugs.launchpad.net/puppet-trove",
"requirements": [
{ "name": "pe","version_requirement": "3.x" },
{ "name": "puppet","version_requirement": "3.x" }
],
"operatingsystem_support": [
{
"operatingsystem": "Debian",
"operatingsystemrelease": ["7"]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": ["20"]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": ["6.5","7"]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": ["12.04","14.04"]
}
],
"description": "Installs and configures OpenStack Trove (Database service).",
"dependencies": [
{ "name": "puppetlabs/inifile", "version_requirement": ">=1.0.0 <2.0.0" },
{ "name": "openstack/keystone", "version_requirement": ">=7.1.0 <8.0.0" },
{ "name": "puppetlabs/stdlib", "version_requirement": ">=4.0.0 <5.0.0" },
{ "name": "openstack/openstacklib", "version_requirement": ">=7.1.0 <8.0.0" }
]
}

View File

@ -1,73 +0,0 @@
require 'spec_helper_acceptance'
describe 'basic trove' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
include ::openstack_integration
include ::openstack_integration::repos
include ::openstack_integration::rabbitmq
include ::openstack_integration::mysql
include ::openstack_integration::keystone
rabbitmq_user { 'trove':
admin => true,
password => 'an_even_bigger_secret',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
rabbitmq_user_permissions { 'trove@/':
configure_permission => '.*',
write_permission => '.*',
read_permission => '.*',
provider => 'rabbitmqctl',
require => Class['rabbitmq'],
}
# Trove resources
class { '::trove':
database_connection => 'mysql+pymysql://trove:a_big_secret@127.0.0.1/trove?charset=utf8',
rabbit_userid => 'trove',
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
nova_proxy_admin_pass => 'a_big_secret',
}
class { '::trove::db::mysql':
password => 'a_big_secret',
}
class { '::trove::keystone::auth':
password => 'a_big_secret',
}
class { '::trove::api':
keystone_password => 'a_big_secret',
auth_url => 'http://127.0.0.1:35357/',
debug => true,
verbose => true,
}
class { '::trove::client': }
class { '::trove::conductor':
debug => true,
verbose => true,
}
class { '::trove::taskmanager':
debug => true,
verbose => true,
}
class { '::trove::quota': }
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe port(8779) do
it { is_expected.to be_listening.with('tcp') }
end
end
end

View File

@ -1,11 +0,0 @@
HOSTS:
centos-server-70-x64:
roles:
- master
platform: el-7-x86_64
box: puppetlabs/centos-7.0-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/centos-7.0-64-nocm
hypervisor: vagrant
CONFIG:
log_level: debug
type: foss

View File

@ -1,10 +0,0 @@
HOSTS:
ubuntu-server-14.04-amd64:
roles:
- master
platform: ubuntu-14.04-amd64
box: puppetlabs/ubuntu-14.04-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
hypervisor: vagrant
CONFIG:
type: foss

View File

@ -1,10 +0,0 @@
HOSTS:
centos-70-x64:
roles:
- master
platform: el-7-x86_64
hypervisor: none
ip: 127.0.0.1
CONFIG:
type: foss
set_env: false

View File

@ -1,10 +0,0 @@
HOSTS:
ubuntu-14.04-amd64:
roles:
- master
platform: ubuntu-14.04-amd64
hypervisor: none
ip: 127.0.0.1
CONFIG:
type: foss
set_env: false

View File

@ -1,11 +0,0 @@
HOSTS:
ubuntu-server-14.04-amd64:
roles:
- master
platform: ubuntu-14.04-amd64
box: puppetlabs/ubuntu-14.04-64-nocm
box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
hypervisor: vagrant
CONFIG:
log_level: debug
type: foss

View File

@ -1,277 +0,0 @@
#
# Copyright (C) 2014 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 trove::api
#
require 'spec_helper'
describe 'trove::api' do
let :params do
{ :keystone_password => 'passw0rd',
:auth_host => '10.0.0.10',
:auth_url => 'http://10.0.0.10:5000/v2.0',
:auth_port => '35357',
:auth_protocol => 'https',
:keystone_tenant => '_services_',
:keystone_user => 'trove',
}
end
shared_examples 'trove-api' do
context 'with default parameters' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
os_region_name => 'RegionOne',
nova_compute_service_type => 'compute',
cinder_service_type => 'volume',
swift_service_type => 'object-store',
heat_service_type => 'orchestration',
neutron_service_type => 'network'}"
end
it 'installs trove-api package and service' do
is_expected.to contain_service('trove-api').with(
:name => platform_params[:api_service_name],
:ensure => 'running',
:hasstatus => true,
:enable => true
)
is_expected.to contain_package('trove-api').with(
:name => platform_params[:api_package_name],
:ensure => 'present',
:notify => 'Service[trove-api]'
)
end
it 'configures trove-api with default parameters' do
is_expected.to contain_trove_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_config('DEFAULT/bind_host').with_value('0.0.0.0')
is_expected.to contain_trove_config('DEFAULT/bind_port').with_value('8779')
is_expected.to contain_trove_config('DEFAULT/backlog').with_value('4096')
is_expected.to contain_trove_config('DEFAULT/trove_api_workers').with_value('8')
is_expected.to contain_trove_config('DEFAULT/trove_auth_url').with_value('http://10.0.0.10:5000/v2.0')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
is_expected.to contain_trove_config('keystone_authtoken/auth_host').with_value('10.0.0.10')
is_expected.to contain_trove_config('keystone_authtoken/auth_port').with_value('35357')
is_expected.to contain_trove_config('keystone_authtoken/auth_protocol').with_value('https')
is_expected.to contain_trove_config('keystone_authtoken/admin_tenant_name').with_value('_services_')
is_expected.to contain_trove_config('keystone_authtoken/admin_user').with_value('trove')
is_expected.to contain_trove_config('keystone_authtoken/admin_password').with_value('passw0rd')
is_expected.to contain_trove_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_config('DEFAULT/nova_compute_service_type').with_value('compute')
is_expected.to contain_trove_config('DEFAULT/cinder_service_type').with_value('volume')
is_expected.to contain_trove_config('DEFAULT/swift_service_type').with_value('object-store')
is_expected.to contain_trove_config('DEFAULT/heat_service_type').with_value('orchestration')
is_expected.to contain_trove_config('DEFAULT/neutron_service_type').with_value('network')
is_expected.to contain_trove_config('DEFAULT/http_get_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_post_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_put_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('200')
end
context 'with overridden rate limit parameters' do
before :each do
params.merge!(
:http_get_rate => '1000',
:http_post_rate => '1000',
:http_put_rate => '1000',
:http_delete_rate => '1000',
:http_mgmt_post_rate => '2000',
)
end
it 'contains overrided rate limit values' do
is_expected.to contain_trove_config('DEFAULT/http_get_rate').with_value('1000')
is_expected.to contain_trove_config('DEFAULT/http_post_rate').with_value('1000')
is_expected.to contain_trove_config('DEFAULT/http_put_rate').with_value('1000')
is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('1000')
is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('2000')
end
end
context 'when using a single RabbitMQ server' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false')
is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false')
end
end
context 'when using a single RabbitMQ server with enable ha options' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
end
end
context 'when using multiple RabbitMQ servers' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_hosts').with_value(['10.0.0.1,10.0.0.2'])
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
end
end
context 'when using qpid' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password'}"
end
it 'configures trove-api with qpid' do
is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp')
end
end
context 'when using qpid with SSL enabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password',
qpid_protocol => 'ssl'}"
end
it 'configures trove-api with qpid' do
is_expected.to contain_trove_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_config('oslo_messaging_qpid/qpid_protocol').with_value('ssl')
end
end
end
context 'with SSL enabled with kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true,
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
kombu_ssl_certfile => '/path/to/ssl/cert/file',
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL enabled without kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true}"
end
it do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL disabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false,
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
:processorcount => 8 }
end
let :platform_params do
{ :api_package_name => 'trove-api',
:api_service_name => 'trove-api' }
end
it_configures 'trove-api'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:processorcount => 8 }
end
let :platform_params do
{ :api_package_name => 'openstack-trove-api',
:api_service_name => 'openstack-trove-api' }
end
it_configures 'trove-api'
end
end

View File

@ -1,55 +0,0 @@
#
# Copyright (C) 2014 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 trove::client
#
require 'spec_helper'
describe 'trove::client' do
shared_examples_for 'trove client' do
context 'with default parameters' do
it { is_expected.to contain_package('python-troveclient').with_ensure('present') }
end
context 'with package_ensure parameter provided' do
let :params do
{ :package_ensure => false }
end
it { is_expected.to contain_package('python-troveclient').with_ensure('false') }
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'trove client'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'trove client'
end
end

View File

@ -1,208 +0,0 @@
require 'spec_helper'
describe 'trove::conductor' do
shared_examples 'trove-conductor' do
context 'with default parameters' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete'}"
end
it 'installs trove-conductor package and service' do
is_expected.to contain_service('trove-conductor').with(
:name => platform_params[:conductor_service_name],
:ensure => 'running',
:hasstatus => true,
:enable => true
)
is_expected.to contain_package('trove-conductor').with(
:name => platform_params[:conductor_package_name],
:ensure => 'present',
:notify => 'Service[trove-conductor]'
)
end
it 'configures trove-conductor with default parameters' do
is_expected.to contain_trove_conductor_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
end
context 'when using a single RabbitMQ server' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-conductor with RabbitMQ' do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false')
end
end
context 'when using a single RabbitMQ server with enable ha options' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
end
end
context 'when using multiple RabbitMQ servers' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
end
it 'configures trove-conductor with RabbitMQ' do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_hosts').with_value(['10.0.0.1,10.0.0.2'])
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
end
end
context 'when using qpid' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password'}"
end
it 'configures trove-conductor with qpid' do
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp')
end
end
context 'when using qpid with SSL enabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password',
qpid_protocol => 'ssl'}"
end
it 'configures trove-conductor with qpid' do
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_conductor_config('oslo_messaging_qpid/qpid_protocol').with_value('ssl')
end
end
context 'when using MySQL' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
database_connection => 'mysql://trove:pass@10.0.0.1/trove'}"
end
it 'configures trove-conductor with RabbitMQ' do
is_expected.to contain_trove_conductor_config('database/connection').with_value('mysql://trove:pass@10.0.0.1/trove')
end
end
end
context 'with SSL enabled with kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true,
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
kombu_ssl_certfile => '/path/to/ssl/cert/file',
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL enabled without kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true}"
end
it do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL disabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false,
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
:processorcount => 8 }
end
let :platform_params do
{ :conductor_package_name => 'trove-conductor',
:conductor_service_name => 'trove-conductor' }
end
it_configures 'trove-conductor'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:processorcount => 8 }
end
let :platform_params do
{ :conductor_package_name => 'openstack-trove-conductor',
:conductor_service_name => 'openstack-trove-conductor' }
end
it_configures 'trove-conductor'
end
end

View File

@ -1,63 +0,0 @@
require 'spec_helper'
describe 'trove::config' do
let :params do
{ :trove_config => {
'DEFAULT/foo' => { 'value' => 'fooValue' },
'DEFAULT/bar' => { 'value' => 'barValue' },
'DEFAULT/baz' => { 'ensure' => 'absent' }
},
:trove_taskmanager_config => {
'DEFAULT/foo2' => { 'value' => 'fooValue' },
'DEFAULT/bar2' => { 'value' => 'barValue' },
'DEFAULT/baz2' => { 'ensure' => 'absent' }
},
:trove_conductor_config => {
'DEFAULT/foo2' => { 'value' => 'fooValue' },
'DEFAULT/bar2' => { 'value' => 'barValue' },
'DEFAULT/baz2' => { 'ensure' => 'absent' }
},
:trove_guestagent_config => {
'DEFAULT/foo2' => { 'value' => 'fooValue' },
'DEFAULT/bar2' => { 'value' => 'barValue' },
'DEFAULT/baz2' => { 'ensure' => 'absent' }
},
:trove_api_paste_ini => {
'DEFAULT/foo2' => { 'value' => 'fooValue' },
'DEFAULT/bar2' => { 'value' => 'barValue' },
'DEFAULT/baz2' => { 'ensure' => 'absent' }
}
}
end
it 'configures arbitrary trove configurations' do
is_expected.to contain_trove_config('DEFAULT/foo').with_value('fooValue')
is_expected.to contain_trove_config('DEFAULT/bar').with_value('barValue')
is_expected.to contain_trove_config('DEFAULT/baz').with_ensure('absent')
end
it 'configures arbitrary trove taskmanager configurations' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/foo2').with_value('fooValue')
is_expected.to contain_trove_taskmanager_config('DEFAULT/bar2').with_value('barValue')
is_expected.to contain_trove_taskmanager_config('DEFAULT/baz2').with_ensure('absent')
end
it 'configures arbitrary trove conductor configurations' do
is_expected.to contain_trove_conductor_config('DEFAULT/foo2').with_value('fooValue')
is_expected.to contain_trove_conductor_config('DEFAULT/bar2').with_value('barValue')
is_expected.to contain_trove_conductor_config('DEFAULT/baz2').with_ensure('absent')
end
it 'configures arbitrary trove guestagent configurations' do
is_expected.to contain_trove_guestagent_config('DEFAULT/foo2').with_value('fooValue')
is_expected.to contain_trove_guestagent_config('DEFAULT/bar2').with_value('barValue')
is_expected.to contain_trove_guestagent_config('DEFAULT/baz2').with_ensure('absent')
end
it 'configures arbitrary trove api-paste configurations' do
is_expected.to contain_trove_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
is_expected.to contain_trove_api_paste_ini('DEFAULT/bar2').with_value('barValue')
is_expected.to contain_trove_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
end
end

View File

@ -1,109 +0,0 @@
#
# Copyright (C) 2014 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.
require 'spec_helper'
describe 'trove::db::mysql' do
let :pre_condition do
[
'include mysql::server',
'include trove::db::sync'
]
end
let :params do
{ :dbname => 'trove',
:password => 's3cr3t',
:user => 'trove',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:host => '127.0.0.1',
}
end
shared_examples_for 'trove mysql database' do
context 'when omiting the required parameter password' do
before { params.delete(:password) }
it { expect { is_expected.to raise_error(Puppet::Error) } }
end
it 'creates a mysql database' do
is_expected.to contain_openstacklib__db__mysql('trove').with(
:user => params[:user],
:dbname => params[:dbname],
:password_hash => '*58C036CDA51D8E8BBBBF2F9EA5ABF111ADA444F0',
:host => params[:host],
:charset => params[:charset]
)
end
context 'overriding allowed_hosts param to array' do
before :each do
params.merge!(
:allowed_hosts => ['127.0.0.1','%']
)
end
it {
is_expected.to contain_openstacklib__db__mysql('trove').with(
:user => params[:user],
:dbname => params[:dbname],
:password_hash => '*58C036CDA51D8E8BBBBF2F9EA5ABF111ADA444F0',
:host => params[:host],
:charset => params[:charset],
:allowed_hosts => ['127.0.0.1','%']
)}
end
context 'overriding allowed_hosts param to string' do
before :each do
params.merge!(
:allowed_hosts => '192.168.1.1'
)
end
it {
is_expected.to contain_openstacklib__db__mysql('trove').with(
:user => params[:user],
:dbname => params[:dbname],
:password_hash => '*58C036CDA51D8E8BBBBF2F9EA5ABF111ADA444F0',
:host => params[:host],
:charset => params[:charset],
:allowed_hosts => '192.168.1.1'
)}
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'trove mysql database'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'trove mysql database'
end
end

View File

@ -1,58 +0,0 @@
require 'spec_helper'
describe 'trove::db::postgresql' do
let :req_params do
{ :password => 'pw' }
end
let :pre_condition do
'include postgresql::server'
end
context 'on a RedHat osfamily' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}
end
context 'with only required parameters' do
let :params do
req_params
end
it { is_expected.to contain_postgresql__server__db('trove').with(
:user => 'trove',
:password => 'md5e12ef276d200761a0808f17a5b076451'
)}
end
end
context 'on a Debian osfamily' do
let :facts do
{
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
end
context 'with only required parameters' do
let :params do
req_params
end
it { is_expected.to contain_postgresql__server__db('trove').with(
:user => 'trove',
:password => 'md5e12ef276d200761a0808f17a5b076451'
)}
end
end
end

View File

@ -1,119 +0,0 @@
require 'spec_helper'
describe 'trove::db' do
shared_examples 'trove::db' do
context 'with default parameters' do
it { is_expected.to contain_trove_config('database/connection').with_value('sqlite:////var/lib/trove/trove.sqlite').with_secret(true) }
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('3600') }
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('1') }
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('10') }
it { is_expected.to contain_trove_config('database/max_overflow').with_value('20') }
it { is_expected.to contain_trove_config('database/max_retries').with_value('10') }
it { is_expected.to contain_trove_config('database/retry_interval').with_value('10') }
end
context 'with specific parameters' do
let :params do
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove',
:database_idle_timeout => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '21',
:database_max_retries => '11',
:database_max_overflow => '21',
:database_retry_interval => '11', }
end
it { is_expected.to contain_trove_config('database/connection').with_value('mysql+pymysql://trove:trove@localhost/trove').with_secret(true) }
it { is_expected.to contain_trove_config('database/idle_timeout').with_value('3601') }
it { is_expected.to contain_trove_config('database/min_pool_size').with_value('2') }
it { is_expected.to contain_trove_config('database/max_retries').with_value('11') }
it { is_expected.to contain_trove_config('database/max_pool_size').with_value('21') }
it { is_expected.to contain_trove_config('database/max_overflow').with_value('21') }
it { is_expected.to contain_trove_config('database/retry_interval').with_value('11') }
end
context 'with MySQL-python library as backend package' do
let :params do
{ :database_connection => 'mysql://trove:trove@localhost/trove', }
end
it { is_expected.to contain_package('python-mysqldb').with(:ensure => 'present') }
end
context 'with postgresql backend' do
let :params do
{ :database_connection => 'postgresql://trove:trove@localhost/trove', }
end
it 'install the proper backend package' do
is_expected.to contain_package('python-psycopg2').with(:ensure => 'present')
end
end
context 'with incorrect database_connection string' do
let :params do
{ :database_connection => 'redis://trove:trove@localhost/trove', }
end
it_raises 'a Puppet::Error', /validate_re/
end
context 'with incorrect pymysql database_connection string' do
let :params do
{ :database_connection => 'foo+pymysql://trove:trove@localhost/trove', }
end
it_raises 'a Puppet::Error', /validate_re/
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => 'jessie',
}
end
it_configures 'trove::db'
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
end
it 'install the proper backend package' do
is_expected.to contain_package('trove-backend-package').with(
:ensure => 'present',
:name => 'python-pymysql',
:tag => 'openstack'
)
end
end
end
context 'on Redhat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:operatingsystemrelease => '7.1',
}
end
it_configures 'trove::db'
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
end
it { is_expected.not_to contain_package('trove-backend-package') }
end
end
end

View File

@ -1,222 +0,0 @@
require 'spec_helper'
describe 'trove::guestagent' do
shared_examples 'trove-guestagent' do
context 'with default parameters' do
let :pre_condition do
"class { 'trove':
os_region_name => 'RegionOne',
nova_proxy_admin_pass => 'verysecrete'}"
end
it 'installs trove-guestagent package and service' do
is_expected.to contain_service('trove-guestagent').with(
:name => platform_params[:guestagent_service_name],
:ensure => 'running',
:hasstatus => true,
:enable => true
)
is_expected.to contain_package('trove-guestagent').with(
:name => platform_params[:guestagent_package_name],
:ensure => 'present',
:notify => 'Service[trove-guestagent]'
)
end
it 'configures trove-guestagent with default parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_hosts').with_value(false)
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_port').with_value('5672')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
end
context 'when using a single RabbitMQ server' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-guestagent with RabbitMQ' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false')
end
end
context 'when using a single RabbitMQ server with enable ha options' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
end
end
context 'when using multiple RabbitMQ servers' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
end
it 'configures trove-guestagent with RabbitMQ' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_hosts').with_value(['10.0.0.1,10.0.0.2'])
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
end
end
context 'when using qpid' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password'}"
end
it 'configures trove-guestagent with qpid' do
is_expected.to contain_trove_guestagent_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp')
end
end
context 'when using qpid with SSL enabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password',
qpid_protocol => 'ssl'}"
end
it 'configures trove-guestagent with qpid' do
is_expected.to contain_trove_guestagent_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_guestagent_config('oslo_messaging_qpid/qpid_protocol').with_value('ssl')
end
end
end
context 'with custom parameters' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete'}"
end
let :params do
{ :auth_url => "http://10.0.0.1:5000/v2.0",
:swift_url => "http://10.0.0.1:8080/v1/AUTH_",
:rabbit_host => '10.1.0.1',
:rabbit_port => '5673',
:rabbit_use_ssl => 'true'}
end
it 'configures trove-guestagent with custom parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/trove_auth_url').with_value('http://10.0.0.1:5000/v2.0')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('http://10.0.0.1:8080/v1/AUTH_')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.1.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_port').with_value('5673')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
end
end
context 'with SSL enabled with kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true,
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
kombu_ssl_certfile => '/path/to/ssl/cert/file',
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL enabled without kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true}"
end
it do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL disabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false,
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
:processorcount => 8 }
end
let :platform_params do
{ :guestagent_package_name => 'trove-guestagent',
:guestagent_service_name => 'trove-guestagent' }
end
it_configures 'trove-guestagent'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:processorcount => 8 }
end
let :platform_params do
{ :guestagent_package_name => 'openstack-trove-guestagent',
:guestagent_service_name => 'openstack-trove-guestagent' }
end
it_configures 'trove-guestagent'
end
end

View File

@ -1,70 +0,0 @@
#
# Copyright (C) 2014 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 trove::init
#
require 'spec_helper'
describe 'trove' do
let :params do
{ :nova_proxy_admin_pass => 'passw0rd',
:nova_compute_url => 'http://localhost:8774/v2',
:cinder_url => 'http://localhost:8776/v1',
:swift_url => 'http://localhost:8080/v1/AUTH_',
:neutron_url => 'http://localhost:9696/',
}
end
shared_examples_for 'trove' do
context 'with default parameters' do
it {
is_expected.to contain_class('trove::params')
is_expected.to contain_trove_config('DEFAULT/nova_compute_url').with_value('http://localhost:8774/v2')
is_expected.to contain_trove_config('DEFAULT/cinder_url').with_value('http://localhost:8776/v1')
is_expected.to contain_trove_config('DEFAULT/swift_url').with_value('http://localhost:8080/v1/AUTH_')
is_expected.to contain_trove_config('DEFAULT/neutron_url').with_value('http://localhost:9696/')
}
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'trove'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
it 'installs common package' do
is_expected.to contain_package('trove').with(
:name => 'openstack-trove',
:ensure => 'present',
:tag => ['openstack', 'trove-package'],
)
end
it_configures 'trove'
end
end

View File

@ -1,139 +0,0 @@
#
# Copyright (C) 2014 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 trove::keystone::auth
#
require 'spec_helper'
describe 'trove::keystone::auth' do
let :facts do
{ :osfamily => 'Debian' }
end
describe 'with default class parameters' do
let :params do
{ :password => 'trove_password',
:tenant => 'foobar' }
end
it { is_expected.to contain_keystone_user('trove').with(
:ensure => 'present',
:password => 'trove_password',
) }
it { is_expected.to contain_keystone_user_role('trove@foobar').with(
:ensure => 'present',
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('trove::database').with(
:ensure => 'present',
:description => 'Trove Database Service'
) }
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
:admin_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
:internal_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s"
) }
end
describe 'when configuring trove-server' do
let :pre_condition do
"class { 'trove::server': auth_password => 'test' }"
end
let :params do
{ :password => 'trove_password',
:tenant => 'foobar' }
end
end
describe 'when overriding endpoint URLs' do
let :params do
{ :password => 'passw0rd',
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s' }
end
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s'
) }
end
describe 'with deprecated endpoint parameters' do
let :params do
{ :password => 'trove_password',
:public_protocol => 'https',
:public_port => '80',
:public_address => '10.10.10.10',
:port => '81',
:internal_protocol => 'https',
:internal_address => '10.10.10.11',
:admin_protocol => 'https',
:admin_address => '10.10.10.12' }
end
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
:ensure => 'present',
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
:internal_url => 'https://10.10.10.11:81/v1.0/%(tenant_id)s',
:admin_url => 'https://10.10.10.12:81/v1.0/%(tenant_id)s'
) }
end
describe 'when overriding auth name' do
let :params do
{ :password => 'foo',
:auth_name => 'trovey' }
end
it { is_expected.to contain_keystone_user('trovey') }
it { is_expected.to contain_keystone_user_role('trovey@services') }
it { is_expected.to contain_keystone_service('trovey::database') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trovey::database') }
end
describe 'when overriding service name' do
let :params do
{ :service_name => 'trove_service',
:auth_name => 'trove',
:password => 'trove_password' }
end
it { is_expected.to contain_keystone_user('trove') }
it { is_expected.to contain_keystone_user_role('trove@services') }
it { is_expected.to contain_keystone_service('trove_service::database') }
it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service::database') }
end
describe 'when disabling endpoint configuration' do
let :params do
{ :configure_endpoint => false,
:password => 'trove_password' }
end
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::database') }
end
end

View File

@ -1,39 +0,0 @@
require 'spec_helper'
describe 'trove::quota' do
describe 'with default parameters' do
it 'contains default values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
:value => 20)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
:value => 50)
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
:value => 'trove.quota.quota.DbQuotaDriver')
end
end
describe 'with overridden parameters' do
let :params do
{ :max_instances_per_user => 10,
:max_accepted_volume_size => 10,
:max_volumes_per_user => 100,
:max_backups_per_user => 100,
}
end
it 'contains overrided values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
:value => 100)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
:value => 100)
end
end
end

View File

@ -1,303 +0,0 @@
#
# Copyright (C) 2014 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 trove::taskmanager
#
require 'spec_helper'
describe 'trove::taskmanager' do
shared_examples 'trove-taskmanager' do
context 'with default parameters' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
os_region_name => 'RegionOne',
nova_compute_service_type => 'compute',
cinder_service_type => 'volume',
swift_service_type => 'object-store',
heat_service_type => 'orchestration',
neutron_service_type => 'network'}"
end
it 'installs trove-taskmanager package and service' do
is_expected.to contain_service('trove-taskmanager').with(
:name => platform_params[:taskmanager_service_name],
:ensure => 'running',
:hasstatus => true,
:enable => true
)
is_expected.to contain_package('trove-taskmanager').with(
:name => platform_params[:taskmanager_package_name],
:ensure => 'present',
:notify => 'Service[trove-taskmanager]'
)
end
it 'configures trove-taskmanager with default parameters' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
is_expected.to contain_trove_taskmanager_config('DEFAULT/default_neutron_networks').with_value(nil)
is_expected.to contain_trove_config('DEFAULT/default_neutron_networks').with_value(nil)
is_expected.to contain_trove_taskmanager_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_taskmanager_config('DEFAULT/nova_compute_service_type').with_value('compute')
is_expected.to contain_trove_taskmanager_config('DEFAULT/cinder_service_type').with_value('volume')
is_expected.to contain_trove_taskmanager_config('DEFAULT/swift_service_type').with_value('object-store')
is_expected.to contain_trove_taskmanager_config('DEFAULT/heat_service_type').with_value('orchestration')
is_expected.to contain_trove_taskmanager_config('DEFAULT/neutron_service_type').with_value('network')
is_expected.to contain_trove_config('DEFAULT/taskmanager_queue').with_value('taskmanager')
is_expected.to contain_file('/etc/trove/trove-guestagent.conf')
end
context 'when set use_guestagent_template to false' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',}
class { 'trove::taskmanager':
use_guestagent_template => false,}"
end
it 'configures trove-taskmanager with trove::guestagent' do
is_expected.to contain_class('trove::guestagent').with(
:enabled => false,
:manage_service => false,
)
end
end
context 'when using a single RabbitMQ server' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-taskmanager with RabbitMQ' do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false')
end
end
context 'when using a single RabbitMQ server with enable ha options' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
amqp_durable_queues => 'true'
rabbit_host => '10.0.0.1'}"
end
it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true')
end
end
context 'when using multiple RabbitMQ servers' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
end
it 'configures trove-taskmanager with RabbitMQ' do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_hosts').with_value(['10.0.0.1,10.0.0.2'])
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true')
end
end
context 'when using qpid' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password'}"
end
it 'configures trove-taskmanager with qpid' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp')
end
end
context 'when using qpid with SSL enabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rpc_backend => 'qpid',
qpid_hostname => '10.0.0.1',
qpid_username => 'guest',
qpid_password => 'password',
qpid_protocol => 'ssl'}"
end
it 'configures trove-taskmanager with qpid' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/rpc_backend').with_value('qpid')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_hostname').with_value('10.0.0.1')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_username').with_value('guest')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_password').with_value('password')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_qpid/qpid_protocol').with_value('ssl')
end
end
context 'when using MySQL' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
database_connection => 'mysql://trove:pass@10.0.0.1/trove'}"
end
it 'configures trove-taskmanager with RabbitMQ' do
is_expected.to contain_trove_taskmanager_config('database/connection').with_value('mysql://trove:pass@10.0.0.1/trove')
end
end
context 'when using Neutron' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
use_neutron => true}
class { 'trove::taskmanager':
default_neutron_networks => 'trove_service',
}
"
end
it 'configures trove to use the Neutron network driver' do
is_expected.to contain_trove_config('DEFAULT/default_neutron_networks').with_value('trove_service')
is_expected.to contain_trove_taskmanager_config('DEFAULT/default_neutron_networks').with_value('trove_service')
is_expected.to contain_trove_config('DEFAULT/network_driver').with_value('trove.network.neutron.NeutronDriver')
is_expected.to contain_trove_taskmanager_config('DEFAULT/network_driver').with_value('trove.network.neutron.NeutronDriver')
end
it 'configures trove to use any network label' do
is_expected.to contain_trove_config('DEFAULT/network_label_regex').with_value('.*')
is_expected.to contain_trove_taskmanager_config('DEFAULT/network_label_regex').with_value('.*')
end
end
context 'when using Nova Network' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
use_neutron => false}"
end
it 'configures trove to use the Nova Network network driver' do
is_expected.to contain_trove_config('DEFAULT/network_driver').with_value('trove.network.nova.NovaNetwork')
is_expected.to contain_trove_taskmanager_config('DEFAULT/network_driver').with_value('trove.network.nova.NovaNetwork')
end
it 'configures trove to use the "private" network label' do
is_expected.to contain_trove_config('DEFAULT/network_label_regex').with_value('^private$')
is_expected.to contain_trove_taskmanager_config('DEFAULT/network_label_regex').with_value('^private$')
end
end
end
context 'with SSL enabled with kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true,
kombu_ssl_ca_certs => '/path/to/ssl/ca/certs',
kombu_ssl_certfile => '/path/to/ssl/cert/file',
kombu_ssl_keyfile => '/path/to/ssl/keyfile',
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL enabled without kombu' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => true}"
end
it do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
end
end
context 'with SSL disabled' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false,
kombu_ssl_version => 'TLSv1'}"
end
it do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
end
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian',
:processorcount => 8 }
end
let :platform_params do
{ :taskmanager_package_name => 'trove-taskmanager',
:taskmanager_service_name => 'trove-taskmanager' }
end
it_configures 'trove-taskmanager'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat',
:processorcount => 8 }
end
let :platform_params do
{ :taskmanager_package_name => 'openstack-trove-taskmanager',
:taskmanager_service_name => 'openstack-trove-taskmanager' }
end
it_configures 'trove-taskmanager'
end
end

View File

@ -1,60 +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
shared_examples 'generic trove service' do |service|
context 'with default parameters' do
it 'installs package and service' do
is_expected.to contain_package(service[:name]).with({
:name => service[:package_name],
:ensure => 'present',
:notify => "Service[#{service[:name]}]",
:tag => ['openstack', 'trove-package'],
})
is_expected.to contain_service(service[:name]).with({
:name => service[:service_name],
:ensure => 'stopped',
:hasstatus => true,
:enable => false,
:tag => 'trove-service',
})
end
end
context 'with overridden parameters' do
let :params do
{ :enabled => true,
:ensure_package => '2014.1-1' }
end
it 'installs package and service' do
is_expected.to contain_package(service[:name]).with({
:name => service[:package_name],
:ensure => '2014.1-1',
:notify => "Service[#{service[:name]}]",
:tag => ['openstack', 'trove-package'],
})
is_expected.to contain_service(service[:name]).with({
:name => service[:service_name],
:ensure => 'running',
:hasstatus => true,
:enable => true,
:tag => 'trove-service',
})
end
end
context 'while not managing service state' do
let :params do
{ :enabled => false,
:manage_service => false }
end
it 'does not control service state' do
is_expected.to contain_service(service[:name]).without_ensure
end
end
end

View File

@ -1,9 +0,0 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
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,56 +0,0 @@
require 'beaker-rspec'
require 'beaker/puppet_install_helper'
run_puppet_install_helper
RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1]
# Readable test descriptions
c.formatter = :documentation
# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
hosts.each do |host|
# install git
install_package host, 'git'
zuul_ref = ENV['ZUUL_REF']
zuul_branch = ENV['ZUUL_BRANCH']
zuul_url = ENV['ZUUL_URL']
repo = 'openstack/puppet-openstack-integration'
# Start out with clean moduledir, don't trust r10k to purge it
on host, "rm -rf /etc/puppet/modules/*"
# Install dependent modules via git or zuul
r = on host, "test -e /usr/zuul-env/bin/zuul-cloner", { :acceptable_exit_codes => [0,1] }
if r.exit_code == 0
zuul_clone_cmd = '/usr/zuul-env/bin/zuul-cloner '
zuul_clone_cmd += '--cache-dir /opt/git '
zuul_clone_cmd += "--zuul-ref #{zuul_ref} "
zuul_clone_cmd += "--zuul-branch #{zuul_branch} "
zuul_clone_cmd += "--zuul-url #{zuul_url} "
zuul_clone_cmd += "https://git.openstack.org #{repo}"
on host, zuul_clone_cmd
else
on host, "git clone https://git.openstack.org/#{repo} -b stable/liberty #{repo}"
end
on host, "ZUUL_REF=#{zuul_ref} ZUUL_BRANCH=#{zuul_branch} ZUUL_URL=#{zuul_url} bash #{repo}/install_modules.sh"
# Install the module being tested
on host, "rm -fr /etc/puppet/modules/#{modname}"
puppet_module_install(:source => proj_root, :module_name => modname)
on host, "rm -fr #{repo}"
# List modules installed to help with debugging
on host, puppet('module','list'), { :acceptable_exit_codes => 0 }
end
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(:trove_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::Trove_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::Trove_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::Trove_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::Trove_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,57 +0,0 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/trove_datastore/trove'
provider_class = Puppet::Type.type(:trove_datastore).provider(:trove)
describe provider_class do
let :datastore_name do
'foo'
end
let :resource do
Puppet::Type::Trove_datastore.new({
:name => datastore_name,
:version => '0.1',
:ensure => 'present',
})
end
let :provider do
described_class.new(resource)
end
before :each do
described_class.stubs(:list_trove_resources).with('datastore').returns([
resource
])
end
describe "self.instances" do
it "should have an instances method" do
expect(provider.class).to respond_to(:instances)
end
it "should list instances" do
datastores = described_class.instances
expect(datastores.size).to eq(1)
datastores.map {|provider| provider.name} == datastore_name
end
end
describe '#create' do
it 'should call trove-manage' do
provider.expects(:trove_manage).with(
['trove-manage', 'datastore_update', datastore_name, "''"]
).returns(0)
provider.expects(:trove_manage).with(
['trove-manage', 'datastore_update', datastore_name, "0.1"]
).returns(0)
provider.create
end
end
end

View File

@ -1,50 +0,0 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/trove_datastore_version/trove'
provider_class = Puppet::Type.type(:trove_datastore_version).provider(:trove)
describe provider_class do
let :datastore_name do
'foo'
end
let :datastore_version do
'1.0'
end
let :resource do
Puppet::Type::Trove_datastore_version.new({
:name => datastore_version,
:ensure => 'present',
:datastore => datastore_name,
:manager => 'mysql',
:image_id => '1234',
:packages => 'mysql',
:active => 1
})
end
let :provider do
described_class.new(resource)
end
describe "self.instances" do
it "should have an instances method" do
expect(provider.class).to respond_to(:instances)
end
end
describe '#create' do
it 'should call trove-manage' do
provider.expects(:trove_manage).with(
['trove-manage', 'datastore_version_update', datastore_name, "1.0",
'mysql', '1234', 'mysql', '1']
).returns(0)
provider.create
end
end
end

View File

@ -1,14 +0,0 @@
require 'puppet'
require 'spec_helper'
require 'puppet/provider/trove'
klass = Puppet::Provider::Trove
describe Puppet::Provider::Trove do
after :each do
klass.reset
end
end

View File

@ -1,17 +0,0 @@
require 'puppet/type/trove_conductor_config'
describe 'Puppet::Type.type(:trove_conductor_config)' do
before :each do
@trove_conductor_config = Puppet::Type.type(:trove_conductor_config).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that installs the file' do
catalog = Puppet::Resource::Catalog.new
package = Puppet::Type.type(:package).new(:name => 'trove-conductor')
catalog.add_resource package, @trove_conductor_config
dependency = @trove_conductor_config.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@trove_conductor_config)
expect(dependency[0].source).to eq(package)
end
end

View File

@ -1,17 +0,0 @@
require 'puppet/type/trove_guestagent_config'
describe 'Puppet::Type.type(:trove_guestagent_config)' do
before :each do
@trove_guestagent_config = Puppet::Type.type(:trove_guestagent_config).new(:name => 'DEFAULT/foo', :value => 'bar')
end
it 'should autorequire the package that installs the file' do
catalog = Puppet::Resource::Catalog.new
package = Puppet::Type.type(:package).new(:name => 'trove-guestagent')
catalog.add_resource package, @trove_guestagent_config
dependency = @trove_guestagent_config.autorequire
expect(dependency.size).to eq(1)
expect(dependency[0].target).to eq(@trove_guestagent_config)
expect(dependency[0].source).to eq(package)
end
end

View File

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

View File

@ -1,117 +0,0 @@
[DEFAULT]
#=========== RPC Configuration ======================
# URL representing the messaging driver to use and its full configuration.
# If not set, we fall back to the 'rpc_backend' option and driver specific
# configuration.
#transport_url=<None>
# The messaging driver to use. Options include rabbit, qpid and zmq.
# Default is rabbit. (string value)
rpc_backend= <%= @rpc_backend %>
# The default exchange under which topics are scoped. May be
# overridden by an exchange name specified in the 'transport_url option.
control_exchange = <%= @control_exchange %>
# ========== Sample Logging Configuration ==========
# Show more verbose log output (sets INFO log level output)
verbose = <%= @verbose %>
# Show debugging output in logs (sets DEBUG log level output)
debug = <%= @debug %>
# Directory and path for log files
log_dir = <%= @log_dir %>
log_file = <%= @log_file %>
# ============ RabbitMQ connection options ========================
# The RabbitMQ broker address where a single node is used.
# (string value)
rabbit_host=<%= @rabbit_host %>
# The RabbitMQ broker port where a single node is used.
# (integer value)
rabbit_port=<%= @rabbit_port %>
# The RabbitMQ userid. (string value)
rabbit_userid=<%= @rabbit_userid %>
# The RabbitMQ password. (string value)
rabbit_password=<%= @rabbit_password %>
# The RabbitMQ virtual host. (string value)
rabbit_virtual_host=<%= @rabbit_virtual_host %>
# Path to the extensions
api_extensions_path = trove/extensions/routes
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
# It proxies the token received from the user to send to nova via this admin users creds,
# basically acting like the client via that proxy token.
trove_auth_url = <%= @auth_url %>
swift_url = <%= @swift_url %>
# Datastore management implementations. Format datastore:manager.impl
# datastore_registry_ext = mysql:trove.guestagent.datastore.mysql.manager.Manager, percona:trove.guestagent.datastore.mysql.manager.Manager
# Permissions to grant "root" user by default
root_grant = ALL
root_grant_option = True
#root_grant = ALTER ROUTINE, CREATE, ALTER, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, CREATE USER, DELETE, DROP, EVENT, EXECUTE, INDEX, INSERT, LOCK TABLES, PROCESS, REFERENCES, SELECT, SHOW DATABASES, SHOW VIEW, TRIGGER, UPDATE, USAGE
#root_grant_option = False
# used by passlib to generate root password
#default_password_length = 36
# Users to ignore for user create/list/delete operations
ignore_users = os_admin
# Databases to ignore for db create/list/delete operations
ignore_dbs = lost+found, mysql, information_schema
# ========== Default Storage Options for backup ==========
# Default configuration for storage strategy and storage options
# for backups
# Strategy information for backups
backup_namespace = trove.guestagent.strategies.backup.mysql_impl
# Additional commandline options to be passed to the backup runner (by strategy). For example:
# backup_runner_options = InnoBackupEx:--no-lock, MySQLDump:--events --routines --triggers
restore_namespace = trove.guestagent.strategies.restore.mysql_impl
storage_strategy = SwiftStorage
storage_namespace = trove.guestagent.strategies.storage.swift
backup_swift_container = database_backups
backup_use_gzip_compression = True
backup_use_openssl_encryption = True
backup_aes_cbc_key = "default_aes_cbc_key"
backup_use_snet = False
backup_chunk_size = 65536
backup_segment_max_size = 2147483648
# ========== Datastore Specific Configuration Options ==========
[mysql]
# For mysql, the following are the defaults for backup, and restore:
# backup_strategy = InnoBackupEx
# backup_namespace = trove.guestagent.strategies.backup.mysql_impl
# restore_namespace = trove.guestagent.strategies.restore.mysql_impl
# Default configuration for mysql replication
# replication_strategy = MysqlBinlogReplication
# replication_namespace = trove.guestagent.strategies.replication.mysql_binlog
# replication_user = slave_user
# replication_password = slave_password
[vertica]
# For vertica, following are the defaults needed:
# mount_point = /var/lib/vertica
# readahead_size = 2048
# guestagent_strategy = trove.common.strategies.cluster.experimental.vertica.guestagent.VerticaGuestAgentStrategy

View File

@ -1,264 +0,0 @@
# These tasks will be merged into deployment graph. Here you
# can specify new tasks for any roles, even built-in ones.
- id: primary-trove
type: group
role: [primary-trove]
requires: [deploy_start]
required_for: [deploy_end]
tasks: &common_tasks
- hiera
- setup_repositories
- fuel_pkgs
- globals
- tools
- logging
- netconfig
- hosts
- firewall
- ssl-keys-saving
- ssl-add-trust-chain
- ssl-dns-setup
parameters:
strategy:
type: one_by_one
- id: trove
type: group
role: [trove]
requires: [primary-trove]
required_for: [deploy_end]
tasks: *common_tasks
parameters:
strategy:
type: parallel
- id: hiera-trove-override
version: 2.0.0
type: puppet
groups: [primary-trove, trove]
requires: [globals]
required_for: [logging, trove-service]
cross-depends:
- name: globals
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/hiera_override.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-firewall
version: 2.0.0
type: puppet
groups: [primary-trove, trove]
requires: [hiera-trove-override, firewall]
required_for: [trove-cluster]
cross-depends:
- name: hiera-trove-override
- name: firewall
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/firewall.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
- id: trove-ssl-keys-saving
version: 2.0.0
type: puppet
role: ['/.*/']
requires: [trove-firewall, ssl-keys-saving]
cross-depends:
- name: trove-firewall
- name: ssl-keys-saving
condition: "(settings:public_ssl.horizon.value == true or settings:public_ssl.services.value == true) and settings:public_ssl.cert_source.value == 'user_uploaded'"
required_for: [deploy_end]
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/ssl_keys_saving.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
test_pre:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/ssl/ssl_keys_saving_pre.rb
- id: trove-ssl-add-trust-chain
type: puppet
version: 2.0.0
role: ['/.*/']
requires: [trove-firewall, trove-ssl-keys-saving]
cross-depends:
- name: trove-firewall
- name: trove-ssl-keys-saving
condition: "settings:public_ssl.horizon.value == true or settings:public_ssl.services.value == true"
required_for: [hosts]
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/ssl_add_trust_chain.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
test_pre:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/ssl/ssl_keys_saving_pre.rb
- id: trove-ssl-dns-setup
type: puppet
version: 2.0.0
groups: [primary-controller, controller]
requires: [trove-firewall, trove-ssl-add-trust-chain]
cross-depends:
- name: trove-firewall
- name: trove-ssl-add-trust-chain
condition: "settings:public_ssl.horizon.value == true or settings:public_ssl.services.value == true"
required_for: [hosts]
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/ssl_dns_setup.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: primary-trove-cluster
version: 2.0.0
type: puppet
groups: [primary-trove]
requires: [hosts, trove-firewall, hiera-trove-override]
required_for: [deploy_end]
cross-depends:
- name: hosts
- name: trove-firewall
- name: hiera-trove-override
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/cluster/cluster.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-cluster
version: 2.0.0
type: puppet
groups: [trove]
requires: [hosts, trove-firewall, hiera-trove-override, primary-trove-cluster]
required_for: [deploy_end]
cross-depends:
- name: hosts
- name: trove-firewall
- name: hiera-trove-override
- name: primary-trove-cluster
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/cluster/cluster.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: primary-trove-rabbitmq
version: 2.0.0
type: puppet
groups: [primary-trove]
requires: [trove-firewall, primary-trove-cluster, trove-cluster, hiera-trove-override]
required_for: [trove-service]
cross-depends:
- name: trove-firewall
- name: hiera-trove-override
- name: /(primary-)?trove-cluster/
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-rabbitmq
version: 2.0.0
type: puppet
groups: [trove]
requires: [trove-firewall, primary-trove-cluster, trove-cluster, hiera-trove-override, primary-trove-rabbitmq]
required_for: [trove-service]
cross-depends:
- name: trove-firewall
- name: hiera-trove-override
- name: /(primary-)?trove-cluster/
- name: primary-trove-rabbitmq
- name: trove-rabbitmq
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-db
version: 2.0.0
type: puppet
groups: [primary-controller]
requires: [primary-database, database]
required_for: [trove-service]
cross-depends:
- name: /(primary-)?database/
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/db.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 1800
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-keystone
version: 2.0.0
type: puppet
groups: [primary-controller]
requires: [primary-keystone, keystone]
required_for: [trove-service]
cross-depends:
- name: /(primary-)?keystone/
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/keystone.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 1800
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: openstack-haproxy-trove
type: puppet
version: 2.0.0
groups: [primary-controller, controller]
requires: [primary-cluster-haproxy, cluster-haproxy]
required_for: [trove-service]
cross-depends:
- name: /(primary-)?cluster-haproxy/
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/openstack-haproxy-trove.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 3600
# reexecute_on is needed for scale-down operations
reexecute_on:
- deploy_changes
- id: trove-service
version: 2.0.0
type: puppet
groups: [primary-trove, trove]
requires: [trove-rabbitmq, trove-db, trove-keystone, openstack-haproxy-trove]
required_for: [deploy_end]
cross-depends:
- name: /(primary-)?trove-rabbitmq/
- name: trove-db
- name: trove-keystone
- name: openstack-haproxy-trove
cross-depended-by:
- name: deploy_end
parameters:
puppet_manifest: puppet/modules/dbaas_trove/modular/trove.pp
puppet_modules: /etc/puppet/modules:puppet/modules
timeout: 1800

View File

@ -1,177 +0,0 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OpenStackTrovepluginforFuel.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/OpenStackTrovepluginforFuel.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/OpenStackTrovepluginforFuel"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/OpenStackTrovepluginforFuel"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

View File

@ -1,340 +0,0 @@
# -*- coding: utf-8 -*-
#
# OpenStack Trove plugin for Fuel documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 16 20:00:41 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
# 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 = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
]
# 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.
project = u'OpenStack Trove plugin for Fuel'
copyright = u'2016, AT&T Services, Inc.'
# 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 = '1.0-1.0.3-1'
# The full version, including alpha/beta/rc tags.
release = '1.0-1.0.3-1'
# 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 = 'sphinx'
# 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 = 'default'
# 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.
#html_last_updated_fmt = '%b %d, %Y'
# 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 = 'OpenStackTrovepluginforFueldoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
}
# 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', 'OpenStackTrovepluginforFuel.tex', u'OpenStack Trove plugin for Fuel Documentation',
u'AT\\&T Services, Inc.', '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', 'openstacktrovepluginforfuel', u'OpenStack Trove plugin for Fuel Documentation',
[u'AT&T Services, Inc.'], 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', 'OpenStackTrovepluginforFuel', u'OpenStack Trove plugin for Fuel Documentation',
u'AT&T Services, Inc.', 'OpenStackTrovepluginforFuel', '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 Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'OpenStack Trove plugin for Fuel'
epub_author = u'AT&T Services, Inc.'
epub_publisher = u'AT&T Services, Inc.'
epub_copyright = u'2016, AT&T Services, Inc.'
# The basename for the epub file. It defaults to the project name.
#epub_basename = u'OpenStack Trove plugin for Fuel'
# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
#epub_theme = 'epub'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
# Choose between 'default' and 'includehidden'.
#epub_tocscope = 'default'
# Fix unsupported image types using the PIL.
#epub_fix_images = False
# Scale large images.
#epub_max_image_width = 0
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#epub_show_urls = 'inline'
# If false, no index is generated.
#epub_use_index = True
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}

Some files were not shown because too many files have changed in this diff Show More