Initial upload; compatibility with MOS 6.1 and 7.0

Change-Id: If5c7349a6d134ce44606e099447dece4804231c0
This commit is contained in:
jfluhmann 2015-10-20 12:53:43 -05:00
parent 89183285ea
commit c30f4cc03b
49 changed files with 3675 additions and 0 deletions

202
LICENSE Normal file
View File

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

22
README.md Normal file
View File

@ -0,0 +1,22 @@
The Openbook Plugin
===================
This plugin extends Mirantis OpenStack functionality by adding Openbook customer
onboarding, self-service, and cloud billing / charge-back services. Openbook is
a fully-functional, simple to use cloud management solution that has been built
specifically for OpenStack. It allows users to measure, manage, and monetize
clouds built on OpenStack.
Requirements
++++++++++++
+----------------------------------+-------------------------------------------+
| Requirement | Version/Comment |
+==================================+===========================================+
| Mirantis OpenStack compatility | 6.1 or higher |
+----------------------------------+-------------------------------------------+
| Distribution Supported | Ubuntu |
+----------------------------------+-------------------------------------------+
| Talligent Sharefile access | Contact openbook@talligent.com for access |
+----------------------------------+-------------------------------------------+

View File

@ -0,0 +1,21 @@
# Copyright 2015 Talligent, 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.
$openbook = hiera('openbook')
# Check that JVM size doesn't exceed the physical RAM size
$jvmsize_mb = ($openbook['jvm_heap_size'] + 0.0) * 1024
if $jvmsize_mb >= $::memorysize_mb {
fail("The configured JVM size (${ $openbook['jvm_heap_size'] } GB) is greater than the total amount of RAM of the system (${ ::memorysize }).")
}

View File

@ -0,0 +1,22 @@
# Copyright 2015 Talligent, 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.
#
$openbook_hash = hiera('openbook')
if $openbook_hash['node_name'] == hiera('user_node_name') {
class {'openbook::db::mysql': } ->
class {'openbook::tomcat::server': }
}

View File

@ -0,0 +1,21 @@
# Copyright 2015 Talligent, 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.
notice('MODULAR: finalize.pp')
$openbook_hash = hiera('openbook')
if $openbook_hash['node_name'] == hiera('user_node_name') {
class {'openbook::finalize': }
}

View File

@ -0,0 +1,101 @@
# Copyright 2015 Talligent, 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.
$openbook_hash = hiera('openbook')
if $openbook_hash['node_name'] == hiera('user_node_name') {
notice('MODULAR: netconfig.pp')
$network_scheme = hiera('network_scheme')
class { 'l23network' :
use_ovs => hiera('use_neutron', false)
}
prepare_network_config($network_scheme)
$sdn = generate_network_config()
notify {'SDN': message => $sdn }
#Set arp_accept to 1 by default #lp1456272
sysctl::value { 'net.ipv4.conf.all.arp_accept': value => '1' }
sysctl::value { 'net.ipv4.conf.default.arp_accept': value => '1' }
# setting kernel reserved ports
# defaults are 49000,49001,35357,41055,41056,58882
class { 'openstack::reserved_ports': }
### TCP connections keepalives and failover related parameters ###
# configure TCP keepalive for host OS.
# Send 3 probes each 8 seconds, if the connection was idle
# for a 30 seconds. Consider it dead, if there was no responces
# during the check time frame, i.e. 30+3*8=54 seconds overall.
# (note: overall check time frame should be lower then
# nova_report_interval).
class { 'openstack::keepalive' :
tcpka_time => '30',
tcpka_probes => '8',
tcpka_intvl => '3',
tcp_retries2 => '5',
}
# increase network backlog for performance on fast networks
sysctl::value { 'net.core.netdev_max_backlog': value => '261144' }
L2_port<||> -> Sysfs_config_value<||>
L3_ifconfig<||> -> Sysfs_config_value<||>
L3_route<||> -> Sysfs_config_value<||>
class { 'sysfs' :}
if hiera('set_rps', true) {
sysfs_config_value { 'rps_cpus' :
ensure => 'present',
name => '/etc/sysfs.d/rps_cpus.conf',
value => cpu_affinity_hex($::processorcount),
sysfs => '/sys/class/net/*/queues/rx-*/rps_cpus',
exclude => '/sys/class/net/lo/*',
}
}
if hiera('set_xps', true) {
sysfs_config_value { 'xps_cpus' :
ensure => 'present',
name => '/etc/sysfs.d/xps_cpus.conf',
value => cpu_affinity_hex($::processorcount),
sysfs => '/sys/class/net/*/queues/tx-*/xps_cpus',
exclude => '/sys/class/net/lo/*',
}
}
if !defined(Package['irqbalance']) {
package { 'irqbalance':
ensure => installed,
}
}
if !defined(Service['irqbalance']) {
service { 'irqbalance':
ensure => running,
require => Package['irqbalance'],
}
}
# We need to wait at least 30 seconds for the bridges and other interfaces to
# come up after being created. This should allow for all interfaces to be up
# and ready for traffic before proceeding with further deploy steps. LP#1458954
exec { 'wait-for-interfaces':
path => '/usr/bin:/bin',
command => 'sleep 32',
require => Class['l23network'],
}
}

View File

