diff --git a/Puppetfile b/Puppetfile index 8eb7e3b01..acc9b213e 100644 --- a/Puppetfile +++ b/Puppetfile @@ -27,7 +27,7 @@ mod 'firewall', :git => 'https://github.com/puppetlabs/puppetlabs-firewall.git' mod 'galera', - :commit => 'a63ab112aabdc9faa5e66fc095ef9dcc865d6999', + :commit => 'f7d4110886b643eb63dc5c347a0e8a06b09642e7', :git => 'https://github.com/rohara/puppet-galera.git' mod 'glance', diff --git a/galera/Modulefile b/galera/Modulefile deleted file mode 100644 index e03c12a44..000000000 --- a/galera/Modulefile +++ /dev/null @@ -1,11 +0,0 @@ -name 'puppet-galera' -version '0.0.2' -source 'https://github.com/rohara/puppet-galera' -author 'Ryan O\'Hara' -license 'Apache License 2.0' -summary 'Install/configure MariaDB with Galera' -description 'Install/configure MariaDB with Galera' -project_page 'https://github.com/rohara/puppet-galera' - -dependency 'puppetlabs/mysql', '>= 0.5.0' -dependency 'puppetlabs/xinetd', '>= 1.2.0' diff --git a/galera/manifests/monitor.pp b/galera/manifests/monitor.pp index 75deb4d01..d58c986fd 100644 --- a/galera/manifests/monitor.pp +++ b/galera/manifests/monitor.pp @@ -20,17 +20,16 @@ # } # class galera::monitor ( - $mysql_username = 'monitor_user', - $mysql_password = 'monitor_pass', - $mysql_host = '127.0.0.1', - $mysql_port = '3306', - $monitor_port = '9200', - $monitor_script = '/usr/bin/clustercheck', - $enabled = true, + $mysql_username = 'monitor_user', + $mysql_password = 'monitor_pass', + $mysql_host = '127.0.0.1', + $mysql_port = '3306', + $monitor_port = '9200', + $monitor_script = '/usr/bin/clustercheck', + $enabled = true, + $create_mysql_user = false, ) { - Class['galera::server'] -> Class['galera::monitor'] - if $enabled { $monitor_disable = 'no' } else { @@ -57,9 +56,11 @@ log_on_failure_operator => '=', } - database_user { "${mysql_username}@${mysql_host}": - ensure => present, - password_hash => mysql_password($mysql_password), - require => [File['/root/.my.cnf'],Service['galera']], + if $create_mysql_user { + mysql_user { "${mysql_username}@${mysql_host}": + ensure => present, + password_hash => mysql_password($mysql_password), + require => [File['/root/.my.cnf'],Service['galera']], + } } } diff --git a/galera/manifests/server.pp b/galera/manifests/server.pp index 57a1718e8..4474e9431 100644 --- a/galera/manifests/server.pp +++ b/galera/manifests/server.pp @@ -4,7 +4,7 @@ # manages the package, service, galera.cnf # # Parameters: -# [*config_hash*] - Hash of config parameters that need to be set. +# [*msyql_server_hash*] - Hash of mysql server parameters. # [*bootstrap*] - Defaults to false, boolean to set cluster boostrap. # [*package_name*] - The name of the galera package. # [*package_ensure*] - Ensure state for package. Can be specified as version. @@ -42,15 +42,13 @@ # } # class galera::server ( - $config_hash = {}, + $mysql_server_hash = {}, $bootstrap = false, $debug = false, - $package_name = 'mariadb-galera-server', - $package_ensure = 'present', - $service_name = $mysql::params::service_name, + $service_name = 'mariadb', $service_enable = true, $service_ensure = 'running', - $service_provider = $mysql::params::service_provider, + $manage_service = false, $wsrep_bind_address = '0.0.0.0', $wsrep_node_address = undef, $wsrep_provider = '/usr/lib64/galera/libgalera_smm.so', @@ -62,16 +60,11 @@ $wsrep_ssl = false, $wsrep_ssl_key = undef, $wsrep_ssl_cert = undef, -) inherits mysql { +) { - $config_class = { 'mysql::config' => $config_hash } + $mysql_server_class = { 'mysql::server' => $mysql_server_hash } - create_resources( 'class', $config_class ) - - package { 'galera': - name => $package_name, - ensure => $package_ensure, - } + create_resources( 'class', $mysql_server_class ) $wsrep_provider_options = wsrep_options({ 'socket.ssl' => $wsrep_ssl, @@ -87,16 +80,15 @@ owner => 'root', group => 'root', content => template('galera/wsrep.cnf.erb'), - notify => Service['galera'], + notify => Service[$service_name], } - Service['galera'] -> Exec<| title == 'set_mysql_rootpw' |> - - service { 'galera': - name => $service_name, - enable => $service_enable, - ensure => $service_ensure, - require => Package['galera'], - provider => $service_provider, + if $manage_service { + service { 'galera': + name => $service_name, + name => 'mysqld', # short-term hack to see if it works + enable => $service_enable, + ensure => $service_ensure, + } } } diff --git a/galera/metadata.json b/galera/metadata.json new file mode 100644 index 000000000..636b8a4c3 --- /dev/null +++ b/galera/metadata.json @@ -0,0 +1,51 @@ +{ + "name": "puppet-galera", + "version": "0.0.2", + "author": "Ryan O\'Hara", + "summary": "Install/Configure MariaDB with galera", + "license": "Apache 2.0", + "source": "git://github.com/redhat-openstack/puppet-galera.git", + "project_page": "https://github.com/redhat-openstack/puppet-galera", + "operatingsystem_support": [ + { + "operatingsystem": "RedHat", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + { + "operatingsystem": "Scientific", + "operatingsystemrelease": [ + "5", + "6", + "7" + ] + }, + ], + "requirements": [ + { + "name": "pe", + "version_requirement": "3.x" + }, + { + "name": "puppet", + "version_requirement": "3.x" + } + ], + "description": "Install/Configure MariaDB with Galera", + "dependencies": [ + {"name":"puppetlabs/stdlib","version_requirement":">= 2.4.0"}, + {"name":"puppetlabs/mysql","version_requirement":">= 2.3.1"}, + {"name":"puppetlabs/xinetd","version_requirement":">= 1.2.0"} + ] +} diff --git a/galera/templates/wsrep.cnf.erb b/galera/templates/wsrep.cnf.erb index 287584f8a..b471f627d 100644 --- a/galera/templates/wsrep.cnf.erb +++ b/galera/templates/wsrep.cnf.erb @@ -25,7 +25,7 @@ innodb_autoinc_lock_mode=2 innodb_locks_unsafe_for_binlog=1 # Query Cache is not supported with wsrep -query_cache_size=0 +#### query_cache_size=0 now in server.cnf query_cache_type=0 # Override bind-address @@ -46,13 +46,6 @@ wsrep_provider_options="<%= @wsrep_provider_options.join '; ' %>" # Logical cluster name. Should be the same for all nodes. wsrep_cluster_name="<%= @wsrep_cluster_name %>" -# Group communication system handle -<% if @bootstrap -%> -wsrep_cluster_address="gcomm://" -<% elsif !@wsrep_cluster_members.empty? -%> -wsrep_cluster_address="gcomm://<%= @wsrep_cluster_members.join ',' %>" -<% end -%> - # Human-readable node name (non-unique). Hostname by default. #wsrep_node_name= @@ -125,6 +118,7 @@ wsrep_sst_method=<%= @wsrep_sst_method %> # SST authentication string. This will be used to send SST to joining nodes. # Depends on SST method. For mysqldump method it is root: +# Below is ignored if using rsync for wsrep_sst_method wsrep_sst_auth=<%= @wsrep_sst_username %>:<%= @wsrep_sst_password %> # Desired SST donor name. @@ -135,3 +129,5 @@ wsrep_sst_auth=<%= @wsrep_sst_username %>:<%= @wsrep_sst_password %> # Protocol version to use # wsrep_protocol_version= + +skip-name-resolve=1