summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaik Apsar <sa709c@intl.att.com>2016-07-11 20:28:09 +0000
committerShaik Apsar <sa709c@intl.att.com>2016-08-31 02:46:51 +0000
commit1324103e272705dbb86638fbda0ce533cabd2e0c (patch)
tree9c81eadcd71121aea57dfd6c78b5fbb501f61a06
parentc0aace5e4ac5133025bff0c49bb168703c8a2574 (diff)
Trove Fuel Plugin update for OpenStack Fuel 8.0 release.
Notes
Notes (review): Code-Review+1: Pundaleek P Belamge <Pundaleek.Belamge@intl.att.com> Code-Review+1: Venkata Mahesh Jonnalagadda <Venkata.Jonnalagadda@intl.att.com> Code-Review+2: Bhaskar Duvvuri <bhaskara.duvvuri@intl.att.com> Workflow+1: Bhaskar Duvvuri <bhaskara.duvvuri@intl.att.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 05 Oct 2016 14:32:19 +0000 Reviewed-on: https://review.openstack.org/327261 Project: openstack/fuel-plugin-dbaas-trove Branch: refs/heads/master
-rw-r--r--.gitignore6
-rw-r--r--components.yaml8
-rw-r--r--deployment_scripts/puppet/manifests/cluster.pp50
-rw-r--r--deployment_scripts/puppet/manifests/db.pp53
-rw-r--r--deployment_scripts/puppet/manifests/haproxy.pp48
-rw-r--r--deployment_scripts/puppet/manifests/keystone.pp44
-rw-r--r--deployment_scripts/puppet/manifests/rabbitmq.pp147
-rw-r--r--deployment_scripts/puppet/manifests/trove.pp92
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/db.pp71
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/firewall.pp107
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/hiera_override.pp103
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/keystone.pp74
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/openstack_haproxy_trove.pp103
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_add_trust_chain.pp103
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_dns_setup.pp126
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_keys_saving.pp98
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/manifests/trove.pp177
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/db.pp9
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/firewall.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/hiera_override.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/keystone.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/openstack-haproxy-trove.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_add_trust_chain.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_dns_setup.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_keys_saving.pp1
-rw-r--r--deployment_scripts/puppet/modules/dbaas_trove/modular/trove.pp1
-rw-r--r--deployment_scripts/puppet/modules/trove/.gitignore13
-rw-r--r--deployment_scripts/puppet/modules/trove/CHANGELOG.md50
-rw-r--r--deployment_scripts/puppet/modules/trove/Gemfile33
-rw-r--r--deployment_scripts/puppet/modules/trove/README.md116
-rw-r--r--deployment_scripts/puppet/modules/trove/Rakefile24
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_api_paste_ini/ini_setting.rb19
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_conductor_config/ini_setting.rb19
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_config/ini_setting.rb19
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_guestagent_config/ini_setting.rb19
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_taskmanager_config/ini_setting.rb19
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_api_paste_ini.rb9
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_conductor_config.rb10
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_config.rb10
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_guestagent_config.rb10
-rw-r--r--deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_taskmanager_config.rb7
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/api.pp124
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/conductor.pp50
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/db.pp103
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/db/mysql.pp2
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/db/sync.pp1
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/generic_service.pp4
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/guestagent.pp139
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/init.pp126
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/keystone/auth.pp45
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/params.pp4
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/quota.pp43
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/rabbitmq.pp106
-rw-r--r--deployment_scripts/puppet/modules/trove/manifests/taskmanager.pp125
-rw-r--r--deployment_scripts/puppet/modules/trove/metadata.json6
-rw-r--r--deployment_scripts/puppet/modules/trove/other-requirements.txt0
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/basic_trove_spec.rb75
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/nodesets/centos-70-x64.yml11
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/nodesets/default.yml7
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/nodesets/nodepool-centos7.yml2
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/nodesets/nodepool-trusty.yml2
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml11
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_api_spec.rb93
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_conductor_spec.rb55
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_db_spec.rb119
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_guestagent_spec.rb72
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_init_spec.rb14
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_keystone_auth_spec.rb20
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_quota_spec.rb39
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/classes/trove_taskmanager_spec.rb98
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/shared_examples.rb12
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/spec_helper.rb2
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/spec_helper_acceptance.rb2
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/unit/provider/trove_config/ini_setting_spec.rb30
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/unit/type/trove_conductor_config_spec.rb17
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/unit/type/trove_conductor_guestagent_spec.rb17
-rw-r--r--deployment_scripts/puppet/modules/trove/spec/unit/type/trove_config_spec.rb10
-rw-r--r--deployment_scripts/puppet/modules/trove/templates/rabbitmq-init-centos.erb182
-rw-r--r--deployment_scripts/puppet/modules/trove/templates/rabbitmq-init-ubuntu.erb231
-rw-r--r--deployment_scripts/puppet/modules/trove/templates/rabbitmq.config.erb7
-rw-r--r--deployment_scripts/puppet/modules/trove/templates/trove-guestagent.conf.erb88
-rw-r--r--deployment_tasks.yaml264
-rw-r--r--docs/Makefile177
-rw-r--r--docs/source/_static/enable_plugin.pngbin0 -> 49801 bytes
-rw-r--r--docs/source/_static/env_nodes.pngbin0 -> 64240 bytes
-rw-r--r--docs/source/_static/env_ready.pngbin0 -> 50000 bytes
-rw-r--r--docs/source/_static/nodes_tab.pngbin0 -> 25356 bytes
-rw-r--r--docs/source/conf.py340
-rw-r--r--docs/source/index.rst24
-rw-r--r--docs/source/installation_guide.rst45
-rw-r--r--docs/source/overview.rst53
-rw-r--r--docs/source/user_guide.rst63
-rw-r--r--environment_config.yaml95
-rw-r--r--metadata.yaml30
-rw-r--r--network_roles.yaml4
-rw-r--r--node_roles.yaml31
-rwxr-xr-xpre_build_hook4
-rw-r--r--tasks.yaml26
-rw-r--r--volumes.yaml3
99 files changed, 3583 insertions, 1474 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f744094
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
1.tox
2.build
3*.pyc
4docs/build
5fuel-plugin-dbaas-trove-*.rpm
6repositories/ubuntu/*.deb
diff --git a/components.yaml b/components.yaml
new file mode 100644
index 0000000..f7ed663
--- /dev/null
+++ b/components.yaml
@@ -0,0 +1,8 @@
1- name: additional_service:fuel-plugin-dbaas-trove
2 compatible: []
3 requires: []
4 incompatible: []
5 label: "Install Trove"
6 description: |
7 Trove provides scalable and reliable cloud Database as a Service provisioning
8 functionality for both relational and non-relational database engines.
diff --git a/deployment_scripts/puppet/manifests/cluster.pp b/deployment_scripts/puppet/manifests/cluster.pp
deleted file mode 100644
index a8491a0..0000000
--- a/deployment_scripts/puppet/manifests/cluster.pp
+++ /dev/null
@@ -1,50 +0,0 @@
1notice('MODULAR: trove/cluster.pp')
2
3if !(hiera('role') in ['trove']) {
4 fail('The node role is not in trove roles')
5}
6
7$network_scheme = hiera_hash('network_scheme', {})
8$network_metadata = hiera_hash('network_metadata', {})
9
10prepare_network_config($network_scheme)
11
12$trove_node = get_nodes_hash_by_roles($network_metadata, ['trove'])
13
14$corosync_nodes = corosync_nodes($trove_node, 'trove/api')
15
16$network_ip = get_network_role_property('trove/api', 'ipaddr')
17
18class { 'cluster':
19 internal_address => $network_ip,
20 corosync_nodes => $corosync_nodes,
21}
22
23pcmk_nodes { 'pacemaker' :
24 nodes => $corosync_nodes,
25 add_pacemaker_nodes => false,
26}
27
28Service <| title == 'corosync' |> {
29 subscribe => File['/etc/corosync/service.d'],
30 require => File['/etc/corosync/corosync.conf'],
31}
32
33Service['corosync'] -> Pcmk_nodes<||>
34Pcmk_nodes<||> -> Service<| provider == 'pacemaker' |>
35
36# Sometimes during first start pacemaker can not connect to corosync
37# via IPC due to pacemaker and corosync processes are run under different users
38if($::operatingsystem == 'Ubuntu') {
39 $pacemaker_run_uid = 'hacluster'
40 $pacemaker_run_gid = 'haclient'
41
42 file {'/etc/corosync/uidgid.d/pacemaker':
43 content =>"uidgid {
44 uid: ${pacemaker_run_uid}
45 gid: ${pacemaker_run_gid}
46}"
47 }
48
49 File['/etc/corosync/corosync.conf'] -> File['/etc/corosync/uidgid.d/pacemaker'] -> Service <| title == 'corosync' |>
50} \ No newline at end of file
diff --git a/deployment_scripts/puppet/manifests/db.pp b/deployment_scripts/puppet/manifests/db.pp
deleted file mode 100644
index 8bb2be9..0000000
--- a/deployment_scripts/puppet/manifests/db.pp
+++ /dev/null
@@ -1,53 +0,0 @@
1notice('MODULAR: trove/db.pp')
2
3$node_name = hiera('node_name')
4$trove_hash = hiera_hash('fuel-plugin-dbaas-trove', {})
5$trove_enabled = pick($trove_hash['metadata']['enabled'], false)
6$mysql_hash = hiera_hash('mysql_hash', {})
7$management_vip = hiera('management_vip', undef)
8$database_vip = hiera('database_vip')
9
10$mysql_root_user = pick($mysql_hash['root_user'], 'root')
11$mysql_db_create = pick($mysql_hash['db_create'], true)
12$mysql_root_password = $mysql_hash['root_password']
13
14$db_user = pick($trove_hash['metadata']['db_user'], 'trove')
15$db_name = pick($trove_hash['metadata']['db_name'], 'trove')
16$db_password = pick($trove_hash['metadata']['db_password'], $mysql_root_password)
17
18$db_host = pick($trove_hash['metadata']['db_host'], $database_vip, 'localhost')
19$db_create = pick($trove_hash['metadata']['db_create'], $mysql_db_create)
20$db_root_user = pick($trove_hash['metadata']['root_user'], $mysql_root_user)
21$db_root_password = pick($trove_hash['metadata']['root_password'], $mysql_root_password)
22
23$allowed_hosts = [ $node_name, 'localhost', '127.0.0.1', '%' ]
24
25if $trove_enabled and $db_create {
26
27 class { 'galera::client':
28 custom_setup_class => hiera('mysql_custom_setup_class', 'galera'),
29 }
30
31 class { 'trove::db::mysql':
32 user => $db_user,
33 password => $db_password,
34 dbname => $db_name,
35 allowed_hosts => $allowed_hosts,
36 }
37
38 class { 'osnailyfacter::mysql_access':
39 db_host => $db_host,
40 db_user => $db_root_user,
41 db_password => $db_root_password,
42 }
43
44 Class['galera::client'] ->
45 Class['osnailyfacter::mysql_access'] ->
46 Class['trove::db::mysql']
47
48}
49
50class mysql::config {}
51include mysql::config
52class mysql::server {}
53include mysql::server \ No newline at end of file
diff --git a/deployment_scripts/puppet/manifests/haproxy.pp b/deployment_scripts/puppet/manifests/haproxy.pp
deleted file mode 100644
index 13e4d21..0000000
--- a/deployment_scripts/puppet/manifests/haproxy.pp
+++ /dev/null
@@ -1,48 +0,0 @@
1notice('MODULAR: trove/haproxy.pp')
2
3$network_metadata = hiera_hash('network_metadata')
4$trove_hash = hiera_hash('fuel-plugin-dbaas-trove', {})
5# enabled by default
6$use_trove = pick($trove_hash['metadata']['enabled'], true)
7$public_ssl_hash = hiera('public_ssl')
8
9$troves_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, ['trove']), 'trove/api')
10
11if ($use_trove) {
12 $server_names = hiera_array('trove_names', keys($troves_address_map))
13 $ipaddresses = hiera_array('trove_ipaddresses', values($troves_address_map))
14 $public_virtual_ip = hiera('public_vip')
15 $internal_virtual_ip = hiera('management_vip')
16
17 # configure trove ha proxy
18 Openstack::Ha::Haproxy_service {
19 internal_virtual_ip => $internal_virtual_ip,
20 ipaddresses => $ipaddresses,
21 public_virtual_ip => $public_virtual_ip,
22 server_names => $server_names,
23 public_ssl => $public_ssl_hash['services'],
24 }
25
26 openstack::ha::haproxy_service { 'trove-api':
27 order => '210',
28 listen_port => 8779,
29 internal => true,
30 public => true,
31 }
32
33 openstack::ha::haproxy_service { 'trove-rabbitmq':
34 order => '211',
35 listen_port => 55671,
36 define_backups => true,
37 internal => true,
38 public => true,
39 haproxy_config_options => {
40 'option' => ['tcpka'],
41 'timeout client' => '48h',
42 'timeout server' => '48h',
43 'balance' => 'roundrobin',
44 'mode' => 'tcp'
45 },
46 balancermember_options => 'check inter 5000 rise 2 fall 3',
47 }
48}
diff --git a/deployment_scripts/puppet/manifests/keystone.pp b/deployment_scripts/puppet/manifests/keystone.pp
deleted file mode 100644
index d8cbc3b..0000000
--- a/deployment_scripts/puppet/manifests/keystone.pp
+++ /dev/null
@@ -1,44 +0,0 @@
1notice('MODULAR: trove/keystone.pp')
2
3$trove_hash = hiera_hash('fuel-plugin-dbaas-trove', {})
4$public_ssl_hash = hiera('public_ssl')
5$public_vip = hiera('public_vip')
6$public_address = $public_ssl_hash['services'] ? {
7 true => $public_ssl_hash['hostname'],
8 default => $public_vip,
9}
10$public_protocol = $public_ssl_hash['services'] ? {
11 true => 'https',
12 default => 'http',
13}
14$admin_protocol = 'http'
15$admin_address = hiera('management_vip')
16$region = pick($trove_hash['metadata']['region'], hiera('region', 'RegionOne'))
17
18$password = pick($trove_hash['metadata']['user_password'], 'password')
19$auth_name = pick($trove_hash['metadata']['auth_name'], 'trove')
20$configure_endpoint = pick($trove_hash['metadata']['configure_endpoint'], true)
21$configure_user = pick($trove_hash['metadata']['configure_user'], true)
22$configure_user_role = pick($trove_hash['metadata']['configure_user_role'], true)
23$service_name = pick($trove_hash['metadata']['service_name'], 'trove')
24$tenant = pick($trove_hash['metadata']['tenant'], 'services')
25
26$port = '8779'
27
28$public_url = "${public_protocol}://${public_address}:${port}/v1.0/%(tenant_id)s"
29$admin_url = "${admin_protocol}://${admin_address}:${port}/v1.0/%(tenant_id)s"
30
31validate_string($public_address)
32validate_string($password)
33
34class { 'trove::keystone::auth':
35 password => $password,
36 auth_name => $auth_name,
37 configure_endpoint => $configure_endpoint,
38 service_name => $service_name,
39 public_url => $public_url,
40 internal_url => $admin_url,
41 admin_url => $admin_url,
42 region => $region,
43 tenant => $tenant,
44}
diff --git a/deployment_scripts/puppet/manifests/rabbitmq.pp b/deployment_scripts/puppet/manifests/rabbitmq.pp
deleted file mode 100644
index ae49aaa..0000000
--- a/deployment_scripts/puppet/manifests/rabbitmq.pp
+++ /dev/null
@@ -1,147 +0,0 @@
1notice('MODULAR: trove/rabbitmq.pp')
2
3$network_scheme = hiera_hash('network_scheme', {})
4prepare_network_config($network_scheme)
5
6$queue_provider = hiera('queue_provider', 'rabbitmq')
7
8if $queue_provider == 'rabbitmq' {
9 $trove_hash = hiera_hash('fuel-plugin-dbaas-trove', {})
10 $erlang_cookie = hiera('erlang_cookie', 'EOKOWXQREETZSHFNTPEY')
11 $version = hiera('rabbit_version', '3.3.5')
12 $debug = hiera('debug', false)
13 $deployment_mode = hiera('deployment_mode', 'ha_compact')
14 $amqp_port = pick($trove_hash['rabbit_port'], '55671')
15 $rabbit_hash = hiera_hash('rabbit_hash', {})
16 $enabled = pick($rabbit_hash['enabled'], true)
17 $use_pacemaker = pick($rabbit_hash['pacemaker'], true)
18
19 case $::osfamily {
20 'RedHat': {
21 $command_timeout = "'-s KILL'"
22 $package_provider = 'yum'
23 }
24 'Debian': {
25 $command_timeout = "'--signal=KILL'"
26 $package_provider = 'apt'
27 }
28 default: {
29 fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem},\
30 module ${module_name} only support osfamily RedHat and Debian")
31 }
32 }
33
34 if ($debug) {
35 # FIXME(aschultz): debug wasn't introduced until v3.5.0, when we upgrade
36 # we should change info to debug. Also don't forget to fix tests!
37 $rabbit_levels = '[{connection,info}]'
38 } else {
39 $rabbit_levels = '[{connection,info}]'
40 }
41
42 $cluster_partition_handling = hiera('rabbit_cluster_partition_handling', 'autoheal')
43 $mnesia_table_loading_timeout = hiera('mnesia_table_loading_timeout', '10000')
44 $rabbitmq_bind_ip_address = pick(get_network_role_property('trove/api', 'ipaddr'), 'UNSET')
45
46 # NOTE(bogdando) not a hash. Keep an indentation as is
47 $rabbit_tcp_listen_options = hiera('rabbit_tcp_listen_options',
48 '[
49 binary,
50 {packet, raw},
51 {reuseaddr, true},
52 {backlog, 128},
53 {nodelay, true},
54 {exit_on_close, false},
55 {keepalive, true}
56 ]'
57 )
58 $config_kernel_variables = hiera('rabbit_config_kernel_variables',
59 {
60 'inet_dist_listen_min' => '41055',
61 'inet_dist_listen_max' => '41055',
62 'inet_default_connect_options' => '[{nodelay,true}]',
63 'net_ticktime' => '10',
64 }
65 )
66 $config_variables = hiera('rabbit_config_variables',
67 {
68 'log_levels' => $rabbit_levels,
69 'default_vhost' => "<<\"/\">>",
70 'default_permissions' => '[<<".*">>, <<".*">>, <<".*">>]',
71 'tcp_listen_options' => $rabbit_tcp_listen_options,
72 'cluster_partition_handling' => $cluster_partition_handling,
73 'mnesia_table_loading_timeout' => $mnesia_table_loading_timeout,
74 }
75 )
76
77 $thread_pool_calc = min(100,max(12*$physicalprocessorcount,30))
78
79 if $deployment_mode == 'ha_compact' {
80 $rabbit_pid_file = '/var/run/rabbitmq/p_pid'
81 } else {
82 $rabbit_pid_file = '/var/run/rabbitmq/pid'
83 }
84 $environment_variables = hiera('rabbit_environment_variables',
85 {
86 'SERVER_ERL_ARGS' => "\"+K true +A${thread_pool_calc} +P 1048576\"",
87 'PID_FILE' => $rabbit_pid_file,
88 }
89 )
90
91 if ($enabled) {
92 class { '::rabbitmq':
93 admin_enable => true,
94 repos_ensure => false,
95 package_provider => $package_provider,
96 package_source => undef,
97 service_ensure => 'running',
98 service_manage => true,
99 port => $amqp_port,
100 delete_guest_user => true,
101 default_user => 'trove',
102 default_pass => $trove_hash['metadata']['rabbit_password'],
103 # NOTE(bogdando) set to true and uncomment the lines below, if puppet should create a cluster
104 # We don't want it as far as OCF script creates the cluster
105 config_cluster => false,
106 #erlang_cookie => $erlang_cookie,
107 #wipe_db_on_cookie_change => true,
108 #cluster_nodes => $rabbitmq_cluster_nodes,
109 #cluster_node_type => 'disc',
110 #cluster_partition_handling => $cluster_partition_handling,
111 version => $version,
112 node_ip_address => $rabbitmq_bind_ip_address,
113 config_kernel_variables => $config_kernel_variables,
114 config_variables => $config_variables,
115 environment_variables => $environment_variables,
116 }
117
118 if ($use_pacemaker) {
119 # Install rabbit-fence daemon
120 class { 'cluster::rabbitmq_fence':
121 enabled => $enabled,
122 require => Class['::rabbitmq']
123 }
124 }
125
126 class { 'trove::rabbitmq':
127 enabled => $enabled,
128 # Do not install rabbitmq from trove classes
129 rabbitmq_class => false,
130 userid => $trove_hash['metadata']['rabbit_user'],
131 password => $trove_hash['metadata']['rabbit_password'],
132 require => Class['::rabbitmq'],
133 }
134
135 if ($use_pacemaker) {
136 class { 'pacemaker_wrappers::rabbitmq':
137 command_timeout => $command_timeout,
138 debug => $debug,
139 erlang_cookie => $erlang_cookie,
140 admin_user => $trove_hash['metadata']['rabbit_user'],
141 admin_pass => $trove_hash['metadata']['rabbit_password'],
142 before => Class['trove::rabbitmq'],
143 }
144 }
145 }
146
147} \ No newline at end of file
diff --git a/deployment_scripts/puppet/manifests/trove.pp b/deployment_scripts/puppet/manifests/trove.pp
deleted file mode 100644
index 352b67d..0000000
--- a/deployment_scripts/puppet/manifests/trove.pp
+++ /dev/null
@@ -1,92 +0,0 @@
1notice('MODULAR: trove/trove.pp')
2
3prepare_network_config(hiera('network_scheme', {}))
4
5$trove_hash = hiera_hash('fuel-plugin-dbaas-trove', {})
6$nova_hash = hiera_hash('nova_hash', {})
7$neutron_config = hiera_hash('neutron_config', {})
8$node_role = hiera('node_role')
9$public_ip = hiera('public_vip')
10$database_ip = hiera('database_vip')
11$management_ip = hiera('management_vip')
12$region = hiera('region', 'RegionOne')
13$service_endpoint = hiera('service_endpoint')
14$debug = hiera('debug', false)
15$verbose = hiera('verbose', true)
16$use_syslog = hiera('use_syslog', true)
17$use_stderr = hiera('use_stderr', false)
18$rabbit_ha_queues = hiera('rabbit_ha_queues')
19$amqp_port = hiera('amqp_port')
20$amqp_hosts = hiera('amqp_hosts')
21$public_ssl = hiera_hash('public_ssl', {})
22
23#################################################################
24
25if $trove_hash['metadata']['enabled'] {
26 $public_protocol = pick($public_ssl['services'], false) ? {
27 true => 'https',
28 default => 'http',
29 }
30
31 $public_address = pick($public_ssl['services'], false) ? {
32 true => pick($public_ssl['hostname']),
33 default => $public_ip,
34 }
35
36 $firewall_rule = '210 trove-api'
37
38 $api_bind_port = '8779'
39 $api_bind_host = get_network_role_property('trove/api', 'ipaddr')
40
41 $trove_user = pick($trove_hash['metadata']['user'], 'trove')
42 $tenant = pick($trove_hash['metadata']['tenant'], 'services')
43 $internal_url = "http://${api_bind_host}:${api_bind_port}"
44 $db_user = pick($trove_hash['metadata']['db_user'], 'trove')
45 $db_name = pick($trove_hash['metadata']['db_name'], 'trove')
46 $db_password = pick($trove_hash['metadata']['db_password'], 's3cr3t')
47 $db_host = pick($trove_hash['metadata']['db_host'], $database_ip)
48 $read_timeout = '60'
49 $sql_connection = "mysql://${db_user}:${db_password}@${db_host}/${db_name}?read_timeout=${read_timeout}"
50
51
52 class { '::trove::client': }
53
54 class { '::trove':
55 database_connection => $sql_connection,
56 rabbit_host => $management_ip,
57 rabbit_password => $trove_hash['metadata']['rabbit_password'],
58 rabbit_port => '55671',
59 rabbit_userid => $trove_hash['metadata']['rabbit_user'],
60 rabbit_use_ssl => false,
61 nova_proxy_admin_pass => $nova_hash['user_password'],
62 nova_proxy_admin_user => 'nova',
63 nova_proxy_admin_tenant_name => pick($nova_hash['tenant_name'], 'services'),
64 }
65
66 class { '::trove::api':
67 debug => true,
68 verbose => true,
69 bind_host => $api_bind_host,
70 auth_url => "http://${service_endpoint}:5000/v2.0/",
71 keystone_password => $trove_hash['metadata']['user_password'],
72 }
73
74 class { '::trove::conductor':
75 debug => true,
76 verbose => true,
77 auth_url => "http://${service_endpoint}:5000/v2.0/",
78 }
79
80 class { '::trove::taskmanager':
81 debug => true,
82 verbose => true,
83 auth_url => "http://${service_endpoint}:5000/v2.0/",
84 }
85
86 firewall { $firewall_rule :
87 dport => $api_bind_port,
88 proto => 'tcp',
89 action => 'accept',
90 }
91
92}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/db.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/db.pp
new file mode 100644
index 0000000..274eb6c
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/db.pp
@@ -0,0 +1,71 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::db
17
18class dbaas_trove::db {
19
20 notice('MODULAR: dbaas_trove/db')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 if ($trove_enabled) {
26
27 $mysql_hash = hiera_hash('mysql', {})
28 $management_vip = hiera('management_vip', undef)
29 $database_vip = hiera('database_vip', undef)
30
31 $mysql_root_user = pick($mysql_hash['root_user'], 'root')
32 $mysql_db_create = pick($mysql_hash['db_create'], true)
33 $mysql_root_password = $mysql_hash['root_password']
34
35 $db_user = pick($trove['db_user'], 'trove')
36 $db_name = pick($trove['db_name'], 'trove')
37 $db_password = $trove['db_password']
38
39 $db_host = pick($trove['metadata']['db_host'], $database_vip)
40 $db_create = pick($trove['metadata']['db_create'], $mysql_db_create)
41 $db_root_user = pick($trove['metadata']['root_user'], $mysql_root_user)
42 $db_root_password = pick($trove['metadata']['root_password'], $mysql_root_password)
43
44 $allowed_hosts = [ 'localhost', '127.0.0.1', '%' ]
45
46 if $db_create {
47
48 class { '::galera::client':
49 custom_setup_class => hiera('mysql_custom_setup_class', 'galera'),
50 }
51
52 class { '::trove::db::mysql':
53 user => $db_user,
54 password => $db_password,
55 dbname => $db_name,
56 allowed_hosts => $allowed_hosts,
57 }
58
59 class { '::osnailyfacter::mysql_access':
60 db_host => $db_host,
61 db_user => $db_root_user,
62 db_password => $db_root_password,
63 }
64
65 Class['::galera::client'] ->
66 Class['::osnailyfacter::mysql_access'] ->
67 Class['::trove::db::mysql']
68 }
69 }
70}
71
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/firewall.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/firewall.pp
new file mode 100644
index 0000000..dd37371
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/firewall.pp
@@ -0,0 +1,107 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::firewall
17
18class dbaas_trove::firewall {
19
20 notice('MODULAR: dbaas_trove/firewall.pp')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 if ($trove_enabled) {
26
27 $network_scheme = hiera_hash('network_scheme')
28 $trove_amqp_port = hiera('amqp_port')
29 $trove_api_port = hiera('trove_api_port')
30
31 $corosync_input_port = 5404
32 $corosync_output_port = 5405
33 $erlang_epmd_port = 4369
34 $erlang_inet_dist_port = 41055
35 $erlang_rabbitmq_backend_port = $trove_amqp_port
36 $erlang_rabbitmq_port = $trove_amqp_port
37 $pcsd_port = 2224
38
39 $trove_networks = get_routable_networks_for_network_role($network_scheme, 'trove/api')
40 $corosync_networks = $trove_networks
41
42 openstack::firewall::multi_net {'210 trove-api':
43 port => $trove_api_port,
44 proto => 'tcp',
45 action => 'accept',
46 source_nets => $trove_networks,
47 }
48
49
50 openstack::firewall::multi_net {'106 rabbitmq':
51 port => [$erlang_epmd_port, $erlang_rabbitmq_port, $erlang_rabbitmq_backend_port, $erlang_inet_dist_port],
52 proto => 'tcp',
53 action => 'accept',
54 source_nets => $trove_networks,
55 }
56
57 # Workaround for fuel bug with firewall
58 firewall {'003 remote rabbitmq ':
59 sport => [$erlang_epmd_port, $erlang_rabbitmq_port, $erlang_rabbitmq_backend_port, $erlang_inet_dist_port, 55672, 61613],
60 source => hiera('master_ip'),
61 proto => 'tcp',
62 action => 'accept',
63 }
64
65 # allow local rabbitmq admin traffic for LP#1383258
66 firewall {'005 local rabbitmq admin':
67 sport => [ 15672 ],
68 iniface => 'lo',
69 proto => 'tcp',
70 action => 'accept',
71 }
72
73 # reject all non-local rabbitmq admin traffic for LP#1450443
74 firewall {'006 reject non-local rabbitmq admin':
75 sport => [ 15672 ],
76 proto => 'tcp',
77 action => 'drop',
78 }
79
80 # allow connections from haproxy namespace
81 firewall {'030 allow connections from haproxy namespace':
82 source => '240.0.0.2',
83 action => 'accept',
84 }
85
86 openstack::firewall::multi_net {'113 corosync-input':
87 port => $corosync_input_port,
88 proto => 'udp',
89 action => 'accept',
90 source_nets => $corosync_networks,
91 }
92
93 openstack::firewall::multi_net {'114 corosync-output':
94 port => $corosync_output_port,
95 proto => 'udp',
96 action => 'accept',
97 source_nets => $corosync_networks,
98 }
99
100 openstack::firewall::multi_net {'115 pcsd-server':
101 port => $pcsd_port,
102 proto => 'tcp',
103 action => 'accept',
104 source_nets => $corosync_networks,
105 }
106 }
107}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/hiera_override.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/hiera_override.pp
new file mode 100644
index 0000000..d4f1ade
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/hiera_override.pp
@@ -0,0 +1,103 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::hiera_override
17
18class dbaas_trove::hiera_override {
19
20 notice('MODULAR: dbaas_trove/hiera_override.pp')
21
22 $plugin_name = 'fuel-plugin-dbaas-trove'
23 $trove = hiera_hash($plugin_name, undef)
24 $trove_enabled = pick($trove['metadata']['enabled'], false)
25 $hiera_dir = '/etc/hiera/override'
26 if ($trove_enabled) {
27
28 $plugin_yaml = "${plugin_name}.yaml"
29 $network_metadata = hiera_hash('network_metadata')
30
31 if empty($network_metadata) {
32 fail('Network_metadata not given in the astute.yaml')
33 }
34
35 $trove_roles = [ 'primary-trove', 'trove' ]
36 $trove_nodes = get_nodes_hash_by_roles($network_metadata, $trove_roles)
37
38 $trove_address_map = get_node_to_ipaddr_map_by_network_role(
39 $trove_nodes,
40 'trove/api'
41 )
42
43 $trove_nodes_ips = values($trove_address_map)
44 $trove_nodes_names = keys($trove_address_map)
45
46 $corosync_roles = $trove_roles
47 $corosync_nodes = $trove_nodes
48
49 $amqp_port = hiera('amqp_port', '5673')
50 $trove_amqp_port = hiera($trove['rabbit_port'], '55671')
51 $rabbit_username = $trove['rabbit_user']
52 $rabbit_password = $trove['rabbit_password']
53 $trove_api_port = hiera($trove['trove_api_port'], 8779)
54 $trove_amqp_hosts = inline_template("<%= @trove_nodes_ips.map {|x| x + ':' + @trove_amqp_port}.join ',' %>")
55 }
56 $calculated_content = inline_template('<%
57require "yaml"
58data = {
59 "trove_amqp_hosts" => @trove_amqp_hosts,
60 "amqp_port" => @trove_amqp_port ,
61 "infra_amqp_port" => @amqp_port,
62 "trove_api_port" => @trove_api_port,
63 "rabbit_hash" => {
64 "user" => @rabbit_username ,
65 "password" => @rabbit_password ,
66 } ,
67}
68#data["trove_nodes"] = @trove_nodes if @trove_nodes
69data["corosync_nodes"] = @corosync_nodes if @corosync_nodes
70data["corosync_roles"] = @corosync_roles if @corosync_roles
71-%>
72
73<%= YAML.dump(data) %>')
74
75 file { $hiera_dir :
76 ensure => 'directory',
77 path => $hiera_dir,
78 } ->
79 file { "${hiera_dir}/${plugin_yaml}" :
80 ensure => 'present',
81 content => $calculated_content,
82 }
83 package {'ruby-deep-merge':
84 ensure => 'installed',
85 }
86
87 # hiera file changes between 7.0 and 8.0 so we need to handle the override the
88 # different yaml formats via these exec hacks. It should be noted that the
89 # fuel hiera task will wipe out these this update to the hiera.yaml
90 exec { "${plugin_name}_hiera_override_7.0":
91 command => "sed -i '/ - override\\/plugins/a\\ - override\\/${plugin_name}' /etc/hiera.yaml",
92 path => '/bin:/usr/bin',
93 unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml",
94 onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml'
95 }
96
97 exec { "${plugin_name}_hiera_override_8.0":
98 command => "sed -i '/ - override\\/plugins/a\\ - override\\/${plugin_name}' /etc/hiera.yaml",
99 path => '/bin:/usr/bin',
100 unless => "grep -q '^ - override/${plugin_name}' /etc/hiera.yaml",
101 onlyif => 'grep -q "^ - override/plugins" /etc/hiera.yaml'
102 }
103}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/keystone.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/keystone.pp
new file mode 100644
index 0000000..827a0cf
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/keystone.pp
@@ -0,0 +1,74 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::keystone
17class dbaas_trove::keystone {
18
19 notice('MODULAR: dbaas_trove/keystone')
20
21 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
22 $trove_enabled = pick($trove['metadata']['enabled'], false)
23
24 if ($trove_enabled) {
25
26 $management_vip = hiera('management_vip')
27 $public_ssl_hash = hiera_hash('public_ssl', {})
28 $ssl_hash = hiera_hash('use_ssl', {})
29 $public_vip = hiera('public_vip')
30
31 $public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'protocol', 'http')
32 $public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'hostname', [$public_vip])
33
34 $internal_protocol = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'protocol', 'http')
35 $internal_address = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'hostname', [$management_vip])
36
37 $admin_protocol = get_ssl_property($ssl_hash, {}, 'trove', 'admin', 'protocol', 'http')
38 $admin_address = get_ssl_property($ssl_hash, {}, 'trove', 'admin', 'hostname', [$management_vip])
39
40 $region = pick($trove['region'], hiera('region', 'RegionOne'))
41 $password = $trove['auth_password']
42 $auth_name = pick($trove['auth_name'], 'trove')
43 $configure_endpoint = pick($trove['configure_endpoint'], true)
44 $service_name = pick($trove['service_name'], 'trove')
45 $tenant = pick($trove['tenant'], 'services')
46
47 validate_string($public_address)
48 validate_string($password)
49
50 $bind_port = '8779'
51
52 $public_url = "${public_protocol}://${public_address}:${bind_port}/v1.0/%(tenant_id)s"
53 $internal_url = "${internal_protocol}://${internal_address}:${bind_port}/v1.0/%(tenant_id)s"
54 $admin_url = "${admin_protocol}://${admin_address}:${bind_port}/v1.0/%(tenant_id)s"
55
56 Class['::osnailyfacter::wait_for_keystone_backends'] -> Class['::trove::keystone::auth']
57
58 class {'::osnailyfacter::wait_for_keystone_backends': }
59
60 class { '::trove::keystone::auth':
61 configure_endpoint => $configure_endpoint,
62 service_name => $service_name,
63 region => $region,
64 auth_name => $auth_name,
65 password => $password,
66 email => "${auth_name}@localhost",
67 tenant => $tenant,
68 public_url => $public_url,
69 internal_url => $internal_url,
70 admin_url => $admin_url,
71 }
72 }
73}
74
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/openstack_haproxy_trove.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/openstack_haproxy_trove.pp
new file mode 100644
index 0000000..3027af7
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/openstack_haproxy_trove.pp
@@ -0,0 +1,103 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::openstack_haproxy_trove
17
18class dbaas_trove::openstack_haproxy_trove {
19
20 notice('MODULAR: dbaas_trove/openstack_haproxy_trove.pp')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 if ($trove_enabled) {
26
27 $network_metadata = hiera_hash('network_metadata', {})
28
29 $public_ssl_hash = hiera_hash('public_ssl', {})
30 $ssl_hash = hiera_hash('use_ssl', {})
31
32 $public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'usage', false)
33 $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'path', [''])
34
35 $internal_ssl = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'usage', false)
36 $internal_ssl_path = get_ssl_property($ssl_hash, {}, 'trove', 'internal', 'path', [''])
37
38 $external_lb = hiera('external_lb', false)
39 $trove_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-trove', 'trove'])
40
41 $trove_amqp_use_ssl = pick($trove['metadata']['rabbit_use_ssl'], true)
42 $trove_amqp_port = hiera($trove['rabbit_port'], '55671')
43 $trove_api_port = hiera($trove['metadata']['trove_api_port'], 8779)
44
45 if (!$external_lb) {
46
47 $trove_address_map = get_node_to_ipaddr_map_by_network_role($trove_nodes, 'trove/api')
48 $server_names = hiera_array('trove_names', keys($trove_address_map))
49 $ipaddresses = hiera_array('trove_ipaddresses', values($trove_address_map))
50 $public_virtual_ip = hiera('public_vip')
51 $internal_virtual_ip = hiera('management_vip')
52
53 # configure trove ha proxy
54 Openstack::Ha::Haproxy_service {
55 internal_virtual_ip => $internal_virtual_ip,
56 ipaddresses => $ipaddresses,
57 public_virtual_ip => $public_virtual_ip,
58 server_names => $server_names,
59 public => true,
60 internal_ssl => $internal_ssl,
61 internal_ssl_path => $internal_ssl_path,
62 }
63
64 openstack::ha::haproxy_service { 'trove-api':
65 order => '206',
66 listen_port => $trove_api_port,
67 public_ssl => $public_ssl,
68 public_ssl_path => $public_ssl_path,
69 #require_service => 'trove-api',
70 haproxy_config_options => {
71 option => ['httpchk', 'httplog', 'httpclose'],
72 'timeout server' => '660s',
73 'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
74 },
75 balancermember_options => 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3',
76 }
77
78 if($public_ssl and $trove_amqp_use_ssl) {
79 $rabbit_public_ssl = true
80 } else {
81 $rabbit_public_ssl = false
82 }
83
84 openstack::ha::haproxy_service { 'trove-rabbitmq':
85 order => '205',
86 listen_port => $trove_amqp_port,
87 public_ssl => $rabbit_public_ssl,
88 public_ssl_path => $public_ssl_path,
89 internal => false,
90 define_backups => true,
91 haproxy_config_options => {
92 'option' => ['tcpka'],
93 'timeout client' => '48h',
94 'timeout server' => '48h',
95 'balance' => 'roundrobin',
96 'mode' => 'tcp',
97 },
98 balancermember_options => 'check inter 5000 rise 2 fall 3',
99 }
100 }
101 }
102}
103
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_add_trust_chain.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_add_trust_chain.pp
new file mode 100644
index 0000000..4688478
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_add_trust_chain.pp
@@ -0,0 +1,103 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::ssl_add_trust_chain
17
18class dbaas_trove::ssl_add_trust_chain {
19
20 notice('MODULAR: dbaas_trove/ssl_add_trust_chain.pp')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 Exec {
26 path => '/bin:/usr/bin:/sbin:/usr/sbin',
27 }
28
29 File {
30 ensure => file,
31 }
32
33 define file_link {
34 $service = $name
35 if !empty(file("/etc/pki/tls/certs/public_${service}.pem",'/dev/null')) {
36 file { "/usr/local/share/ca-certificates/${service}_public_haproxy.crt":
37 source => "/etc/pki/tls/certs/public_${service}.pem",
38 }
39 }
40
41 if !empty(file("/etc/pki/tls/certs/internal_${service}.pem",'/dev/null')) {
42 file { "/usr/local/share/ca-certificates/${service}_internal_haproxy.crt":
43 source => "/etc/pki/tls/certs/internal_${service}.pem",
44 }
45 }
46
47 if !empty(file("/etc/pki/tls/certs/admin_${service}.pem",'/dev/null')) {
48 file { "/usr/local/share/ca-certificates/${service}_admin_haproxy.crt":
49 source => "/etc/pki/tls/certs/admin_${service}.pem",
50 }
51 }
52 }
53
54 if !empty($ssl_hash and $trove_enabled) {
55 $custome_services = [ 'trove' ]
56
57 file_link { $custome_services: }
58
59 } elsif !empty($custome_services and $trove_enabled) {
60 case $::osfamily {
61 'RedHat': {
62 file { '/etc/pki/ca-trust/source/anchors/public_haproxy.pem':
63 source => '/etc/pki/tls/certs/public_haproxy.pem',
64 }
65 }
66
67 'Debian': {
68 file { '/usr/local/share/ca-certificates/public_haproxy.crt':
69 source => '/etc/pki/tls/certs/public_haproxy.pem',
70 }
71 }
72
73 default: {
74 fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
75 }
76 }
77 }
78
79 case $::osfamily {
80 'RedHat': {
81 exec { 'enable_trust':
82 command => 'update-ca-trust force-enable',
83 refreshonly => true,
84 notify => Exec['add_trust']
85 }
86
87 File <||> ~> Exec['enable_trust']
88 }
89
90 'Debian': {
91 File <||> ~> Exec['add_trust']
92 }
93
94 default: {
95 fail("Unsupported OS: ${::osfamily}/${::operatingsystem}")
96 }
97 }
98
99 exec { 'add_trust':
100 command => 'update-ca-certificates',
101 refreshonly => true,
102 }
103}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_dns_setup.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_dns_setup.pp
new file mode 100644
index 0000000..d01da91
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_dns_setup.pp
@@ -0,0 +1,126 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::ssl_dns_setup
17
18class dbaas_trove::ssl_dns_setup {
19
20 notice('MODULAR: dbaas_trove/ssl_dns_setup.pp')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 $public_ssl_hash = hiera_hash('public_ssl')
26 $ssl_hash = hiera_hash('use_ssl', {})
27 $public_vip = hiera('public_vip')
28 $management_vip = hiera('management_vip')
29 $openstack_service_endpoints = hiera_hash('openstack_service_endpoints', {})
30
31 $custom_services = [ 'trove']
32
33 define hosts (
34 $ssl_hash,
35 ){
36 $service = $name
37 $public_vip = hiera('public_vip')
38 $management_vip = hiera('management_vip')
39
40 $public_hostname = try_get_value($ssl_hash, "${service}_public_hostname", '')
41 $internal_hostname = try_get_value($ssl_hash, "${service}_internal_hostname", '')
42 $admin_hostname = try_get_value($ssl_hash, "${service}_admin_hostname", $internal_hostname)
43
44 $service_public_ip = try_get_value($ssl_hash, "${service}_public_ip", '')
45 if !empty($service_public_ip) {
46 $public_ip = $service_public_ip
47 } else {
48 $public_ip = $public_vip
49 }
50
51 $service_internal_ip = try_get_value($ssl_hash, "${service}_internal_ip", '')
52 if !empty($service_internal_ip) {
53 $internal_ip = $service_internal_ip
54 } else {
55 $internal_ip = $management_vip
56 }
57
58 $service_admin_ip = try_get_value($ssl_hash, "${service}_admin_ip", '')
59 if !empty($service_admin_ip) {
60 $admin_ip = $service_admin_ip
61 } else {
62 $admin_ip = $management_vip
63 }
64
65 # We always need to set public hostname resolution
66 if !empty($public_hostname) and !defined(Host[$public_hostname]) {
67 host { $public_hostname:
68 name => $public_hostname,
69 ensure => present,
70 ip => $public_ip,
71 }
72 }
73
74 if ($public_hostname == $internal_hostname) and ($public_hostname == $admin_hostname) {
75 notify{"All ${service} hostnames is equal, just public one inserted to DNS":}
76 }
77 elsif $public_hostanme == $internal_hostname {
78 if !empty($admin_hostname) and !defined(Host[$admin_hostname]) {
79 host { $admin_hostname:
80 name => $admin_hostname,
81 ensure => present,
82 ip => $admin_ip,
83 }
84 }
85 }
86 elsif ($public_hostname == $admin_hostname) or ($internal_hostname == $admin_hostname) {
87 if !empty($internal_hostname) and !defined(Host[$internal_hostname]) {
88 host { $internal_hostname:
89 name => $internal_hostname,
90 ensure => present,
91 ip => $internal_ip,
92 }
93 }
94 }
95 else {
96 if !empty($admin_hostname) and !defined(Host[$admin_hostname]) {
97 host { $admin_hostname:
98 name => $admin_hostname,
99 ensure => present,
100 ip => $admin_ip,
101 }
102 }
103 if !empty($internal_hostname) and !defined(Host[$internal_hostname]) {
104 host { $internal_hostname:
105 name => $internal_hostname,
106 ensure => present,
107 ip => $internal_ip,
108 }
109 }
110 }
111 }
112
113 if($trove_enabled) {
114 if !empty($ssl_hash) {
115 hosts { $custom_services:
116 ssl_hash => $ssl_hash,
117 }
118 } elsif !empty($public_ssl_hash) {
119 host { $public_ssl_hash['hostname']:
120 ensure => present,
121 ip => $public_vip,
122 }
123 }
124 }
125
126}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_keys_saving.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_keys_saving.pp
new file mode 100644
index 0000000..744d976
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/ssl_keys_saving.pp
@@ -0,0 +1,98 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::ssl_keys_saving
17
18class dbaas_trove::ssl_keys_saving {
19
20 notice('MODULAR: dbaas_trove/ssl_keys_saving.pp')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 $public_ssl_hash = hiera_hash('public_ssl')
26 $ssl_hash = hiera_hash('use_ssl', {})
27 $pub_certificate_content = try_get_value($public_ssl_hash, 'cert_data/content', '')
28 $base_path = '/etc/pki/tls/certs'
29 $pki_path = [ '/etc/pki', '/etc/pki/tls' ]
30 $astute_base_path = '/var/lib/astute/haproxy'
31
32 File {
33 owner => 'root',
34 group => 'root',
35 mode => '0644',
36 }
37
38 file { [ $pki_path, $base_path, $astute_base_path ]:
39 ensure => directory,
40 }
41
42 #TODO(sbog): convert it to '.each' syntax when moving to Puppet 4
43 #TODO(anoskov): move it outside class 'osnailyfacter::ssl::ssl_keys_saving'
44 define cert_file (
45 $ssl_hash,
46 $base_path,
47 $astute_base_path,
48 ){
49 $service = $name
50
51 $public_service = try_get_value($ssl_hash, "${service}_public", false)
52 $public_usercert = try_get_value($ssl_hash, "${service}_public_usercert", false)
53 $public_certdata = try_get_value($ssl_hash, "${service}_public_certdata/content", '')
54 $internal_service = try_get_value($ssl_hash, "${service}_internal", false)
55 $internal_usercert = try_get_value($ssl_hash, "${service}_internal_usercert", false)
56 $internal_certdata = try_get_value($ssl_hash, "${service}_internal_certdata/content", '')
57 $admin_service = try_get_value($ssl_hash, "${service}_admin", false)
58 $admin_usercert = try_get_value($ssl_hash, "${service}_admin_usercert", false)
59 $admin_certdata = try_get_value($ssl_hash, "${service}_admin_certdata/content", '')
60
61 if $ssl_hash["${service}"] {
62 if $public_service and $public_usercert and !empty($public_certdata) {
63 file { ["${base_path}/public_${service}.pem", "${astute_base_path}/public_${service}.pem"]:
64 ensure => present,
65 content => $public_certdata,
66 }
67 }
68 if $internal_service and $internal_usercert and !empty($internal_certdata) {
69 file { ["${base_path}/internal_${service}.pem", "${astute_base_path}/internal_${service}.pem"]:
70 ensure => present,
71 content => $internal_certdata,
72 }
73 }
74 if $admin_service and $admin_usercert and !empty($admin_certdata) {
75 file { ["${base_path}/admin_${service}.pem", "${astute_base_path}/admin_${service}.pem"]:
76 ensure => present,
77 content => $admin_certdata,
78 }
79 }
80 }
81 }
82
83 if !empty($ssl_hash and $trove_enabled) {
84 $custom_services = [ 'trove']
85
86 cert_file { $custom_services:
87 ssl_hash => $ssl_hash,
88 base_path => $base_path,
89 astute_base_path => $astute_base_path,
90 }
91 } elsif !empty($public_ssl_hash and $trove_enabled) {
92 file { ["${base_path}/public_haproxy.pem", "${astute_base_path}/public_haproxy.pem"]:
93 ensure => present,
94 content => $pub_certificate_content,
95 }
96 }
97
98}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/manifests/trove.pp b/deployment_scripts/puppet/modules/dbaas_trove/manifests/trove.pp
new file mode 100644
index 0000000..e203558
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/manifests/trove.pp
@@ -0,0 +1,177 @@
1#
2# Copyright (C) 2016 AT&T Services, Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16# dbaas_trove::trove
17
18class dbaas_trove::trove {
19
20 notice('MODULAR: dbaas_trove/trove')
21
22 $trove = hiera_hash('fuel-plugin-dbaas-trove', undef)
23 $trove_enabled = pick($trove['metadata']['enabled'], false)
24
25 prepare_network_config(hiera('network_scheme', {}))
26
27 if ($trove_enabled) {
28
29 $nova_hash = hiera_hash('nova', {})
30 $neutron_config = hiera_hash('neutron_config', {})
31 $public_vip = hiera('public_vip')
32 $database_vip = hiera('database_vip')
33 $management_vip = hiera('management_vip')
34 $region = hiera('region', 'RegionOne')
35 $service_endpoint = hiera('service_endpoint')
36 $debug = hiera('debug', false)
37 $verbose = hiera('verbose', true)
38 $use_syslog = hiera('use_syslog', true)
39 $use_stderr = hiera('use_stderr', false)
40 $trove_amqp_port = hiera('amqp_port')
41 $trove_amqp_hosts = hiera('trove_amqp_hosts')
42 $public_ssl_hash = hiera_hash('public_ssl', {})
43 $ssl_hash = hiera_hash('use_ssl', {})
44 $external_dns = hiera_hash('external_dns', {})
45 $external_lb = hiera('external_lb', false)
46 $api_bind_port = hiera('trove_api_port')
47
48 $internal_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')
49 $internal_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [hiera('keystone_endpoint', ''), $service_endpoint, $management_vip])
50 $auth_url = "${internal_auth_protocol}://${internal_auth_address}:5000/v2.0/"
51
52 $admin_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
53 $admin_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [hiera('keystone_endpoint', ''), $service_endpoint, $management_vip])
54 $identity_uri = "${admin_auth_protocol}://${admin_auth_address}:35357/"
55
56 $neutron_protocol = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http')
57 $neutron_address = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', [$service_endpoint, $management_vip])
58 $neutron_url = "${neutron_protocol}://${neutron_address}:9696/"
59
60 $cinder_protocol = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'protocol', 'http')
61 $cinder_address = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'hostname', [$service_endpoint, $management_vip])
62 $cinder_url = "${cinder_protocol}://${cinder_address}:8776/v1"
63
64 $swift_protocol = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'protocol', 'http')
65 $swift_address = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'hostname', [$service_endpoint, $management_vip])
66 $swift_url = "${swift_protocol}://${swift_address}:8080/v1/AUTH_"
67
68 $nova_protocol = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'protocol', 'http')
69 $nova_address = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'hostname', [$service_endpoint, $management_vip])
70 $nova_url = "${nova_protocol}://${nova_address}:8774/v2"
71
72 $trove_public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'usage', false)
73 $trove_public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'protocol', 'http')
74 $trove_public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'trove', 'public', 'hostname', [$public_vip])
75
76 $api_bind_host = get_network_role_property('trove/api', 'ipaddr')
77 $tenant = pick($trove['tenant'], 'services')
78 $db_user = pick($trove['db_user'], 'trove')
79 $db_name = pick($trove['db_name'], 'trove')
80 $db_password = $trove['db_password']
81 $read_timeout = '60'
82 $sql_connection = "mysql://${db_user}:${db_password}@${database_vip}/${db_name}?read_timeout=${read_timeout}"
83 $sql_idle_timeout = pick($idle_timeout, '3600')
84
85 $rabbit_password = $trove['rabbit_password']
86 $rabbit_userid = $trove['rabbit_user']
87 $rabbit_use_ssl = pick($trove['metadata']['rabbit_use_ssl'], true)
88 $amqp_durable_queues = pick($trove['amqp_durable_queues'], true)
89 $rabbit_ha_queues = pick($trove['rabbit_ha_queues'], true)
90 $public_rabbit_hosts = "$public_vip:$trove_amqp_port"
91
92 if($trove_public_ssl and $rabbit_use_ssl) {
93 $guest_rabbit_use_ssl = true
94 } else {
95 $guest_rabbit_use_ssl = false
96 }
97
98 $nova_proxy_admin_pass = $nova_hash['user_password']
99 $nova_proxy_admin_user = $nova_hash['auth_name']
100 $nova_proxy_admin_tenant_name = pick($nova_hash['tenant_name'], 'services')
101
102 class { '::trove::client': }
103
104 class { '::trove':
105 database_connection => $sql_connection,
106 database_idle_timeout => $sql_idle_timeout,
107 rabbit_hosts => $trove_amqp_hosts,
108 rabbit_password => $trove['rabbit_password'],
109 rabbit_userid => $trove['rabbit_user'],
110 rabbit_ha_queues => $rabbit_ha_queues,
111 amqp_durable_queues => $amqp_durable_queues,
112 os_region_name => $region,
113 nova_compute_url => $nova_url,
114 cinder_url => $cinder_url,
115 swift_url => $swift_url,
116 neutron_url => $neutron_url,
117 nova_proxy_admin_pass => $nova_hash['user_password'],
118 nova_proxy_admin_user => $nova_hash['auth_name'],
119 nova_proxy_admin_tenant_name => pick($nova_hash['tenant_name'], 'services'),
120 }
121
122 class { '::trove::api':
123 debug => $debug,
124 verbose => $verbose,
125 bind_host => $api_bind_host,
126 auth_url => $auth_url,
127 auth_host => $service_endpoint,
128 keystone_password => $trove['auth_password'],
129 keystone_user => $trove['auth_name'],
130 }
131
132 class { '::trove::conductor':
133 debug => $debug,
134 verbose => $verbose,
135 auth_url => $auth_url,
136 }
137
138 class { '::trove::taskmanager':
139 debug => $debug,
140 verbose => $verbose,
141 auth_url => $auth_url,
142 use_guestagent_template => false,
143 }
144
145 class { '::trove::guestagent':
146 enabled => false,
147 manage_service => true,
148 debug => $debug,
149 verbose => $verbose,
150 rabbit_hosts => $public_rabbit_hosts,
151 rabbit_host => $public_vip,
152 rabbit_port => $trove_amqp_port,
153 rabbit_use_ssl => $guest_rabbit_use_ssl,
154 auth_url => false,
155 swift_url => false,
156 }
157
158 class { '::trove::quota': }
159
160 class { '::trove::config':
161 trove_config => {
162 'DEFAULT/taskmanager_manager' => { value => 'trove.taskmanager.manager.Manager' },
163 'DEFAULT/update_status_on_fail' => { value => 'True' },
164 'DEFAULT/guest_config' => { value => '/etc/trove/trove-guestagent.conf' },
165 'DEFAULT/injected_config_location' => { value => '/etc/trove' },
166 'DEFAULT/guest_info' => { value => '/etc/guest_info' },
167 'DEFAULT/volume_time_out' => { value => '240' },
168 'DEFAULT/agent_call_high_timeout' => { value => '240' },
169 'DEFAULT/agent_call_low_timeout' => { value => '20' },
170 },
171 trove_guestagent_config => {
172 'mysql/replication_strategy' => { value => 'MysqlGTIDReplication' },
173 'mysql/replication_namespace' => { value => 'trove.guestagent.strategies.replication.mysql_gtid' },
174 },
175 }
176 }
177}
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/db.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/db.pp
new file mode 100644
index 0000000..8eeeb1e
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/db.pp
@@ -0,0 +1,9 @@
1include ::dbaas_trove::db
2
3# mysql::config
4class mysql::config {}
5include ::mysql::config
6
7# mysql::server
8class mysql::server {}
9include ::mysql::server
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/firewall.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/firewall.pp
new file mode 100644
index 0000000..a70aa69
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/firewall.pp
@@ -0,0 +1 @@
include ::dbaas_trove::firewall
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/hiera_override.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/hiera_override.pp
new file mode 100644
index 0000000..99d7e36
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/hiera_override.pp
@@ -0,0 +1 @@
include ::dbaas_trove::hiera_override
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/keystone.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/keystone.pp
new file mode 100644
index 0000000..c906c9f
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/keystone.pp
@@ -0,0 +1 @@
include ::dbaas_trove::keystone
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/openstack-haproxy-trove.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/openstack-haproxy-trove.pp
new file mode 100644
index 0000000..c3d3578
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/openstack-haproxy-trove.pp
@@ -0,0 +1 @@
include ::dbaas_trove::openstack_haproxy_trove
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_add_trust_chain.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_add_trust_chain.pp
new file mode 100644
index 0000000..1f08afb
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_add_trust_chain.pp
@@ -0,0 +1 @@
include ::dbaas_trove::ssl_add_trust_chain
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_dns_setup.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_dns_setup.pp
new file mode 100644
index 0000000..5a518e3
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_dns_setup.pp
@@ -0,0 +1 @@
include ::dbaas_trove::ssl_dns_setup
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_keys_saving.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_keys_saving.pp
new file mode 100644
index 0000000..6e7e9a9
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/ssl_keys_saving.pp
@@ -0,0 +1 @@
include ::dbaas_trove::ssl_keys_saving
diff --git a/deployment_scripts/puppet/modules/dbaas_trove/modular/trove.pp b/deployment_scripts/puppet/modules/dbaas_trove/modular/trove.pp
new file mode 100644
index 0000000..7f32ed5
--- /dev/null
+++ b/deployment_scripts/puppet/modules/dbaas_trove/modular/trove.pp
@@ -0,0 +1 @@
include ::dbaas_trove::trove
diff --git a/deployment_scripts/puppet/modules/trove/.gitignore b/deployment_scripts/puppet/modules/trove/.gitignore
index 28742ea..15c55ef 100644
--- a/deployment_scripts/puppet/modules/trove/.gitignore
+++ b/deployment_scripts/puppet/modules/trove/.gitignore
@@ -1,8 +1,11 @@
1*.swp 1pkg/
2spec/fixtures/modules/*
3spec/fixtures/manifests/site.pp
4Gemfile.lock 2Gemfile.lock
5.vendor
6.bundle/
7vendor/ 3vendor/
4spec/fixtures/
5.vagrant/
6.bundle/
7coverage/
8.idea/
9*.swp
10*.iml
8openstack/ 11openstack/
diff --git a/deployment_scripts/puppet/modules/trove/CHANGELOG.md b/deployment_scripts/puppet/modules/trove/CHANGELOG.md
index 4767b54..fdbab9b 100644
--- a/deployment_scripts/puppet/modules/trove/CHANGELOG.md
+++ b/deployment_scripts/puppet/modules/trove/CHANGELOG.md
@@ -1,3 +1,53 @@
1##2016-05-20 - 7.1.0
2
3###Summary
4
5This is a feature and bugfix release in the Liberty series.
6
7####Features
8
9- Support of PyMySQL driver for MySQL backend
10
11####Bugfixes
12
13- Remove nova_* options from trove-guestagent.conf.erb
14- Use swift_url variable in the template instead of the hardcoded url
15
16####Maintenance
17
18- Add deprecation warning for Qpid rpc driver
19
20
21##2015-11-25 - 7.0.0
22###Summary
23
24This is a backwards-compatible major release for OpenStack Liberty.
25
26####Features
27- add tag to package and service resources
28- add trove::config class
29- reflect provider change in puppet-openstacklib
30- introduce trove::quota class
31- introduce use_guestagent_template option
32- make taskmanager_queue option configurable
33- add api ratelimit options
34- add region and resource url related options
35- add default_neutron_networks in trove::taskmanager
36- complete qpid support
37- keystone/auth: make service description configurable
38
39####Bugfixes
40- fix rabbit_userid parameter
41- fix default value of guestagent_config_file option
42
43####Maintenance
44- initial msync run for all Puppet OpenStack modules
45- try to use zuul-cloner to prepare fixtures
46- remove class_parameter_defaults puppet-lint check
47- acceptance: use common bits from puppet-openstack-integration
48- acceptance: enable debug & verbosity for OpenStack logs
49- fix rspec 3.x syntax
50
1##2015-10-10 - 6.1.0 51##2015-10-10 - 6.1.0
2###Summary 52###Summary
3 53
diff --git a/deployment_scripts/puppet/modules/trove/Gemfile b/deployment_scripts/puppet/modules/trove/Gemfile
index 4c6106e..5981638 100644
--- a/deployment_scripts/puppet/modules/trove/Gemfile
+++ b/deployment_scripts/puppet/modules/trove/Gemfile
@@ -1,29 +1,16 @@
1source 'https://rubygems.org' 1source ENV['GEM_SOURCE'] || "https://rubygems.org"
2 2
3group :development, :test do 3group :development, :test, :system_tests do
4 gem 'puppetlabs_spec_helper', :require => false 4 gem 'puppet-openstack_spec_helper',
5 gem 'rspec-puppet', '~> 2.1.0', :require => false 5 :git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper',
6 6 :branch => 'stable/liberty',
7 gem 'metadata-json-lint' 7 :require => false
8 gem 'puppet-lint-param-docs'
9 gem 'puppet-lint-absolute_classname-check'
10 gem 'puppet-lint-absolute_template_path'
11 gem 'puppet-lint-trailing_newline-check'
12
13 # Puppet 4.x related lint checks
14 gem 'puppet-lint-unquoted_string-check'
15 gem 'puppet-lint-leading_zero-check'
16 gem 'puppet-lint-variable_contains_upcase'
17 gem 'puppet-lint-numericvariable'
18
19 gem 'beaker-rspec', :require => false
20 gem 'beaker-puppet_install_helper', :require => false
21 gem 'json'
22 gem 'webmock'
23end 8end
24 9
25group :system_tests do 10if facterversion = ENV['FACTER_GEM_VERSION']
26 gem 'r10k', :require => 'false' 11 gem 'facter', facterversion, :require => false
12else
13 gem 'facter', :require => false
27end 14end
28 15
29if puppetversion = ENV['PUPPET_GEM_VERSION'] 16if puppetversion = ENV['PUPPET_GEM_VERSION']
diff --git a/deployment_scripts/puppet/modules/trove/README.md b/deployment_scripts/puppet/modules/trove/README.md
index 7739a4f..199ce3a 100644
--- a/deployment_scripts/puppet/modules/trove/README.md
+++ b/deployment_scripts/puppet/modules/trove/README.md
@@ -1,7 +1,7 @@
1puppet-trove 1puppet-trove
2============= 2=============
3 3
46.1.0 - 2015.1 - Kilo 47.1.0 - 2015.2 - Liberty
5 5
6#### Table of Contents 6#### Table of Contents
7 7
@@ -35,6 +35,120 @@ Implementation
35 35
36trove is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers. 36trove is a combination of Puppet manifest and ruby code to delivery configuration and extra functionality through types and providers.
37 37
38### Types
39
40#### trove_config
41
42The `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.
43
44```puppet
45trove_config { 'DEFAULT/verbose' :
46 value => true,
47}
48```
49
50This will write `verbose=true` in the `[DEFAULT]` section.
51
52##### name
53
54Section/setting name to manage from `trove.conf`
55
56##### value
57
58The value of the setting to be defined.
59
60##### secret
61
62Whether to hide the value from Puppet logs. Defaults to `false`.
63
64##### ensure_absent_val
65
66If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
67
68#### trove_conductor_config
69
70The `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.
71
72```puppet
73trove_conductor_config { 'DEFAULT/verbose' :
74 value => true,
75}
76```
77
78This will write `verbose=true` in the `[DEFAULT]` section.
79
80##### name
81
82Section/setting name to manage from `trove.conf`
83
84##### value
85
86The value of the setting to be defined.
87
88##### secret
89
90Whether to hide the value from Puppet logs. Defaults to `false`.
91
92##### ensure_absent_val
93
94If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
95
96#### trove_guestagent_config
97
98The `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.
99
100```puppet
101trove_guestagent_config { 'DEFAULT/verbose' :
102 value => true,
103}
104```
105
106This will write `verbose=true` in the `[DEFAULT]` section.
107
108##### name
109
110Section/setting name to manage from `trove.conf`
111
112##### value
113
114The value of the setting to be defined.
115
116##### secret
117
118Whether to hide the value from Puppet logs. Defaults to `false`.
119
120##### ensure_absent_val
121
122If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
123
124#### trove_taskmanager_config
125
126The `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.
127
128```puppet
129trove_taskmanager_config { 'DEFAULT/verbose' :
130 value => true,
131}
132```
133
134This will write `verbose=true` in the `[DEFAULT]` section.
135
136##### name
137
138Section/setting name to manage from `trove.conf`
139
140##### value
141
142The value of the setting to be defined.
143
144##### secret
145
146Whether to hide the value from Puppet logs. Defaults to `false`.
147
148##### ensure_absent_val
149
150If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `<SERVICE DEFAULT>`
151
38Limitations 152Limitations
39----------- 153-----------
40 154
diff --git a/deployment_scripts/puppet/modules/trove/Rakefile b/deployment_scripts/puppet/modules/trove/Rakefile
index c1eecbd..9692ffd 100644
--- a/deployment_scripts/puppet/modules/trove/Rakefile
+++ b/deployment_scripts/puppet/modules/trove/Rakefile
@@ -1,15 +1,27 @@
1require 'puppetlabs_spec_helper/rake_tasks' 1require 'puppetlabs_spec_helper/rake_tasks'
2require 'puppet-lint/tasks/puppet-lint' 2require 'puppet-lint/tasks/puppet-lint'
3require 'puppet-syntax/tasks/puppet-syntax'
3require 'json' 4require 'json'
4 5
5modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1] 6modname = JSON.parse(open('metadata.json').read)['name'].split('-')[1]
6 7
7PuppetLint.configuration.fail_on_warnings = true 8PuppetSyntax.exclude_paths ||= []
8PuppetLint.configuration.send('disable_80chars') 9PuppetSyntax.exclude_paths << "spec/fixtures/**/*"
9PuppetLint.configuration.send('disable_class_parameter_defaults') 10PuppetSyntax.exclude_paths << "pkg/**/*"
11PuppetSyntax.exclude_paths << "vendor/**/*"
10 12
11task(:default).clear 13Rake::Task[:lint].clear
12task :default => [:spec, :lint] 14PuppetLint::RakeTask.new :lint do |config|
15 config.ignore_paths = ["spec/**/*.pp", "vendor/**/*.pp"]
16 config.fail_on_warnings = true
17 config.log_format = '%{path}:%{linenumber}:%{KIND}: %{message}'
18 config.disable_checks = ["80chars", "class_inherits_from_params_class", "only_variable_string"]
19end
20
21desc "Run acceptance tests"
22RSpec::Core::RakeTask.new(:acceptance) do |t|
23 t.pattern = 'spec/acceptance'
24end
13 25
14Rake::Task[:spec_prep].clear 26Rake::Task[:spec_prep].clear
15desc 'Create the fixtures directory' 27desc 'Create the fixtures directory'
@@ -46,7 +58,7 @@ task :spec_prep do
46 zuul_clone_cmd += ['git://git.openstack.org', "#{repo}"] 58 zuul_clone_cmd += ['git://git.openstack.org', "#{repo}"]
47 sh(*zuul_clone_cmd) 59 sh(*zuul_clone_cmd)
48 else 60 else
49 sh("git clone https://git.openstack.org/#{repo} -b stable/kilo #{repo}") 61 sh("git clone https://git.openstack.org/#{repo} -b stable/liberty #{repo}")
50 end 62 end
51 script = ['env'] 63 script = ['env']
52 script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"] 64 script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_api_paste_ini/ini_setting.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_api_paste_ini/ini_setting.rb
index e63fd1e..236f34f 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_api_paste_ini/ini_setting.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_api_paste_ini/ini_setting.rb
@@ -1,27 +1,10 @@
1Puppet::Type.type(:trove_api_paste_ini).provide( 1Puppet::Type.type(:trove_api_paste_ini).provide(
2 :ini_setting, 2 :ini_setting,
3 :parent => Puppet::Type.type(:ini_setting).provider(:ruby) 3 :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
4) do 4) do
5 5
6 def section
7 resource[:name].split('/', 2).first
8 end
9
10 def setting
11 resource[:name].split('/', 2).last
12 end
13
14 def separator
15 '='
16 end
17
18 def self.file_path 6 def self.file_path
19 '/etc/trove/api-paste.ini' 7 '/etc/trove/api-paste.ini'
20 end 8 end
21 9
22 # added for backwards compatibility with older versions of inifile
23 def file_path
24 self.class.file_path
25 end
26
27end 10end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_conductor_config/ini_setting.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_conductor_config/ini_setting.rb
index a4a0f88..bcf6aae 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_conductor_config/ini_setting.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_conductor_config/ini_setting.rb
@@ -1,27 +1,10 @@
1Puppet::Type.type(:trove_conductor_config).provide( 1Puppet::Type.type(:trove_conductor_config).provide(
2 :ini_setting, 2 :ini_setting,
3 :parent => Puppet::Type.type(:ini_setting).provider(:ruby) 3 :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
4) do 4) do
5 5
6 def section
7 resource[:name].split('/', 2).first
8 end
9
10 def setting
11 resource[:name].split('/', 2).last
12 end
13
14 def separator
15 '='
16 end
17
18 def self.file_path 6 def self.file_path
19 '/etc/trove/trove-conductor.conf' 7 '/etc/trove/trove-conductor.conf'
20 end 8 end
21 9
22 # added for backwards compatibility with older versions of inifile
23 def file_path
24 self.class.file_path
25 end
26
27end 10end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_config/ini_setting.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_config/ini_setting.rb
index d71365c..5698071 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_config/ini_setting.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_config/ini_setting.rb
@@ -1,27 +1,10 @@
1Puppet::Type.type(:trove_config).provide( 1Puppet::Type.type(:trove_config).provide(
2 :ini_setting, 2 :ini_setting,
3 :parent => Puppet::Type.type(:ini_setting).provider(:ruby) 3 :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
4) do 4) do
5 5
6 def section
7 resource[:name].split('/', 2).first
8 end
9
10 def setting
11 resource[:name].split('/', 2).last
12 end
13
14 def separator
15 '='
16 end
17
18 def self.file_path 6 def self.file_path
19 '/etc/trove/trove.conf' 7 '/etc/trove/trove.conf'
20 end 8 end
21 9
22 # added for backwards compatibility with older versions of inifile
23 def file_path
24 self.class.file_path
25 end
26
27end 10end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_guestagent_config/ini_setting.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_guestagent_config/ini_setting.rb
index d527f3e..4d81498 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_guestagent_config/ini_setting.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_guestagent_config/ini_setting.rb
@@ -1,27 +1,10 @@
1Puppet::Type.type(:trove_guestagent_config).provide( 1Puppet::Type.type(:trove_guestagent_config).provide(
2 :ini_setting, 2 :ini_setting,
3 :parent => Puppet::Type.type(:ini_setting).provider(:ruby) 3 :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
4) do 4) do
5 5
6 def section
7 resource[:name].split('/', 2).first
8 end
9
10 def setting
11 resource[:name].split('/', 2).last
12 end
13
14 def separator
15 '='
16 end
17
18 def self.file_path 6 def self.file_path
19 '/etc/trove/trove-guestagent.conf' 7 '/etc/trove/trove-guestagent.conf'
20 end 8 end
21 9
22 # added for backwards compatibility with older versions of inifile
23 def file_path
24 self.class.file_path
25 end
26
27end 10end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_taskmanager_config/ini_setting.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_taskmanager_config/ini_setting.rb
index 5aa9539..9e6c1d3 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_taskmanager_config/ini_setting.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/provider/trove_taskmanager_config/ini_setting.rb
@@ -1,27 +1,10 @@
1Puppet::Type.type(:trove_taskmanager_config).provide( 1Puppet::Type.type(:trove_taskmanager_config).provide(
2 :ini_setting, 2 :ini_setting,
3 :parent => Puppet::Type.type(:ini_setting).provider(:ruby) 3 :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
4) do 4) do
5 5
6 def section
7 resource[:name].split('/', 2).first
8 end
9
10 def setting
11 resource[:name].split('/', 2).last
12 end
13
14 def separator
15 '='
16 end
17
18 def self.file_path 6 def self.file_path
19 '/etc/trove/trove-taskmanager.conf' 7 '/etc/trove/trove-taskmanager.conf'
20 end 8 end
21 9
22 # added for backwards compatibility with older versions of inifile
23 def file_path
24 self.class.file_path
25 end
26
27end 10end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_api_paste_ini.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_api_paste_ini.rb
index 1ff1a5b..8c40209 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_api_paste_ini.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_api_paste_ini.rb
@@ -39,4 +39,13 @@ Puppet::Type.newtype(:trove_api_paste_ini) do
39 39
40 defaultto false 40 defaultto false
41 end 41 end
42
43 newparam(:ensure_absent_val) do
44 desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
45 defaultto('<SERVICE DEFAULT>')
46 end
47
48 autorequire(:package) do
49 'trove-api'
50 end
42end 51end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_conductor_config.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_conductor_config.rb
index 6450a47..d5ab342 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_conductor_config.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_conductor_config.rb
@@ -14,6 +14,7 @@ Puppet::Type.newtype(:trove_conductor_config) do
14 value.capitalize! if value =~ /^(true|false)$/i 14 value.capitalize! if value =~ /^(true|false)$/i
15 value 15 value
16 end 16 end
17 newvalues(/^[\S ]*$/)
17 18
18 def is_to_s( currentvalue ) 19 def is_to_s( currentvalue )
19 if resource.secret? 20 if resource.secret?
@@ -39,4 +40,13 @@ Puppet::Type.newtype(:trove_conductor_config) do
39 40
40 defaultto false 41 defaultto false
41 end 42 end
43
44 newparam(:ensure_absent_val) do
45 desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
46 defaultto('<SERVICE DEFAULT>')
47 end
48
49 autorequire(:package) do
50 'trove-conductor'
51 end
42end 52end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_config.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_config.rb
index f1d14d2..81491eb 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_config.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_config.rb
@@ -14,6 +14,7 @@ Puppet::Type.newtype(:trove_config) do
14 value.capitalize! if value =~ /^(true|false)$/i 14 value.capitalize! if value =~ /^(true|false)$/i
15 value 15 value
16 end 16 end
17 newvalues(/^[\S ]*$/)
17 18
18 def is_to_s( currentvalue ) 19 def is_to_s( currentvalue )
19 if resource.secret? 20 if resource.secret?
@@ -39,4 +40,13 @@ Puppet::Type.newtype(:trove_config) do
39 40
40 defaultto false 41 defaultto false
41 end 42 end
43
44 newparam(:ensure_absent_val) do
45 desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
46 defaultto('<SERVICE DEFAULT>')
47 end
48
49 autorequire(:package) do
50 'trove-api'
51 end
42end 52end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_guestagent_config.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_guestagent_config.rb
index 06072f8..a15e17d 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_guestagent_config.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_guestagent_config.rb
@@ -14,6 +14,7 @@ Puppet::Type.newtype(:trove_guestagent_config) do
14 value.capitalize! if value =~ /^(true|false)$/i 14 value.capitalize! if value =~ /^(true|false)$/i
15 value 15 value
16 end 16 end
17 newvalues(/^[\S ]*$/)
17 18
18 def is_to_s( currentvalue ) 19 def is_to_s( currentvalue )
19 if resource.secret? 20 if resource.secret?
@@ -39,4 +40,13 @@ Puppet::Type.newtype(:trove_guestagent_config) do
39 40
40 defaultto false 41 defaultto false
41 end 42 end
43
44 newparam(:ensure_absent_val) do
45 desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
46 defaultto('<SERVICE DEFAULT>')
47 end
48
49 autorequire(:package) do
50 'trove-guestagent'
51 end
42end 52end
diff --git a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_taskmanager_config.rb b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_taskmanager_config.rb
index 25af376..88480c5 100644
--- a/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_taskmanager_config.rb
+++ b/deployment_scripts/puppet/modules/trove/lib/puppet/type/trove_taskmanager_config.rb
@@ -14,6 +14,7 @@ Puppet::Type.newtype(:trove_taskmanager_config) do
14 value.capitalize! if value =~ /^(true|false)$/i 14 value.capitalize! if value =~ /^(true|false)$/i
15 value 15 value
16 end 16 end
17 newvalues(/^[\S ]*$/)
17 18
18 def is_to_s( currentvalue ) 19 def is_to_s( currentvalue )
19 if resource.secret? 20 if resource.secret?
@@ -39,4 +40,10 @@ Puppet::Type.newtype(:trove_taskmanager_config) do
39 40
40 defaultto false 41 defaultto false
41 end 42 end
43
44 newparam(:ensure_absent_val) do
45 desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
46 defaultto('<SERVICE DEFAULT>')
47 end
48
42end 49end
diff --git a/deployment_scripts/puppet/modules/trove/manifests/api.pp b/deployment_scripts/puppet/modules/trove/manifests/api.pp
index a2f2d95..88de534 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/api.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/api.pp
@@ -119,6 +119,26 @@
119# (optional) CA certificate file to use to verify connecting clients 119# (optional) CA certificate file to use to verify connecting clients
120# Defaults to false, not set 120# Defaults to false, not set
121# 121#
122# [*http_get_rate*]
123# (optional) Default rate limit of GET request.
124# Defaults to 200.
125#
126# [*http_post_rate*]
127# (optional) Default rate limit of POST request.
128# Defaults to 200.
129#
130# [*http_put_rate*]
131# (optional) Default rate limit of PUT request.
132# Defaults to 200.
133#
134# [*http_delete_rate*]
135# (optional) Default rate limit of DELETE request.
136# Defaults to 200.
137#
138# [*http_mgmt_post_rate*]
139# (optional) Default rate limit of mgmt post request.
140# Defaults to 200.
141#
122class trove::api( 142class trove::api(
123 $keystone_password, 143 $keystone_password,
124 $verbose = false, 144 $verbose = false,
@@ -142,42 +162,22 @@ class trove::api(
142 $cert_file = false, 162 $cert_file = false,
143 $key_file = false, 163 $key_file = false,
144 $ca_file = false, 164 $ca_file = false,
165 $http_get_rate = 200,
166 $http_post_rate = 200,
167 $http_put_rate = 200,
168 $http_delete_rate = 200,
169 $http_mgmt_post_rate = 200,
145 $manage_service = true, 170 $manage_service = true,
146 $ensure_package = 'present', 171 $ensure_package = 'present',
147) inherits trove { 172) inherits trove {
148 173
149 require ::keystone::python 174 require ::keystone::python
175 include ::trove::db
150 include ::trove::params 176 include ::trove::params
151 177
152 Trove_config<||> ~> Exec['post-trove_config'] 178 Trove_config<||> ~> Exec['post-trove_config']
153 Trove_config<||> ~> Service['trove-api'] 179 Trove_config<||> ~> Service['trove-api']
154 Package['trove-api'] -> Trove_api_paste_ini<||>
155 Trove_api_paste_ini<||> ~> Service['trove-api'] 180 Trove_api_paste_ini<||> ~> Service['trove-api']
156 # Trove db sync is broken in Ubuntu packaging
157 # This is a temporary fix until it's fixed in packaging.
158 # https://bugs.launchpad.net/ubuntu/+source/openstack-trove/+bug/1451134
159 file { '/etc/trove/trove.conf':
160 require => File['/etc/trove'],
161 }
162 File['/etc/trove/trove.conf'] -> Trove_config<||>
163 Trove_config<||> -> Package[$::trove::params::api_package_name]
164
165 if $::trove::database_connection {
166 if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
167 require 'mysql::bindings'
168 require 'mysql::bindings::python'
169 } elsif($::trove::database_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
170
171 } elsif($::trove::database_connection =~ /sqlite:\/\//) {
172
173 } else {
174 fail("Invalid db connection ${::trove::database_connection}")
175 }
176 trove_config {
177 'database/connection': value => $::trove::database_connection;
178 'database/idle_timeout': value => $::trove::database_idle_timeoutl;
179 }
180 }
181 181
182 # basic service config 182 # basic service config
183 trove_config { 183 trove_config {
@@ -191,6 +191,7 @@ class trove::api(
191 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass; 191 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
192 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name; 192 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
193 'DEFAULT/control_exchange': value => $::trove::control_exchange; 193 'DEFAULT/control_exchange': value => $::trove::control_exchange;
194 'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
194 } 195 }
195 196
196 if $auth_url { 197 if $auth_url {
@@ -271,30 +272,66 @@ class trove::api(
271 } 272 }
272 } 273 }
273 274
275 # rate limits
276 trove_config {
277 'DEFAULT/http_get_rate': value => $http_get_rate;
278 'DEFAULT/http_post_rate': value => $http_post_rate;
279 'DEFAULT/http_put_rate': value => $http_put_rate;
280 'DEFAULT/http_delete_rate': value => $http_delete_rate;
281 'DEFAULT/http_mgmt_post_rate': value => $http_mgmt_post_rate;
282 }
283
274 resources { 'trove_config': 284 resources { 'trove_config':
275 purge => $purge_config, 285 purge => $purge_config,
276 } 286 }
277 287
278 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' { 288 # region name
289 if $::trove::os_region_name {
290 trove_config { 'DEFAULT/os_region_name': value => $::trove::os_region_name }
291 }
292 else {
293 trove_config {'DEFAULT/os_region_name': ensure => absent }
294 }
295
296 # services type
297 trove_config {
298 'DEFAULT/nova_compute_service_type': value => $::trove::nova_compute_service_type;
299 'DEFAULT/cinder_service_type': value => $::trove::cinder_service_type;
300 'DEFAULT/neutron_service_type': value => $::trove::neutron_service_type;
301 'DEFAULT/swift_service_type': value => $::trove::swift_service_type;
302 'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
303 }
304
305 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
279 if ! $::trove::rabbit_password { 306 if ! $::trove::rabbit_password {
280 fail('When rpc_backend is rabbitmq, you must set rabbit password') 307 fail('When rpc_backend is rabbitmq, you must set rabbit password')
281 } 308 }
282 if $::trove::rabbit_hosts { 309 if $::trove::rabbit_hosts {
283 trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } 310 trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => $::trove::rabbit_hosts }
284 trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
285 } else { 311 } else {
286 trove_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } 312 trove_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host }
287 trove_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } 313 trove_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port }
288 trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } 314 trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" }
289 trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false } 315 }
316
317 if $::trove::rabbit_ha_queues == undef {
318 if size($::trove::rabbit_hosts) > 1 {
319 trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
320 } else {
321 trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
322 }
323 } else {
324 trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
290 } 325 }
291 326
292 trove_config { 327 trove_config {
293 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_user; 328 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
294 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true; 329 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
295 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host; 330 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
296 'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl; 331 'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
297 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay; 332 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
333 # TODO(shaikapsar): remove this line once bug/1486319 merged to stable/liberty.
334 'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
298 } 335 }
299 336
300 if $::trove::rabbit_use_ssl { 337 if $::trove::rabbit_use_ssl {
@@ -333,29 +370,32 @@ class trove::api(
333 } 370 }
334 } 371 }
335 372
336 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' { 373 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
374
375 warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
376
337 trove_config { 377 trove_config {
338 'DEFAULT/qpid_hostname': value => $::trove::qpid_hostname; 378 'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
339 'DEFAULT/qpid_port': value => $::trove::qpid_port; 379 'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
340 'DEFAULT/qpid_username': value => $::trove::qpid_username; 380 'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
341 'DEFAULT/qpid_password': value => $::trove::qpid_password, secret => true; 381 'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
342 'DEFAULT/qpid_heartbeat': value => $::trove::qpid_heartbeat; 382 'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
343 'DEFAULT/qpid_protocol': value => $::trove::qpid_protocol; 383 'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
344 'DEFAULT/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay; 384 'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
345 } 385 }
346 if is_array($::trove::qpid_sasl_mechanisms) { 386 if is_array($::trove::qpid_sasl_mechanisms) {
347 trove_config { 387 trove_config {
348 'DEFAULT/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' '); 388 'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
349 } 389 }
350 } 390 }
351 elsif $::trove::qpid_sasl_mechanisms { 391 elsif $::trove::qpid_sasl_mechanisms {
352 trove_config { 392 trove_config {
353 'DEFAULT/qpid_sasl_mechanisms': value => $::trove::qpid_sasl_mechanisms; 393 'oslo_messaging_qpid/qpid_sasl_mechanisms': value => $::trove::qpid_sasl_mechanisms;
354 } 394 }
355 } 395 }
356 else { 396 else {
357 trove_config { 397 trove_config {
358 'DEFAULT/qpid_sasl_mechanisms': ensure => absent; 398 'oslo_messaging_qpid/qpid_sasl_mechanisms': ensure => absent;
359 } 399 }
360 } 400 }
361 } 401 }
diff --git a/deployment_scripts/puppet/modules/trove/manifests/conductor.pp b/deployment_scripts/puppet/modules/trove/manifests/conductor.pp
index 570e452..f46ad76 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/conductor.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/conductor.pp
@@ -68,14 +68,6 @@ class trove::conductor(
68 68
69 Trove_conductor_config<||> ~> Exec['post-trove_config'] 69 Trove_conductor_config<||> ~> Exec['post-trove_config']
70 Trove_conductor_config<||> ~> Service['trove-conductor'] 70 Trove_conductor_config<||> ~> Service['trove-conductor']
71 # Trove db sync is broken in Ubuntu packaging
72 # This is a temporary fix until it's fixed in packaging.
73 # https://bugs.launchpad.net/ubuntu/+source/openstack-trove/+bug/1451134
74 file { '/etc/trove/trove-conductor.conf':
75 require => File['/etc/trove'],
76 }
77 File['/etc/trove/trove-conductor.conf'] -> Trove_conductor_config<||>
78 Trove_conductor_config<||> -> Package[$::trove::params::conductor_package_name]
79 71
80 if $::trove::database_connection { 72 if $::trove::database_connection {
81 if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) { 73 if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
@@ -103,28 +95,39 @@ class trove::conductor(
103 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name; 95 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
104 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass; 96 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
105 'DEFAULT/control_exchange': value => $::trove::control_exchange; 97 'DEFAULT/control_exchange': value => $::trove::control_exchange;
98 'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
106 } 99 }
107 100
108 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' { 101 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
109 if ! $::trove::rabbit_password { 102 if ! $::trove::rabbit_password {
110 fail('When rpc_backend is rabbitmq, you must set rabbit password') 103 fail('When rpc_backend is rabbitmq, you must set rabbit password')
111 } 104 }
112 if $::trove::rabbit_hosts { 105 if $::trove::rabbit_hosts {
113 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } 106 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => ::trove::rabbit_hosts }
114 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
115 } else { 107 } else {
116 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } 108 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host }
117 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } 109 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port }
118 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } 110 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" }
119 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false } 111 }
112
113 if $::trove::rabbit_ha_queues == undef {
114 if size($::trove::rabbit_hosts) > 1 {
115 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
116 } else {
117 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
118 }
119 } else {
120 trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
120 } 121 }
121 122
122 trove_conductor_config { 123 trove_conductor_config {
123 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_user; 124 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
124 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true; 125 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
125 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host; 126 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
126 'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl; 127 'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
127 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay; 128 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
129 # TODO(shaikapsar): remove this line once bug/1486319 merged to stable/liberty.
130 'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
128 } 131 }
129 132
130 if $::trove::rabbit_use_ssl { 133 if $::trove::rabbit_use_ssl {
@@ -163,19 +166,22 @@ class trove::conductor(
163 } 166 }
164 } 167 }
165 168
166 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' { 169 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
170
171 warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
172
167 trove_conductor_config { 173 trove_conductor_config {
168 'DEFAULT/qpid_hostname': value => $::trove::qpid_hostname; 174 'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
169 'DEFAULT/qpid_port': value => $::trove::qpid_port; 175 'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
170 'DEFAULT/qpid_username': value => $::trove::qpid_username; 176 'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
171 'DEFAULT/qpid_password': value => $::trove::qpid_password, secret => true; 177 'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
172 'DEFAULT/qpid_heartbeat': value => $::trove::qpid_heartbeat; 178 'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
173 'DEFAULT/qpid_protocol': value => $::trove::qpid_protocol; 179 'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
174 'DEFAULT/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay; 180 'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
175 } 181 }
176 if is_array($::trove::qpid_sasl_mechanisms) { 182 if is_array($::trove::qpid_sasl_mechanisms) {
177 trove_conductor_config { 183 trove_conductor_config {
178 'DEFAULT/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' '); 184 'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
179 } 185 }
180 } 186 }
181 } 187 }
diff --git a/deployment_scripts/puppet/modules/trove/manifests/db.pp b/deployment_scripts/puppet/modules/trove/manifests/db.pp
new file mode 100644
index 0000000..9368ba7
--- /dev/null
+++ b/deployment_scripts/puppet/modules/trove/manifests/db.pp
@@ -0,0 +1,103 @@
1# == Class: trove::db
2#
3# Configure the Trove database
4#
5# === Parameters
6#
7# [*database_connection*]
8# Url used to connect to database.
9# (Optional) Defaults to 'sqlite:////var/lib/trove/trove.sqlite'.
10#
11# [*database_idle_timeout*]
12# Timeout when db connections should be reaped.
13# (Optional) Defaults to 3600.
14#
15# [*database_max_retries*]
16# Maximum number of database connection retries during startup.
17# Setting -1 implies an infinite retry count.
18# (Optional) Defaults to 10.
19#
20# [*database_retry_interval*]
21# Interval between retries of opening a database connection.
22# (Optional) Defaults to 10.
23#
24# [*database_min_pool_size*]
25# Minimum number of SQL connections to keep open in a pool.
26# (Optional) Defaults to 1.
27#
28# [*database_max_pool_size*]
29# Maximum number of SQL connections to keep open in a pool.
30# (Optional) Defaults to 10.
31#
32# [*database_max_overflow*]
33# If set, use this value for max_overflow with sqlalchemy.
34# (Optional) Defaults to 20.
35#
36class trove::db (
37 $database_connection = 'sqlite:////var/lib/trove/trove.sqlite',
38 $database_idle_timeout = 3600,
39 $database_min_pool_size = 1,
40 $database_max_pool_size = 10,
41 $database_max_retries = 10,
42 $database_retry_interval = 10,
43 $database_max_overflow = 20,
44) {
45
46 include ::trove::params
47
48 # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
49 # to use trove::<myparam> if trove::db::<myparam> isn't specified.
50 $database_connection_real = pick($::trove::database_connection, $database_connection)
51 $database_idle_timeout_real = pick($::trove::database_idle_timeout, $database_idle_timeout)
52 $database_min_pool_size_real = pick($::trove::database_min_pool_size, $database_min_pool_size)
53 $database_max_pool_size_real = pick($::trove::database_max_pool_size, $database_max_pool_size)
54 $database_max_retries_real = pick($::trove::database_max_retries, $database_max_retries)
55 $database_retry_interval_real = pick($::trove::database_retry_interval, $database_retry_interval)
56 $database_max_overflow_real = pick($::trove::database_max_overflow, $database_max_overflow)
57
58 validate_re($database_connection_real,
59 '^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
60
61 if $database_connection_real {
62 case $database_connection_real {
63 /^mysql(\+pymysql)?:\/\//: {
64 require 'mysql::bindings'
65 require 'mysql::bindings::python'
66 if $database_connection_real =~ /^mysql\+pymysql/ {
67 $backend_package = $::trove::params::pymysql_package_name
68 } else {
69 $backend_package = false
70 }
71 }
72 /^postgresql:\/\//: {
73 $backend_package = false
74 require 'postgresql::lib::python'
75 }
76 /^sqlite:\/\//: {
77 $backend_package = $::trove::params::sqlite_package_name
78 }
79 default: {
80 fail('Unsupported backend configured')
81 }
82 }
83
84 if $backend_package and !defined(Package[$backend_package]) {
85 package {'trove-backend-package':
86 ensure => present,
87 name => $backend_package,
88 tag => 'openstack',
89 }
90 }
91
92 trove_config {
93 'database/connection': value => $database_connection_real, secret => true;
94 'database/idle_timeout': value => $database_idle_timeout_real;
95 'database/min_pool_size': value => $database_min_pool_size_real;
96 'database/max_retries': value => $database_max_retries_real;
97 'database/retry_interval': value => $database_retry_interval_real;
98 'database/max_pool_size': value => $database_max_pool_size_real;
99 'database/max_overflow': value => $database_max_overflow_real;
100 }
101 }
102
103}
diff --git a/deployment_scripts/puppet/modules/trove/manifests/db/mysql.pp b/deployment_scripts/puppet/modules/trove/manifests/db/mysql.pp
index 6748de8..792eae7 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/db/mysql.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/db/mysql.pp
@@ -79,5 +79,5 @@ class trove::db::mysql(
79 allowed_hosts => $allowed_hosts, 79 allowed_hosts => $allowed_hosts,
80 } 80 }
81 81
82 ::Openstacklib::Db::Mysql['trove'] ~> Exec<| title == 'trove-db-sync' |> 82 ::Openstacklib::Db::Mysql['trove'] ~> Exec<| title == 'trove-manage db_sync' |>
83} 83}
diff --git a/deployment_scripts/puppet/modules/trove/manifests/db/sync.pp b/deployment_scripts/puppet/modules/trove/manifests/db/sync.pp
index 97d69db..9d3f947 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/db/sync.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/db/sync.pp
@@ -23,6 +23,5 @@ class trove::db::sync {
23 user => 'trove', 23 user => 'trove',
24 refreshonly => true, 24 refreshonly => true,
25 subscribe => Trove_config['database/connection'], 25 subscribe => Trove_config['database/connection'],
26 require => Package['trove-api'],
27 } 26 }
28} 27}
diff --git a/deployment_scripts/puppet/modules/trove/manifests/generic_service.pp b/deployment_scripts/puppet/modules/trove/manifests/generic_service.pp
index 9466642..2201eb8 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/generic_service.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/generic_service.pp
@@ -60,7 +60,7 @@ define trove::generic_service(
60 60
61 $trove_title = "trove-${name}" 61 $trove_title = "trove-${name}"
62 Exec['post-trove_config'] ~> Service<| title == $trove_title |> 62 Exec['post-trove_config'] ~> Service<| title == $trove_title |>
63 Exec<| title == 'trove-db-sync' |> ~> Service<| title == $trove_title |> 63 Exec<| title == 'trove-manage db_sync' |> ~> Service<| title == $trove_title |>
64 64
65 if ($package_name) { 65 if ($package_name) {
66 if !defined(Package[$package_name]) { 66 if !defined(Package[$package_name]) {
@@ -68,6 +68,7 @@ define trove::generic_service(
68 ensure => $ensure_package, 68 ensure => $ensure_package,
69 name => $package_name, 69 name => $package_name,
70 notify => Service[$trove_title], 70 notify => Service[$trove_title],
71 tag => ['openstack', 'trove-package'],
71 } 72 }
72 } 73 }
73 } 74 }
@@ -86,6 +87,7 @@ define trove::generic_service(
86 name => $service_name, 87 name => $service_name,
87 enable => $enabled, 88 enable => $enabled,
88 hasstatus => true, 89 hasstatus => true,
90 tag => 'trove-service',
89 } 91 }
90 } 92 }
91} 93}
diff --git a/deployment_scripts/puppet/modules/trove/manifests/guestagent.pp b/deployment_scripts/puppet/modules/trove/manifests/guestagent.pp
index f8dcbcc..32c25da 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/guestagent.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/guestagent.pp
@@ -54,6 +54,38 @@
54# (optional) Control exchange. 54# (optional) Control exchange.
55# Defaults to 'trove'. 55# Defaults to 'trove'.
56# 56#
57# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
58# [*rabbit_hosts*]
59# (optional) List of clustered rabbit servers.
60# Defaults to the value set in the trove class.
61# The default can generally be left unless the
62# guests need to talk to the rabbit cluster via
63# different IPs.
64#
65# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
66# [*rabbit_host*]
67# (optional) Location of rabbitmq installation.
68# Defaults to the value set in the trove class.
69# The default can generally be left unless the
70# guests need to talk to the rabbit cluster via
71# a different IP.
72#
73# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
74# [*rabbit_port*]
75# (optional) Port for rabbitmq instance.
76# Defaults to the value set in the trove class.
77# The default can generally be left unless the
78# guests need to talk to the rabbit cluster via
79# a different port.
80#
81# TODO(shaikapsar): remove this once bug/1585783 merged to stable/liberty.
82# [*rabbit_use_ssl*]
83# (optional) Connect over SSL for RabbitMQ
84# Defaults to the value set in the trove class.
85# The default can generally be left unless the
86# guests need to talk to the rabbit cluster via
87# a different ssl connection option.
88#
57class trove::guestagent( 89class trove::guestagent(
58 $enabled = true, 90 $enabled = true,
59 $manage_service = true, 91 $manage_service = true,
@@ -66,57 +98,91 @@ class trove::guestagent(
66 $log_facility = 'LOG_USER', 98 $log_facility = 'LOG_USER',
67 $auth_url = 'http://localhost:5000/v2.0', 99 $auth_url = 'http://localhost:5000/v2.0',
68 $swift_url = 'http://localhost:8080/v1/AUTH_', 100 $swift_url = 'http://localhost:8080/v1/AUTH_',
69 $control_exchange = 'trove' 101 $control_exchange = 'trove',
102 # TODO(shaikapsar): remove the below 4lines once bug/1585783 merged to stable/liberty.
103 $rabbit_hosts = $::trove::rabbit_hosts,
104 $rabbit_host = $::trove::rabbit_host,
105 $rabbit_port = $::trove::rabbit_port,
106 $rabbit_use_ssl = $::trove::rabbit_use_ssl,
70) inherits trove { 107) inherits trove {
71 108
72 include ::trove::params 109 include ::trove::params
73 110
74 Trove_guestagent_config<||> ~> Exec['post-trove_config'] 111 Trove_guestagent_config<||> ~> Exec['post-trove_config']
75 Trove_guestagent_config<||> ~> Service['trove-guestagent'] 112 Trove_guestagent_config<||> ~> Service['trove-guestagent']
76 # Trove db sync is broken in Ubuntu packaging
77 # This is a temporary fix until it's fixed in packaging.
78 # https://bugs.launchpad.net/ubuntu/+source/openstack-trove/+bug/1451134
79 file { '/etc/trove/trove-guestagent.conf':
80 require => File['/etc/trove'],
81 }
82 File['/etc/trove/trove-guestagent.conf'] -> Trove_guestagent_config<||>
83 Trove_guestagent_config<||> -> Package[$::trove::params::guestagent_package_name]
84 113
85 # basic service config 114 # basic service config
86 trove_guestagent_config { 115 trove_guestagent_config {
87 'DEFAULT/verbose': value => $verbose; 116 'DEFAULT/verbose': value => $verbose;
88 'DEFAULT/debug': value => $debug; 117 'DEFAULT/debug': value => $debug;
89 'DEFAULT/trove_auth_url': value => $auth_url;
90 'DEFAULT/swift_url': value => $swift_url;
91 'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
92 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
93 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
94 'DEFAULT/control_exchange': value => $control_exchange; 118 'DEFAULT/control_exchange': value => $control_exchange;
119 'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
120 }
121
122 # (shaikapsar): Option to fetch auth_url and swift_url from the keystone catalog.
123
124 # auth_url
125 if $auth_url {
126 trove_guestagent_config { 'DEFAULT/trove_auth_url': value => $auth_url }
127 }
128 else {
129 trove_guestagent_config { 'DEFAULT/trove_auth_url': ensure => absent }
130 }
131
132 # swift_url
133 if $swift_url {
134 trove_guestagent_config { 'DEFAULT/swift_url': value => $swift_url }
135 }
136 else {
137 trove_guestagent_config { 'DEFAULT/swift_url': ensure => absent }
95 } 138 }
96 139
97 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' { 140 # region name
98 if ! $::trove::rabbit_password { 141 if $::trove::os_region_name {
142 trove_guestagent_config { 'DEFAULT/os_region_name': value => $::trove::os_region_name }
143 }
144 else {
145 trove_guestagent_config {'DEFAULT/os_region_name': ensure => absent }
146 }
147
148 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
149 if ! $::trove::rabbit_password {
99 fail('When rpc_backend is rabbitmq, you must set rabbit password') 150 fail('When rpc_backend is rabbitmq, you must set rabbit password')
100 } 151 }
101 if $::trove::rabbit_hosts { 152
102 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } 153 # TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
103 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } 154 if $rabbit_hosts {
155 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => $rabbit_hosts }
104 } else { 156 } else {
105 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } 157 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
106 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } 158 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
107 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } 159 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
108 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false } 160 }
161
162 if $::trove::rabbit_ha_queues == undef {
163 # TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
164 if size($rabbit_hosts) > 1 {
165 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
166 } else {
167 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
168 }
169 } else {
170 trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
109 } 171 }
110 172
111 trove_guestagent_config { 173 trove_guestagent_config {
112 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_user; 174 'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
113 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true; 175 'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
114 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host; 176 'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
115 'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl; 177 # TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
178 'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
116 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay; 179 'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
180 # TODO(shaikapsar): remove the below lines once bug/1486319 merged to stable/liberty.
181 'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
117 } 182 }
118 183
119 if $::trove::rabbit_use_ssl { 184 # TODO(shaikapsar): remove the below lines once bug/1585783 merged to stable/liberty.
185 if $rabbit_use_ssl {
120 186
121 if $::trove::kombu_ssl_ca_certs { 187 if $::trove::kombu_ssl_ca_certs {
122 trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; } 188 trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
@@ -152,19 +218,22 @@ class trove::guestagent(
152 } 218 }
153 } 219 }
154 220
155 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' { 221 if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_qpid' or $::trove::rpc_backend == 'qpid'{
222
223 warning('Qpid driver is removed from Oslo.messaging in the Mitaka release')
224
156 trove_guestagent_config { 225 trove_guestagent_config {
157 'DEFAULT/qpid_hostname': value => $::trove::qpid_hostname; 226 'oslo_messaging_qpid/qpid_hostname': value => $::trove::qpid_hostname;
158 'DEFAULT/qpid_port': value => $::trove::qpid_port; 227 'oslo_messaging_qpid/qpid_port': value => $::trove::qpid_port;
159 'DEFAULT/qpid_username': value => $::trove::qpid_username; 228 'oslo_messaging_qpid/qpid_username': value => $::trove::qpid_username;
160 'DEFAULT/qpid_password': value => $::trove::qpid_password, secret => true; 229 'oslo_messaging_qpid/qpid_password': value => $::trove::qpid_password, secret => true;
161 'DEFAULT/qpid_heartbeat': value => $::trove::qpid_heartbeat; 230 'oslo_messaging_qpid/qpid_heartbeat': value => $::trove::qpid_heartbeat;
162 'DEFAULT/qpid_protocol': value => $::trove::qpid_protocol; 231 'oslo_messaging_qpid/qpid_protocol': value => $::trove::qpid_protocol;
163 'DEFAULT/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay; 232 'oslo_messaging_qpid/qpid_tcp_nodelay': value => $::trove::qpid_tcp_nodelay;
164 } 233 }
165 if is_array($::trove::qpid_sasl_mechanisms) { 234 if is_array($::trove::qpid_sasl_mechanisms) {
166 trove_guestagent_config { 235 trove_guestagent_config {
167 'DEFAULT/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' '); 236 'oslo_messaging_qpid/qpid_sasl_mechanisms': value => join($::trove::qpid_sasl_mechanisms, ' ');
168 } 237 }
169 } 238 }
170 } 239 }
diff --git a/deployment_scripts/puppet/modules/trove/manifests/init.pp b/deployment_scripts/puppet/modules/trove/manifests/init.pp
index bc1b45b..ebed9f8 100644
--- a/deployment_scripts/puppet/modules/trove/manifests/init.pp
+++ b/deployment_scripts/puppet/modules/trove/manifests/init.pp
@@ -77,6 +77,10 @@
77# available on some distributions. 77# available on some distributions.
78# Defaults to 'TLSv1' 78# Defaults to 'TLSv1'
79# 79#
80# [*rabbit_ha_queues*]
81# (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
82# Defaults to undef
83#
80# [*amqp_durable_queues*] 84# [*amqp_durable_queues*]
81# (optional) Define queues as "durable" to rabbitmq. 85# (optional) Define queues as "durable" to rabbitmq.
82# Defaults to false 86# Defaults to false
@@ -115,9 +119,9 @@
115# 119#
116# [*rpc_backend*] 120# [*rpc_backend*]
117# (optional) The rpc backend implementation to use, can be: 121# (optional) The rpc backend implementation to use, can be:
118# trove.openstack.common.rpc.impl_kombu (for rabbitmq) 122# rabbit (for rabbitmq)
119# trove.openstack.common.rpc.impl_qpid (for qpid) 123# qpid (for qpid)
120# Defaults to 'trove.openstack.common.rpc.impl_kombu' 124# Defaults to 'rabbit'
121# 125#
122# [*mysql_module*] 126# [*mysql_module*]
123# (optional) Deprecated. Does nothing. 127# (optional) Deprecated. Does nothing.
@@ -125,11 +129,32 @@
125# 129#
126# [*database_connection*] 130# [*database_connection*]
127# (optional) Connection url to connect to trove database. 131# (optional) Connection url to connect to trove database.
128# Defaults to 'sqlite:////var/lib/trove/trove.sqlite' 132# Defaults to undef.
129# 133#
130# [*database_idle_timeout*] 134# [*database_idle_timeout*]
131# (optional) Timeout before idle db connections are reaped. 135# (optional) Timeout before idle db connections are reaped.
132# Defaults to 3600 136# Defaults to undef.
137#
138# [*database_max_retries*]
139# (optional) Maximum number of database connection retries during startup.
140# Setting -1 implies an infinite retry count.
141# Defaults to undef.
142#
143# [*database_retry_interval*]
144# (optional) Interval between retries of opening a database connection.
145# Defaults to undef.
146#
147# [*database_min_pool_size*]
148# (optional) Minimum number of SQL connections to keep open in a pool.
149# Defaults to: undef.
150#
151# [*database_max_pool_size*]
152# (optional) Maximum number of SQL connections to keep open in a pool.
153# Defaults to: undef.
154#
155# [*database_max_overflow*]
156# (optional) If set, use this value for max_overflow with sqlalchemy.
157# Defaults to: undef.
133# 158#
134# [*nova_compute_url*] 159# [*nova_compute_url*]
135# (optional) URL without the tenant segment. 160# (optional) URL without the tenant segment.
@@ -158,6 +183,37 @@
158# (optional) Swift URL ending in AUTH_. 183# (optional) Swift URL ending in AUTH_.
159# Defaults to false. 184# Defaults to false.
160# 185#
186# [*neutron_url*]
187# (optional) Cinder URL without the tenant segment.
188# Defaults to false.
189#
190# [*os_region_name*]
191# (optional) Sets the os_region_name flag. For environments with
192# more than one endpoint per service. If you don't set this and
193# you have multiple endpoints, you will get Ambiguous Endpoint
194# exceptions in the trove API service.
195# Defaults to undef.
196#
197# [*nova_compute_service_type*]
198# (optional) Nova service type to use when searching catalog.
199# Defaults to 'compute'.
200#
201# [*cinder_service_type*]
202# (optional) Cinder service type to use when searching catalog.
203# Defaults to 'volumev2'.
204#
205# [*swift_service_type*]
206# (optional) Swift service type to use when searching catalog.
207# Defaults to 'object-store'.
208#
209# [*heat_service_type*]
210# (optional) Heat service type to use when searching catalog.
211# Defaults to 'orchestration'.
212#
213# [*neutron_service_type*]
214# (optional) Neutron service type to use when searching catalog.
215# Defaults to 'network'.
216#
161# [*use_neutron*] 217# [*use_neutron*]
162# (optional) Use Neutron 218# (optional) Use Neutron
163# Defaults to true 219# Defaults to true
@@ -169,27 +225,48 @@
169class trove( 225class trove(
170 $nova_proxy_admin_pass, 226 $nova_proxy_admin_pass,
171 $rabbit_host = 'localhost', 227 $rabbit_host = 'localhost',
172 $rabbit_hosts = false, 228 $rabbit_hosts = undef,
173 $rabbit_password = 'guest', 229 $rabbit_password = 'guest',
174 $rabbit_port = '5672', 230 $rabbit_port = '5672',
175 $rabbit_userid = 'guest', 231 $rabbit_userid = 'guest',
176 $rabbit_virtual_host = '/', 232 $rabbit_virtual_host = '/',
177 $rabbit_use_ssl = false, 233 $rabbit_use_ssl = false,
234 $rabbit_ha_queues = undef,
178 $rabbit_notification_topic = 'notifications', 235 $rabbit_notification_topic = 'notifications',
179 $kombu_ssl_ca_certs = undef, 236 $kombu_ssl_ca_certs = undef,
180 $kombu_ssl_certfile = undef, 237 $kombu_ssl_certfile = undef,
181 $kombu_ssl_keyfile = undef, 238 $kombu_ssl_keyfile = undef,
182 $kombu_ssl_version = 'TLSv1', 239 $kombu_ssl_version = 'TLSv1',
183 $amqp_durable_queues = false, 240 $amqp_durable_queues = false,
184 $database_connection = 'sqlite:////var/lib/trove/trove.sqlite', 241 $qpid_hostname = 'localhost',
185 $database_idle_timeout = 3600, 242 $qpid_port = '5672',
186 $rpc_backend = 'trove.openstack.common.rpc.impl_kombu', 243 $qpid_username = 'guest',
244 $qpid_password = 'guest',
245 $qpid_sasl_mechanisms = false,
246 $qpid_heartbeat = 60,
247 $qpid_protocol = 'tcp',
248 $qpid_tcp_nodelay = true,
249 $database_connection = undef,
250 $database_idle_timeout = undef,
251 $database_max_retries = undef,
252 $database_retry_interval = undef,
253 $database_min_pool_size = undef,
254 $database_max_pool_size = undef,
255 $database_max_overflow = undef,
256 $rpc_backend = 'rabbit',
187 $nova_compute_url = false, 257 $nova_compute_url = false,
188 $nova_proxy_admin_user = 'admin', 258 $nova_proxy_admin_user = 'admin',
189 $nova_proxy_admin_tenant_name = 'admin', 259 $nova_proxy_admin_tenant_name = 'admin',
190 $control_exchange = 'trove', 260 $control_exchange = 'trove',
191 $cinder_url = false, 261 $cinder_url = false,
192 $swift_url = false, 262 $swift_url = false,
263 $neutron_url = false,
264 $os_region_name = undef,
265 $nova_compute_service_type = 'compute',
266 $cinder_service_type = 'volumev2',
267 $swift_service_type = 'object-store',
268 $heat_service_type = 'orchestration',
269 $neutron_service_type = 'network',
193 $use_neutron = true, 270 $use_neutron = true,
194 $package_ensure = 'present', 271 $package_ensure = 'present',
195 # DEPRECATED PARAMETERS 272 # DEPRECATED PARAMETERS
@@ -229,31 +306,16 @@ class trove(
229 trove_config { 'DEFAULT/swift_url': ensure => absent } 306 trove_config { 'DEFAULT/swift_url': ensure => absent }
230 } 307 }
231 308
232 if $::osfamily == 'RedHat' { 309 if $neutron_url {
233 # TO-DO(mmagr): Conditional should be removed as soon as following bug 310 trove_config { 'DEFAULT/neutron_url': value => $neutron_url }
234 # is really fixed. On Ubuntu trove-common is not installable without already
235 # running database and correctly filled trove.conf:
236 # https://bugs.launchpad.net/ubuntu/+source/openstack-trove/+bug/1365561
237 package { 'trove':
238 ensure => $package_ensure,
239 name => $::trove::params::common_package_name
240 }
241 $group_require = Package['trove']
242 } else {
243 $group_require = undef
244 } 311 }
245 312 else {
246 group { 'trove': 313 trove_config { 'DEFAULT/neutron_url': ensure => absent }
247 ensure => 'present',
248 name => 'trove',
249 system => true,
250 require => $group_require
251 } 314 }
252 315
253 file { '/etc/trove/': 316 package { 'trove':
254 ensure => directory, 317 ensure => $package_ensure,
255 group => 'trove', 318 name => $::trove::params::common_package_name,
256 require => Group['trove'] 319 tag => ['openstack', 'trove-package'],
257 } 320 }
258