@ -0,0 +1 @@
Jeremy Fluhmann <jeremy@talligent.com>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
#
# Copyright 2015 Talligent, 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.
#
class openbook::db::mysql {
include openbook::params
exec {'import mariadb repo key':
command => '/usr/bin/apt-key --keyring /etc/apt/trusted.gpg.d/mariadb.gpg adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db',
unless => '/usr/bin/test -f /etc/apt/trusted.gpg.d/mariadb.gpg'
}
file { 'mariadb.list':
path => '/etc/apt/sources.list.d/mariadb.list',
content => "deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu ${::lsbdistcodename} main",
}
exec { "mariadb update":
command => "/usr/bin/apt-get update",
subscribe => File['mariadb.list'],
refreshonly => true,
require => File['/etc/apt/sources.list.d/mariadb.list']
}
package { "$openbook::params::db_server_pkg":
ensure => present,
require => Exec['mariadb update']
}
package { "$openbook::params::db_client_pkg":
ensure => present,
require => Exec['mariadb update']
}
service { 'mysql':
ensure => running,
enable => true,
require => Package[$openbook::params::db_server_pkg]
}
file { '/tmp/openbook':
ensure => directory,
mode => '0755'
}
file { '/tmp/openbook/create_openbook_schemas.sql':
ensure => present,
require => File['/tmp/openbook'],
source => 'puppet:///modules/openbook/sql/create_openbook_schemas.sql'
}
exec{ 'openbook-schema-create':
command => "/usr/bin/mysql -p'${openbook::params::db_password}' < /tmp/openbook/create_openbook_schemas.sql && /usr/bin/touch /root/.schema.created",
logoutput => true,
unless => '/usr/bin/test -f /root/.schema.created',
require => [File['/tmp/openbook/create_openbook_schemas.sql'], Package[$openbook::params::db_server_pkg]]
}
file { '/root/.my.cnf':
ensure => 'present',
path => '/root/.my.cnf',
mode => '0400',
owner => 'root',
group => 'root',
content => template('openbook/root.my.cnf.erb'),
}
file { '/root/.password':
ensure => 'present',
path => '/root/.password',
mode => '0400',
owner => 'root',
group => 'root',
content => template('openbook/root.password.erb'),
}
exec { 'mysql_root_password':
subscribe => File['/root/.my.cnf'],
require => Service['mysql'],
path => '/bin:/sbin:/usr/bin:/usr/sbin',
refreshonly => true,
command => "mysql -u root --password='' < /root/.password"
}
}

View File

@ -0,0 +1,73 @@
# Copyright 2015 Talligent, 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.
class openbook::finalize {
$admin_settings = hiera('access')
$admin_username = $admin_settings['user']
$admin_password = $admin_settings['password']
$admin_tenant = $admin_settings['tenant']
$management_vip = hiera('management_vip')
$keystone_admin_url = "http://${management_vip}:35357/v2.0"
$os_auth_url = "http://${management_vip}:5000/v2.0"
$fuel_version = hiera('fuel_version')
case $fuel_version {
'6.1': {
$keystone_client = 'python-keystoneclient'
$keystone_command = 'keystone'
$keystone_args = 'tenant-get admin'
}
default: { # or '7.0'
$keystone_client = 'python-openstackclient'
$keystone_command = 'openstack'
$keystone_args = 'project show admin'
$public_ssl_hash = hiera('public_ssl')
$ip = hiera('public_vip')
# Need to add trust chain so that Openbook can talk to https endpoints
class { 'openbook::ssl_add_trust_chain': }
}
} ->
package { "$keystone_client":
ensure => present
}
file { "test_connectivity.sh":
path => '/tmp/test_connectivity.sh',
ensure => present,
content => template('openbook/test_connectivity.sh.erb')
}
file { "config_resource_manager.sh":
path => '/tmp/config_resource_manager.sh',
ensure => present,
content => template('openbook/config_resource_manager.sh.erb')
}
# Point Openbook at this OpenStack environment
exec { 'configure resource manager':
command => '/bin/bash /tmp/config_resource_manager.sh',
onlyif => '/bin/bash /tmp/test_connectivity.sh == *"200 OK"*',
creates => '/tmp/resource_manager_result.txt',
require => [ File['config_resource_manager.sh'], File['test_connectivity.sh'], Package[$keystone_client] ],
logoutput => true,
timeout => 900
}
}

View File

@ -0,0 +1,56 @@
#
# Copyright 2015 Talligent, 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.
#
class openbook::params {
$openstack_version = hiera('openstack_version')
$fuel_version = hiera('fuel_version')
$admin_settings = hiera('access')
$admin_username = $admin_settings['user']
$admin_password = $admin_settings['password']
$admin_tenant = $admin_settings['tenant']
$openbook = hiera('openbook')
$management_vip = hiera('management_vip')
$keystone_admin_url = "http://${management_vip}:35357/v2.0"
$os_auth_url = "http://${management_vip}:5000/v2.0"
$jvm_heap = $openbook['jvm_heap_size']
case $::operatingsystem {
'Ubuntu', 'Debian': {
$db_server_pkg = 'mariadb-server-10.0'
$db_client_pkg = 'mariadb-client-core-10.0'
$db_password = 'Tall!g3nt'
$app_server_pkg = 'tomcat7'
$openbook_version = '2.5.245'
$keystore_pass = 'rG8EE69CC0OuQKW+6pC6LytgRQM7QZUmt5CDySUgupY='
$ipaddress = $::ipaddress
$sharefile_hostname = 'talligent.sharefile.com'
$sharefile_username = $openbook['sharefile_user']
$sharefile_password = $openbook['sharefile_pass']
$sharefile_client_id = 'eC8y8eeoeunxzOizZq2oeknIVfA9Jyjg'
$sharefile_client_secret = 'PehmEqzEgKuGm2XOZWXIOUY3GyrKcfSmNtwPptPwt0tWxihs'
$sharefile_download_path = '/tmp/Openbook.zip'
}
default: {
fail("unsuported osfamily ${::osfamily}, currently Ubuntu is the only supported platform")
}
}
}

View File

