Skip to content

Commit 3a5bd6d

Browse files
committed
Merge pull request #151 from jguiditta/juno_galera
Update puppet-galera to latest master.
2 parents 89773d3 + 57795a8 commit 3a5bd6d

File tree

6 files changed

+85
-56
lines changed

6 files changed

+85
-56
lines changed

Puppetfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod 'firewall',
2727
:git => 'https://github.com/puppetlabs/puppetlabs-firewall.git'
2828

2929
mod 'galera',
30-
:commit => 'a63ab112aabdc9faa5e66fc095ef9dcc865d6999',
30+
:commit => 'f7d4110886b643eb63dc5c347a0e8a06b09642e7',
3131
:git => 'https://github.com/rohara/puppet-galera.git'
3232

3333
mod 'glance',

galera/Modulefile

Lines changed: 0 additions & 11 deletions
This file was deleted.

galera/manifests/monitor.pp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@
2020
# }
2121
#
2222
class galera::monitor (
23-
$mysql_username = 'monitor_user',
24-
$mysql_password = 'monitor_pass',
25-
$mysql_host = '127.0.0.1',
26-
$mysql_port = '3306',
27-
$monitor_port = '9200',
28-
$monitor_script = '/usr/bin/clustercheck',
29-
$enabled = true,
23+
$mysql_username = 'monitor_user',
24+
$mysql_password = 'monitor_pass',
25+
$mysql_host = '127.0.0.1',
26+
$mysql_port = '3306',
27+
$monitor_port = '9200',
28+
$monitor_script = '/usr/bin/clustercheck',
29+
$enabled = true,
30+
$create_mysql_user = false,
3031
) {
3132

32-
Class['galera::server'] -> Class['galera::monitor']
33-
3433
if $enabled {
3534
$monitor_disable = 'no'
3635
} else {
@@ -57,9 +56,11 @@
5756
log_on_failure_operator => '=',
5857
}
5958

60-
database_user { "${mysql_username}@${mysql_host}":
61-
ensure => present,
62-
password_hash => mysql_password($mysql_password),
63-
require => [File['/root/.my.cnf'],Service['galera']],
59+
if $create_mysql_user {
60+
mysql_user { "${mysql_username}@${mysql_host}":
61+
ensure => present,
62+
password_hash => mysql_password($mysql_password),
63+
require => [File['/root/.my.cnf'],Service['galera']],
64+
}
6465
}
6566
}

galera/manifests/server.pp

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# manages the package, service, galera.cnf
55
#
66
# Parameters:
7-
# [*config_hash*] - Hash of config parameters that need to be set.
7+
# [*msyql_server_hash*] - Hash of mysql server parameters.
88
# [*bootstrap*] - Defaults to false, boolean to set cluster boostrap.
99
# [*package_name*] - The name of the galera package.
1010
# [*package_ensure*] - Ensure state for package. Can be specified as version.
@@ -42,15 +42,13 @@
4242
# }
4343
#
4444
class galera::server (
45-
$config_hash = {},
45+
$mysql_server_hash = {},
4646
$bootstrap = false,
4747
$debug = false,
48-
$package_name = 'mariadb-galera-server',
49-
$package_ensure = 'present',
50-
$service_name = $mysql::params::service_name,
48+
$service_name = 'mariadb',
5149
$service_enable = true,
5250
$service_ensure = 'running',
53-
$service_provider = $mysql::params::service_provider,
51+
$manage_service = false,
5452
$wsrep_bind_address = '0.0.0.0',
5553
$wsrep_node_address = undef,
5654
$wsrep_provider = '/usr/lib64/galera/libgalera_smm.so',
@@ -62,16 +60,11 @@
6260
$wsrep_ssl = false,
6361
$wsrep_ssl_key = undef,
6462
$wsrep_ssl_cert = undef,
65-
) inherits mysql {
63+
) {
6664

67-
$config_class = { 'mysql::config' => $config_hash }
65+
$mysql_server_class = { 'mysql::server' => $mysql_server_hash }
6866

69-
create_resources( 'class', $config_class )
70-
71-
package { 'galera':
72-
name => $package_name,
73-
ensure => $package_ensure,
74-
}
67+
create_resources( 'class', $mysql_server_class )
7568

7669
$wsrep_provider_options = wsrep_options({
7770
'socket.ssl' => $wsrep_ssl,
@@ -87,16 +80,15 @@
8780
owner => 'root',
8881
group => 'root',
8982
content => template('galera/wsrep.cnf.erb'),
90-
notify => Service['galera'],
83+
notify => Service[$service_name],
9184
}
9285

93-
Service['galera'] -> Exec<| title == 'set_mysql_rootpw' |>
94-
95-
service { 'galera':
96-
name => $service_name,
97-
enable => $service_enable,
98-
ensure => $service_ensure,
99-
require => Package['galera'],
100-
provider => $service_provider,
86+
if $manage_service {
87+
service { 'galera':
88+
name => $service_name,
89+
name => 'mysqld', # short-term hack to see if it works
90+
enable => $service_enable,
91+
ensure => $service_ensure,
92+
}
10193
}
10294
}

galera/metadata.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "puppet-galera",
3+
"version": "0.0.2",
4+
"author": "Ryan O\'Hara",
5+
"summary": "Install/Configure MariaDB with galera",
6+
"license": "Apache 2.0",
7+
"source": "git://github.com/redhat-openstack/puppet-galera.git",
8+
"project_page": "https://github.com/redhat-openstack/puppet-galera",
9+
"operatingsystem_support": [
10+
{
11+
"operatingsystem": "RedHat",
12+
"operatingsystemrelease": [
13+
"5",
14+
"6",
15+
"7"
16+
]
17+
},
18+
{
19+
"operatingsystem": "CentOS",
20+
"operatingsystemrelease": [
21+
"5",
22+
"6",
23+
"7"
24+
]
25+
},
26+
{
27+
"operatingsystem": "Scientific",
28+
"operatingsystemrelease": [
29+
"5",
30+
"6",
31+
"7"
32+
]
33+
},
34+
],
35+
"requirements": [
36+
{
37+
"name": "pe",
38+
"version_requirement": "3.x"
39+
},
40+
{
41+
"name": "puppet",
42+
"version_requirement": "3.x"
43+
}
44+
],
45+
"description": "Install/Configure MariaDB with Galera",
46+
"dependencies": [
47+
{"name":"puppetlabs/stdlib","version_requirement":">= 2.4.0"},
48+
{"name":"puppetlabs/mysql","version_requirement":">= 2.3.1"},
49+
{"name":"puppetlabs/xinetd","version_requirement":">= 1.2.0"}
50+
]
51+
}

galera/templates/wsrep.cnf.erb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ innodb_autoinc_lock_mode=2
2525
innodb_locks_unsafe_for_binlog=1
2626

2727
# Query Cache is not supported with wsrep
28-
query_cache_size=0
28+
#### query_cache_size=0 now in server.cnf
2929
query_cache_type=0
3030

3131
# Override bind-address
@@ -46,13 +46,6 @@ wsrep_provider_options="<%= @wsrep_provider_options.join '; ' %>"
4646
# Logical cluster name. Should be the same for all nodes.
4747
wsrep_cluster_name="<%= @wsrep_cluster_name %>"
4848

49-
# Group communication system handle
50-
<% if @bootstrap -%>
51-
wsrep_cluster_address="gcomm://"
52-
<% elsif !@wsrep_cluster_members.empty? -%>
53-
wsrep_cluster_address="gcomm://<%= @wsrep_cluster_members.join ',' %>"
54-
<% end -%>
55-
5649
# Human-readable node name (non-unique). Hostname by default.
5750
#wsrep_node_name=
5851

@@ -125,6 +118,7 @@ wsrep_sst_method=<%= @wsrep_sst_method %>
125118

126119
# SST authentication string. This will be used to send SST to joining nodes.
127120
# Depends on SST method. For mysqldump method it is root:<root password>
121+
# Below is ignored if using rsync for wsrep_sst_method
128122
wsrep_sst_auth=<%= @wsrep_sst_username %>:<%= @wsrep_sst_password %>
129123

130124
# Desired SST donor name.
@@ -135,3 +129,5 @@ wsrep_sst_auth=<%= @wsrep_sst_username %>:<%= @wsrep_sst_password %>
135129

136130
# Protocol version to use
137131
# wsrep_protocol_version=
132+
133+
skip-name-resolve=1

0 commit comments

Comments
 (0)