Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make WSREP SST user's privileges customizable #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$wsrep_sst_password = $mariadb::params::wsrep_sst_password,
$wsrep_sst_user_tls_options = undef,
$wsrep_sst_user_grant_options = undef,
Array[String] $wresp_sst_user_privileges = $mariadb::params::wresp_sst_user_privileges,
Enum['mariabackup', 'mysqldump', 'rsync', 'rsync_wan', 'xtrabackup', 'xtrabackup-v2'] $wsrep_sst_method = $mariadb::params::wsrep_sst_method, # lint:ignore:140chars
$root_password = $mariadb::params::root_password,
$override_options = {},
Expand Down
1 change: 1 addition & 0 deletions manifests/cluster/auth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
wsrep_sst_password => $mariadb::cluster::wsrep_sst_password,
wsrep_sst_user_tls_options => $mariadb::cluster::wsrep_sst_user_tls_options,
wsrep_sst_user_grant_options => $mariadb::cluster::wsrep_sst_user_grant_options,
wresp_sst_user_privileges => $mariadb::cluster::wresp_sst_user_privileges,
}
}
}
9 changes: 5 additions & 4 deletions manifests/cluster/wsrep_sst_user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

define mariadb::cluster::wsrep_sst_user (
$wsrep_sst_password,
$wsrep_sst_user = $name,
$wsrep_sst_user_tls_options = undef,
$wsrep_sst_user_grant_options = undef,
$wsrep_sst_user = $name,
$wsrep_sst_user_tls_options = undef,
$wsrep_sst_user_grant_options = undef,
Array[String] $wresp_sst_user_privileges = ['ALL'],
) {

mysql_user { $wsrep_sst_user:
Expand All @@ -21,7 +22,7 @@
ensure => present,
user => $wsrep_sst_user,
table => '*.*',
privileges => ['ALL'],
privileges => $wresp_sst_user_privileges,
options => $wsrep_sst_user_grant_options,
}
}
19 changes: 10 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
}

# wsrep patch config
$wsrep_cluster_address = undef
$wsrep_cluster_peers = undef
$wsrep_cluster_port = '4567'
$wsrep_cluster_name = undef
$wsrep_sst_user = 'wsrep_sst'
$wsrep_sst_user_peers = '%'
$wsrep_sst_password = 'UNSET' # lint:ignore:security_password_in_code
$wsrep_sst_method = 'mysqldump'
$root_password = 'UNSET' # lint:ignore:security_password_in_code
$wsrep_cluster_address = undef
$wsrep_cluster_peers = undef
$wsrep_cluster_port = '4567'
$wsrep_cluster_name = undef
$wsrep_sst_user = 'wsrep_sst'
$wsrep_sst_user_peers = '%'
$wsrep_sst_password = 'UNSET' # lint:ignore:security_password_in_code
$wresp_sst_user_privileges = ['ALL']
$wsrep_sst_method = 'mysqldump'
$root_password = 'UNSET' # lint:ignore:security_password_in_code

if ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemrelease, '6.0') >= 0) {
# client.pp
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edestecd-mariadb",
"version": "2.1.2",
"version": "2.1.3",
"author": "Chris Edester",
"summary": "Puppet Module for managing MariaDB",
"license": "GPL-3.0+",
Expand Down