@ -0,0 +1,57 @@
# Copyright 2015 Talligent, 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.
class openbook::ssl_add_trust_chain {
$public_ssl_hash = hiera('public_ssl')
$ip = hiera('public_vip')
case $::osfamily {
/(?i)redhat/: {
file { '/etc/pki/ca-trust/source/anchors/public_haproxy.pem':
ensure => 'link',
target => '/etc/pki/tls/certs/public_haproxy.pem',
}->
exec { 'enable_trust':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'update-ca-trust force-enable',
}->
exec { 'add_trust':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'update-ca-trust extract',
}
}
/(?i)debian/: {
file { '/usr/local/share/ca-certificates/public_haproxy.crt':
ensure => 'link',
target => '/etc/pki/tls/certs/public_haproxy.pem',
}->
exec { 'add_trust':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'update-ca-certificates',
}
}
default: {
fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
}
}
host { $public_ssl_hash['hostname']:
ensure => present,
ip => $ip,
}
}

View File

@ -0,0 +1,96 @@
#
# Copyright 2015 Talligent, 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.
#
class openbook::tomcat::server {
include openbook::params
$ipaddress = $::ipaddress
package { "$openbook::params::app_server_pkg":
ensure => present,
}
package { 'ntp':
ensure => present,
}
package { 'unzip':
ensure => present,
}
file { "sharefile_download.py":
path => '/tmp/sharefile_download.py',
ensure => present,
content => template('openbook/sharefile_download.py.erb'),
}
exec { 'download openbook':
command => '/usr/bin/python /tmp/sharefile_download.py',
unless => '/usr/bin/test -f /tmp/Openbook.war',
require => File['sharefile_download.py'],
timeout => 1200
}
exec { 'unzip openbook':
command => '/usr/bin/unzip -q /tmp/Openbook.zip -d /tmp/',
unless => '/usr/bin/test -d /tmp/Openbook-*',
require => [Exec['download openbook'], Package['unzip']]
}
file { 'openbook.properties':
path => '/var/lib/tomcat7/webapps/Openbook/WEB-INF/classes/openbook.properties',
ensure => present,
owner => 'tomcat7',
group => 'tomcat7',
content => template('openbook/openbook.properties.erb'),
require => Exec['deploy openbook'],
}
service{ 'tomcat7':
ensure => running,
enable => true,
require => Package[$openbook::params::app_server_pkg],
subscribe => File['openbook.properties']
}
exec{ 'deploy openbook':
command => "/usr/bin/unzip -q /tmp/Openbook-*/Openbook.war -d /var/lib/tomcat7/webapps/Openbook",
logoutput => true,
unless => '/usr/bin/test -d /var/lib/tomcat7/webapps/Openbook',
require => [Package['unzip'], Package[$openbook::params::app_server_pkg], Exec['unzip openbook']],
notify => Service['tomcat7']
}
exec{ 'keytool genkey':
command => "/usr/bin/keytool -genkey -keyalg RSA -alias tomcat -dname 'CN=talligent.net, O=Talligent, L=Austin, S=Texas, C=US' -keystore /etc/tomcat7/keystore.jks -storepass ${openbook::params::keystore_pass} -validity 360 -keysize 2048 -keypass ${openbook::params::keystore_pass}",
unless => '/usr/bin/test -f /etc/tomcat7/keystore.jks',
require => Package[$openbook::params::app_server_pkg],
notify => Service['tomcat7'],
}
file { 'server.xml':
path => '/var/lib/tomcat7/conf/server.xml',
ensure => present,
content => template('openbook/tomcat/server.xml.erb'),
require => Package[$openbook::params::app_server_pkg],
notify => Service['tomcat7'],
}
file { 'etc.default.tomcat7':
path => '/etc/default/tomcat7',
ensure => present,
content => template('openbook/tomcat/etc.default.tomcat7.erb'),
require => Package[$openbook::params::app_server_pkg],
notify => Service['tomcat7'],
}
}

View File

@ -0,0 +1,17 @@
dir = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift File.join(dir, 'lib')
require 'mocha'
require 'puppet'
require 'rspec'
require 'spec/autorun'
Spec::Runner.configure do |config|
config.mock_with :mocha
end
# We need this because the RAL uses 'should' as a method. This
# allows us the same behaviour but with a different method name.
class Object
alias :must :should
end

View File

@ -0,0 +1,51 @@
#!/bin/bash
KEYSTONE_COMMAND="<%= @keystone_command %> --os-username <%= @admin_username %> --os-password <%= @admin_password %> --os-tenant-name <%= @admin_tenant %> --os-auth-url <%= @os_auth_url %>"
KEYSTONE_ARGS=' <%= @keystone_args %>'
TENANT_ID=$($KEYSTONE_COMMAND $KEYSTONE_ARGS | grep id | awk -F\| '{print $3}' | cut -d ' ' -f2)
read -d '' METADATA <<EOF
metadata={
"resourceSyncEnabled": "true",
"resourceSyncFrequency": "5",
"associatedProvider": "1",
"periodicFullSyncEnabled": false,
"periodicFullSyncInterval": "24",
"connectionParams": {
"connectionUrl": "<%= @keystone_admin_url %>",
"userName": "<%= @admin_username %>",
"adminTenantId": "$TENANT_ID",
"password": "<%= @admin_password %>",
"isMemberOfAllProjects": false
},
"usageMetrics": [
],
"tenantsToIgnore": "",
"regionsToSync": "RegionOne",
"entitiesToSync": [
"Floating IP",
"Instance",
"Network",
"Port",
"Router",
"Subnet",
"Volume",
"Image",
"Load Balancer VIP",
"Firewall"
]
}
EOF
RESULT=$(curl -s -k --user 'openbook:Tall!g3nt' -XPOST -D - 'https://<%= @ipaddress %>:8443/Openbook/resource/resourcemanagers' -H 'Content-Type: application/x-www-form-urlencoded' -d 'name=MOS Environment' -d 'description=Mirantis OpenStack Environment' -d 'vendorType=OpenStack' --data-urlencode "$METADATA")
echo "$RESULT" >> /tmp/resource_manager_result.txt
if [[ "$RESULT" == *"201 Created"* ]]; then
exit
else
echo "Something went wrong with creating the resource manager. Check /tmp/resource_manager_results.txt and tomcat logs"
fi

View File

@ -0,0 +1,48 @@
ROOT_PROVIDER_PUBLIC_URL = https://<%= @ipaddress %>:8443
DB_USER = openbook
DB_PASSWORD = Tall!g3nt
DB_ENTITY_HOST = 127.0.0.1
DB_ENTITY_PORT = 3306
DB_ENTITY_DATABASE = openbook
DB_WORKFLOW_HOST = 127.0.0.1
DB_WORKFLOW_PORT = 3306
DB_WORKFLOW_DATABASE = openbook_workflow
DB_JOBS_HOST = 127.0.0.1
DB_JOBS_PORT = 3306
DB_JOBS_DATABASE = openbook_jobs
DOJO_HOME = ../static/lib/dojo-release-1.9.5
APPLICATION_CONTEXT_ROOT = Openbook
MAIL_LOG_ALL_OUTGOING = false
LICENSE_KEY = 507dd92ddc7b080fdafcd08328ac23451fd065adf7563883b5034c3cd982f49c25fa955751b2dd71dfd1fdd34770055f665485d1385a7af58a74bbde6c36732f
DEFAULT_CURRENCY = USD
DEFAULT_TAX_RATE = 0
DEFAULTS_BY_COUNTRY = {"ZA":{"taxRate":"14","currency":"ZAR"}}
DEFAULT_BILLING_FREQUENCY = Monthly
DEFAULT_BILL_DATE = LAST_DAY_OF_MONTH
DEFAULT_DATE_PATTERN = MMM d yyyy
INACTIVE_REGISTRANT_DELETE_AFTER_HOUR = 0
PASSWORD_CHANGE_TOKEN_VALID_FOR_HOUR = 72
METRICS_DELETE_AFTER_DAYS = 60
EVENTS_DELETE_AFTER_DAYS = 90
DEPROVISIONED_ENTITIES_DELETE_AFTER_DAYS = 365
JOB_STATUS_DELETE_AFTER_DAYS = 60
OPENSTACK_ADMIN_IS_MEMBER_OF_ALL_TENANTS = false
OPENSTACK_MEMBER_ROLE_NAME = _member_
OPENSTACK_PROTECTED_TENANTS = admin, services, demo
SPLA_REPORT_IMAGE_LIST = cirros:6b761277-e919-4c95-baa4-32b2175a44a5, fedora:61e4f65a-bcfb-4d46-afe6-004c061bc052
AAA_MAX_FAILED_LOGIN_ATTEMPTS = 5
AAA_FAILED_LOGIN_LOCKOUT_SECONDS = 120
PASSWORD_RULES_HELP_TEXT=Must be at least 8 characters long.<br/>\
Must contain at least 1 alphabetic character.<br/>\
Must contain at least 1 numeric character.<br/>\
Must contain at least 1 special character.<br/>\
Must not contain whitespace.<br/>\
Must not be the same as your username.<br/><br/>

View File

@ -0,0 +1,5 @@
# File Managed by Puppet
[client]
password=<%= scope.lookupvar('openbook::params::db_password') %>

View File

@ -0,0 +1,2 @@
UPDATE mysql.user SET password = PASSWORD('<%= scope.lookupvar("openbook::params::db_password") %>') WHERE user = 'root';
flush privileges

View File

@ -0,0 +1,129 @@
import json
import httplib
import os
import urlparse
import urllib
"""
Copyright (c) 2014 Citrix Systems, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
"""
"""
This script is a modified version of a Citrix example for interacting with
the Sharefile API. It is used here to allow authentication with Sharefile
to download the latest Openbook package.
"""
def authenticate(hostname, client_id, client_secret, username, password):
""" Authenticate via username/password. Returns json token object.
Args:
string hostname - hostname like "myaccount.sharefile.com"
string client_id - OAuth2 client_id key
string client_secret - OAuth2 client_secret key
string username - my@user.name
string password - my password """
uri_path = '/oauth/token'
headers = {'Content-Type':'application/x-www-form-urlencoded'}
params = {'grant_type':'password', 'client_id':client_id, 'client_secret':client_secret,
'username':username, 'password':password}
http = httplib.HTTPSConnection(hostname)
http.request('POST', uri_path, urllib.urlencode(params), headers=headers)
response = http.getresponse()
print response.status, response.reason
token = None
if response.status == 200:
token = json.loads(response.read())
http.close()
return token
def get_authorization_header(token):
return {'Authorization':'Bearer %s'%(token['access_token'])}
def get_hostname(token):
return '%s.sf-api.com'%(token['subdomain'])
def query(token, search_term):
""" Performs a simple search based on a search term. Returns the item id.
Args:
dict json token acquired from authenticate function
string search_term - the term to search"""
uri_path = '/sf/v3/Items/Search?query=%s'%(search_term)
print 'GET %s%s'%(get_hostname(token), uri_path)
http = httplib.HTTPSConnection(get_hostname(token))
http.request('GET', uri_path, headers=get_authorization_header(token))
response = http.getresponse()
results = json.loads(response.read())
return results['Results'][0]['ItemID']
def download_item(token, item_id, local_path):
""" Downloads a single Item. If downloading a folder the local_path name should end in .zip.
Args:
dict json token acquired from authenticate function
string item_id - the id of the item to download
string local_path - where to download the item to, like "c:\\path\\to\\the.file" """
uri_path = '/sf/v3/Items(%s)/Download'%(item_id)
print 'GET %s%s'%(get_hostname(token), uri_path)
http = httplib.HTTPSConnection(get_hostname(token))
http.request('GET', uri_path, headers=get_authorization_header(token))
response = http.getresponse()
location = response.getheader('location')
redirect = None
if location:
redirect_uri = urlparse.urlparse(location)
redirect = httplib.HTTPSConnection(redirect_uri.netloc)
redirect.request('GET', '%s?%s'%(redirect_uri.path, redirect_uri.query))
response = redirect.getresponse()
with open(local_path, 'wb') as target:
b = response.read(1024*8)
while b:
target.write(b)
b = response.read(1024*8)
print response.status, response.reason
http.close()
if redirect:
redirect.close()
if __name__ == '__main__':
hostname = '<%= scope.lookupvar("openbook::params::sharefile_hostname") %>'
username = '<%= scope.lookupvar("openbook::params::sharefile_username") %>'
password = '<%= scope.lookupvar("openbook::params::sharefile_password") %>'
client_id = '<%= scope.lookupvar("openbook::params::sharefile_client_id") %>'
client_secret = '<%= scope.lookupvar("openbook::params::sharefile_client_secret") %>'
download_path = '<%= scope.lookupvar("openbook::params::sharefile_download_path") %>'
token = authenticate(hostname, client_id, client_secret, username, password)
download_item(token, query(token, 'zip'), download_path)

View File

@ -0,0 +1,11 @@
#!/bin/bash
KEYSTONE_COMMAND="<%= @keystone_command %> --os-username <%= @admin_username %> --os-password <%= @admin_password %> --os-tenant-name <%= @admin_tenant %> --os-auth-url <%= @os_auth_url %>"
KEYSTONE_ARGS=' <%= @keystone_args %>'
TENANT_ID=$($KEYSTONE_COMMAND $KEYSTONE_ARGS | grep id | awk -F\| '{print $3}' | cut -d ' ' -f2)
RESULT=$(curl -s -k --user 'openbook:Tall!g3nt' -D - https://<%= @ipaddress %>:8443/Openbook/resource/resourcemanagers/testconnection/OpenStack -H "Content-Type: application/x-www-form-urlencoded" -H "X-Connection-Details: {'connectionUrl':'<%= @keystone_admin_url %>','userName':'<%= @admin_username %>','adminTenantId':'$TENANT_ID','password':'<%= @admin_password %>'}")
echo "$RESULT" >> /tmp/connectivity-test-result.txt

View File

@ -0,0 +1,47 @@
# Run Tomcat as this user ID. Not setting this or leaving it blank will use the
# default of tomcat7.
TOMCAT7_USER=tomcat7
# Run Tomcat as this group ID. Not setting this or leaving it blank will use
# the default of tomcat7.
TOMCAT7_GROUP=tomcat7
# The home directory of the Java development kit (JDK). You need at least
# JDK version 1.5. If JAVA_HOME is not set, some common directories for
# OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried.
#JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk
# You may pass JVM startup parameters to Java here. If unset, the default
# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
#
# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
# response time). If you use that option and you run Tomcat on a machine with
# exactly one CPU chip that contains one or two cores, you should also add
# the "-XX:+CMSIncrementalMode" option.
JAVA_OPTS="-Djava.awt.headless=true -Xmx<%= scope.lookupvar("openbook::params::jvm_heap") %>G -XX:+UseConcMarkSweepGC -Djsse.enableSNIExtension=false -Djava.security.egd=file:/dev/urandom"
# To enable remote debugging uncomment the following line.
# You will then be able to use a java debugger on port 8000.
#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
# Java compiler to use for translating JavaServer Pages (JSPs). You can use all
# compilers that are accepted by Ant's build.compiler property.
#JSP_COMPILER=javac
# Use the Java security manager? (yes/no, default: no)
#TOMCAT7_SECURITY=no
# Number of days to keep logfiles in /var/log/tomcat7. Default is 14 days.
#LOGFILE_DAYS=14
# Whether to compress logfiles older than today's
#LOGFILE_COMPRESS=1
# Location of the JVM temporary directory
# WARNING: This directory will be destroyed and recreated at every startup !
#JVM_TMP=/tmp/tomcat7-temp
# If you run Tomcat on port numbers that are all higher than 1023, then you
# do not need authbind. It is used for binding Tomcat to lower port numbers.
# NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
# (yes/no, default: no)
#AUTHBIND=no

View File

@ -0,0 +1,147 @@
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<!--
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
-->
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation -->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="/etc/tomcat7/keystore.jks"
keystorePass="<%= scope.lookupvar("openbook::params::keystore_pass") %>"
clientAuth="false" sslProtocol="TLS" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>
</Engine>
</Service>
</Server>

View File

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

9
deployment_tasks.yaml Normal file
View File

@ -0,0 +1,9 @@
- id: openbook
type: group
role: [openbook]
tasks:
- hiera
- globals
- netconfig
required_for: [deploy_end]
requires: [deploy_start]

177
doc/Makefile Normal file
View File

@ -0,0 +1,177 @@
# 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/fuel-plugin-openbook.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/fuel-plugin-openbook.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/fuel-plugin-openbook"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/fuel-plugin-openbook"
@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.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

331
doc/source/conf.py Normal file
View File

@ -0,0 +1,331 @@
# -*- coding: utf-8 -*-
#
# fuel-plugin-openbook documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 7 12:48:35 2015.
#
# 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.todo',
# 'sphinx.ext.coverage',
]
# 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'fuel-plugin-openbook'
copyright = u'2015, Talligent 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'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
# 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 = 'fuel-plugin-openbookdoc'
# -- 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', 'fuel-plugin-openbook.tex', u'fuel-plugin-openbook Documentation',
u'Talligent 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', 'fuel-plugin-openbook', u'fuel-plugin-openbook Documentation',
[u'Talligent 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', 'fuel-plugin-openbook', u'fuel-plugin-openbook Documentation',
u'Talligent Inc.', 'fuel-plugin-openbook', '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'fuel-plugin-openbook'
epub_author = u'Talligent Inc.'
epub_publisher = u'Talligent Inc.'
epub_copyright = u'2015, Talligent Inc.'
# The basename for the epub file. It defaults to the project name.
#epub_basename = u'fuel-plugin-openbook'
# 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

90
doc/source/guide.rst Normal file
View File

@ -0,0 +1,90 @@
User Guide
==========
Intro
+++++
`Contact Talligent <mailto:openbook@talligent.com>`_ to get access to the
Talligent Sharefile account for downloading Openbook and the Openbook User Guide.
#. `Create a new environment <https://docs.mirantis.com/openstack/fuel/fuel-7.0/user-guide.html#launch-wizard-to-create-new-environment>`_
with the Fuel UI wizard. At the moment only the Ubuntu distribution is supported.
* When stepping through the 'new OpenStack environment' wizard, be sure to enable
Ceilometer in the Additonal Services section. Openbook relies on various endpoints
for data, one of which is Ceilometer.
.. image:: _static/ceilometer-select_s.png
:alt: A screenshot of the Install Ceilometer step
- Click on the Settings tab of the Fuel web UI.
For fuel version 7.0: select the "Openbook Plugin" tab, enable
the plugin by clicking on the “Openbook Plugin” checkbox and
fill-in the required fields:
.. image:: _static/plugin-openbook-config_s.png
:alt: A screenshot of the Openbook Plugin settings UI for 7.0
:scale: 90%
For fuel version 6.1: scroll down the page, select the Openbook Plugin
check-box and fill-in the required fields:
.. image:: _static/plugin-openbook-config-61.png
:alt: A screenshot of the Openbook Plugin settings UI for 6.1
:scale: 90%
**NOTE:** The Sharefile Username will be your e-mail and the password will be the one you setup
when you received the e-mail about your Sharefile account being created. If you do not
have Sharefile access to Talligent, please contact openbook@talligent.com.
- Click *Save Settings* at the bottome of the page to save the configuration parameters.
- Switch to the *Nodes* tab.
- After `adding all OpenStack nodes/roles <https://docs.mirantis.com/openstack/fuel/fuel-7.0/user-guide.html#add-nodes-ug>`_
, add a base-os node and rename the base-os host as "openbook":
.. image:: _static/openbook-node.png
:alt: A screenshot of the Openbook host name
:scale: 90%
- Select the *Networks* tab, scroll to the bottom, and `Verify Networks <https://docs.mirantis.com/openstack/fuel/fuel-7.0/user-guide.html#verify-networks>`_.
- Then finally, `Deploy Changes <https://docs.mirantis.com/openstack/fuel/fuel-7.0/user-guide.html#deploy-changes>`_
Plugin Install Verification
+++++++++++++++++++++++++++
Once the deployment is finished, the notification icon will show there to be a new notification message.
.. image:: _static/deploy-finished-notification.png
:alt: A screenshot of the notification icon with a message count
:scale: 90%
When clicking the notification icon, there will be a message stating that the plugin is deployed and
will give the URL schema for accessing the Openbook UI.
.. image:: _static/deployment-finished.png
:alt: A screenshot of the "deployment finished" notification message
:scale: 90%
Use the fuel command line to retrieve the IP address of the openbook node.
.. code:: bash
[root@fuel ~]# fuel nodes
id | status | name | cluster | ip | [..] | roles | [..]
---|----------|------------------|---------|-----------|------|-------------------|------
2 | ready | Untitled (84:d2) | 2 | 10.20.0.4 | | cinder, compute |
1 | ready | Untitled (54:19) | 2 | 10.20.0.3 | | controller, mongo |
3 | ready | openbook | 2 | 10.20.0.5 | | base-os |
.. | ..... | ................ | ... | ......... | | ............... |
In this example, the Openbook UI would be accessed at ``https://10.20.0.5:8443/Openbook``

24
doc/source/index.rst Normal file
View File

@ -0,0 +1,24 @@
.. fuel-plugin-openbook documentation master file, created by
sphinx-quickstart on Wed Oct 7 12:48:35 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to fuel-plugin-openbook's documentation!
================================================
Contents:
.. toctree::
:maxdepth: 2
overview
installation
guide
Indices and tables
==================
* :ref:`search`

View File

@ -0,0 +1,57 @@
Installation
============
Where to download the plugin
++++++++++++++++++++++++++++
The plugin in not yet distribuited as package. You have to build it
yourself.
The code is hosted on `github openstack`_.
How to build the plugin
+++++++++++++++++++++++
Please refer to the `Fuel Plugins wiki`_ to build the plugin
by yourself, version 2.0.0 (or higher) of the Fuel Plugin Builder is
required.
.. code:: bash
git clone https://github.com/openstack/fuel-plugin-openbook.git
fpb --build fuel-plugin-openbook
How to install the plugin
+++++++++++++++++++++++++
Copy the plugin file to the Fuel Master node.
.. code:: bash
cd fuel-plugin-openbook
scp fuel-plugin-openbook*rpm root@<Fuel Master node IP address>:
Install the plugin using the fuel command line:
.. code:: bash
ssh root@<Fuel Master node IP address>
fuel plugins --install fuel-plugin-openbook*.rpm
Verify that the plugin is installed correctly:
.. code:: bash
[root@fuel ~]# fuel plugins --list
id | name | version | package_version
---|----------------------|---------|----------------
2 | fuel-plugin-openbook | 1.0.0 | 2.0.0
**********
References
**********
.. target-notes::
.. _github openstack: https://github.com/openstack/fuel-plugin-openbook
.. _Fuel Plugins wiki: https://wiki.openstack.org/wiki/Fuel/Plugins

22
doc/source/overview.rst Normal file
View File

@ -0,0 +1,22 @@
The Openbook Plugin
===================
This plugin extends Mirantis OpenStack functionality by adding Openbook customer
onboarding, self-service, and cloud billing / charge-back services. Openbook is
a fully-functional, simple to use cloud management solution that has been built
specifically for OpenStack. It allows users to measure, manage, and monetize
clouds built on OpenStack.
Requirements
++++++++++++
+----------------------------------+-------------------------------------------+
| Requirement | Version/Comment |
+==================================+===========================================+
| Mirantis OpenStack compatility | 6.1 or higher |
+----------------------------------+-------------------------------------------+
| Distribution Supported | Ubuntu |
+----------------------------------+-------------------------------------------+
| Talligent Sharefile access | Contact openbook@talligent.com for access |
+----------------------------------+-------------------------------------------+

57
environment_config.yaml Normal file
View File

@ -0,0 +1,57 @@
attributes:
metadata:
restrictions:
- condition: "settings:additional_components.ceilometer.value == false"
strict: true
message: "Ceilometer (OpenStack Telemetry) is required and must be enabled in the environment"
action: "disable"
openbook_text:
value: 'Openbook Fuel Plugin'
label: 'Openbook plugin'
description: 'Deploys Openbook for billing/invoicing and customer lifecycle management for OpenStack'
weight: 25
type: "text"
db_password:
value: "Tall!g3nt"
label: "database password"
description: "Password for MariaDB"
weight: 30
type: "password"
node_name:
value: 'openbook'
label: 'Node name'
description: 'The name of the node where the plugin will be deployed.'
weight: 10
type: "text"
sharefile_user:
type: "text"
weight: 50
value: ""
label: "Sharefile Username (e-mail)"
description: "Sharefile username is required to download Openbook"
regex: &email
source: '[a-z0-9!#$%&*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.?)?[a-z0-9]?(?:[a-z0-9-]*[a-z0-9])?'
error: "Invalid email address"
sharefile_pass:
type: "password"
weight: 51
value: ""
label: "Sharefile Password"
description: "Sharefile password is required to download Openbook"
regex: &not_empty_parameter
source: '\S'
error: "Invalid value"
jvm_heap_size:
value: '1'
label: 'JVM heap size'
description: 'in GB (between 1 and 32). The amount of memory reserved for the JVM.'
weight: 100
type: "text"
regex:
source: '^([1-9]|[12][0-9]|3[0-2])$'
error: 'Enter a value between 1 and 32'

48
functions.sh Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# Copyright 2015 Mirantis, 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.
set -eux
ROOT="$(dirname "$(readlink -f "$0")")"
MODULES_DIR="${ROOT}"/deployment_scripts/puppet/modules
RPM_REPO="${ROOT}"/repositories/centos/
DEB_REPO="${ROOT}"/repositories/ubuntu/
# Download RPM or DEB packages and store them in the local repository directory
function download_package {
while [ $# -gt 0 ]; do
if [[ "$1" == *.deb ]]; then
REPO=$DEB_REPO
elif [[ "$1" == *.rpm ]]; then
REPO=$RPM_REPO
else
echo "Invalid URL for download_package(): $1"
fi
FILE=$(basename "$1")
if [ ! -f "$REPO"/"$FILE" ]; then
wget -qO - "$1" > "$REPO"/"$FILE"
fi
shift
done
}
# Download official Puppet module and store it in the local directory
function download_puppet_module {
rm -rf "${MODULES_DIR:?}"/"$1"
mkdir -p "${MODULES_DIR}"/"$1"
wget -qO- "$2" | tar -C "${MODULES_DIR}/$1" --strip-components=1 -xz
}

27
metadata.yaml Normal file
View File

@ -0,0 +1,27 @@
# Plugin name
name: openbook
title: Openbook Plugin
version: '1.0.0'
description: Deploys Openbook for billing/invoicing and customer lifecycle management for OpenStack. Openbook URL schema is https://<VIP>:8443/Openbook
fuel_version: ['6.1', '7.0']
licenses: ['Apache License Version 2.0']
authors: ['Talligent Inc.']
homepage: 'https://github.com/openstack/fuel-plugin-openbook'
groups: ['monitoring']
# The plugin is compatible with releases in the list
releases:
- os: ubuntu
version: 2015.1.0-7.0
mode: ['ha']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
- os: ubuntu
version: 2014.2-6.1
mode: ['ha', 'multinode']
deployment_scripts_path: deployment_scripts/
repository_path: repositories/ubuntu
# Version of plugin package
package_version: '2.0.0'

14
network_roles.yaml Normal file
View File

@ -0,0 +1,14 @@
# Unique network role name
- id: "openbook"
# Role mapping to network
default_mapping: "management"
properties:
# Should be true if network role requires subnet being set
subnet: true
# Should be true if network role requires gateway being set
gateway: false
vip:
- name: "openbook_vip_public"
namespace: "haproxy"
node_roles: ["base-os"]

66
pre_build_hook Executable file
View File

@ -0,0 +1,66 @@
#!/bin/bash
set -eux
. "$(dirname "$(readlink -f "$0")")"/functions.sh
# Packages needed for MariaDB
download_package http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mysql-common_10.0.21+maria-1~trusty_all.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-common_10.0.21+maria-1~trusty_all.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/libmariadbclient18_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/libmysqlclient18_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-client-core-10.0_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-client-10.0_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-server-core-10.0_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-server-10.0_10.0.21+maria-1~trusty_amd64.deb \
http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu/pool/main/m/mariadb-10.0/mariadb-server_10.0.21+maria-1~trusty_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/liba/libaio/libaio1_0.3.109-4_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/r/readline5/libreadline5_5.2+dfsg-2_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libd/libdbi-perl/libdbi-perl_1.630-1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libd/libdbd-mysql-perl/libdbd-mysql-perl_4.025-1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libh/libhtml-template-perl/libhtml-template-perl_2.95-1_all.deb
# Packages needed for Tomcat
download_package http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/liba/libasyncns/libasyncns0_0.8-4ubuntu2_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common-data_0.6.31-4ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common3_0.6.31-4ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-client3_0.6.31-4ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.6_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libo/libogg/libogg0_1.3.1-1ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/f/flac/libflac8_1.3.0-2ubuntu0.14.04.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu-core_2.34-1ubuntu1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.11.0-0ubuntu4.1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.11.0-0ubuntu4.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.3.0-0ubuntu2_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/l/lcms2/liblcms2-2_2.5-0ubuntu4_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/n/nspr/libnspr4_4.10.7-0ubuntu0.14.04.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3-nssdb_3.19.2-0ubuntu0.14.04.1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.19.2-0ubuntu0.14.04.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/p/pcsc-lite/libpcsclite1_1.8.10-1ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbis0a_1.3.2-1.3ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbisenc2_1.3.2-1.3ubuntu1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libs/libsndfile/libsndfile1_1.0.25-7ubuntu2_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/libpulse0_4.0-0ubuntu11.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/j/java-common/java-common_0.51_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/j/java-common/default-jre-headless_1.7-51_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_2015f-0ubuntu0.14.04_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_2015f-0ubuntu0.14.04_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u79-2.5.6-0ubuntu1.14.04.1_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libc/libcommons-collections3-java/libcommons-collections3-java_3.2.1-6_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/c/commons-pool/libcommons-pool-java_1.6-2_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/libc/libcommons-dbcp-java/libcommons-dbcp-java_1.4-3ubuntu1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/e/ecj/libecj-java_3.9.0-1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/g/geronimo-jta-1.1-spec/libgeronimo-jta-1.1-spec-java_1.1.1-3ubuntu1_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tomcat7/libservlet3.0-java_7.0.52-1ubuntu0.3_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tomcat7/libtomcat7-java_7.0.52-1ubuntu0.3_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tomcat7/tomcat7-common_7.0.52-1ubuntu0.3_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/t/tomcat7/tomcat7_7.0.52-1ubuntu0.3_all.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/a/authbind/authbind_2.1.1_amd64.deb
# Additional dependencies
download_package http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/a/autogen/libopts25_5.18-2ubuntu2_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/n/ntp/ntp_4.2.6.p5+dfsg-3ubuntu2.14.04.3_amd64.deb \
http://nova.clouds.archive.ubuntu.com/ubuntu/pool/main/u/unzip/unzip_6.0-9ubuntu1.3_amd64.deb

View File

View File

127
spec/openbook-plugin.rst Normal file
View File

@ -0,0 +1,127 @@
************************************************************
Guide to the Openbook Plugin version 1.0 for Fuel
************************************************************
This document provides instructions for installing, configuring and using
Openbook plugin for Fuel.
# As Plugin Guide can have detailed instructions, make a separate file from every
# section below and add them using 'include'. For example files
# structure scheme, see https://wiki.openstack.org/wiki/Fuel/Plugins#Documentation_files_structure
Key terms, acronyms and abbreviations
=====================================
Term1
Provides ....
Abbreviation1
Provides ....
<Plugin name>
=============
Provide common information about the plugin (what functionality it
provides, what component it extends). You can also add schemes with
a detailed explanation of plugin architecture.
License
-------
If your plugin contains any components,
please provide the list of those with licenses.
If no extra components are present (e.g. like in VPNaaS plugin),
provide a short note (like No components are present).
======================= ==================
Component License type
======================= ==================
Component1
Component2
============================================
Requirements
------------
======================= ==================
Requirement Version/Comment
======================= ==================
Fuel 6.x
Component1
Component2
============================================
Limitations
-----------
Provide information about requirements
(for example, what component version is supported, what software
dependencies, hardware and resources like disk space and CPU are required).
Installation Guide
==================
Provide step-by-step instructions for plugin installation.
If plugin requires pre-installation steps like backend configuration,
you should also add this information here.
<Plugin name> backend configuration
-----------------------------------
To configure <name> backend, follow these steps:
#. Do <>.
#. Configure <>.
<Plugin name> installation
--------------------------
To install <plugin name> plugin, follow these steps:
#. Do <>.
#. Configure <>.
User Guide
==========
Provide instructions for using and operating this plugin,
including commands and their output, logs and troubleshooting
information.
How to <>
---------
To <>, follow these steps:
#. ...
#. ...
How to <>
---------
To <>, follow these steps:
#. ...
#. ...
Known issues
============
If present, provide information about known
issues and workarounds. You can also add links to LaunchPad under each issue.
Appendix
========
Provide any links to external resources or documentation here.
#. Link 1
#. Link 2

30
tasks.yaml Normal file
View File

@ -0,0 +1,30 @@
- role: ['base-os']
stage: post_deployment/8000
type: puppet
parameters:
puppet_manifest: puppet/manifests/check_environment_configuration.pp
puppet_modules: puppet/modules
timeout: 300
- role: ['base-os']
stage: post_deployment/8100
type: puppet
parameters:
puppet_manifest: puppet/manifests/netconfig.pp
puppet_modules: /etc/puppet/modules
timeout: 720
- role: ['base-os']
stage: post_deployment/8900
type: puppet
parameters:
puppet_manifest: puppet/manifests/deploy.pp
puppet_modules: puppet/modules
timeout: 1500
- role: ['base-os']
stage: post_deployment/8900
type: puppet
parameters:
puppet_manifest: puppet/manifests/finalize.pp
puppet_modules: puppet/modules
timeout: 300