diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/admin_user.pp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/admin_user.pp b/manifests/admin_user.pp new file mode 100644 index 0000000..5b09122 --- /dev/null +++ b/manifests/admin_user.pp @@ -0,0 +1,19 @@ +# generate hashed password with: +# ruby -r'digest/sha1' -e 'puts "*" + Digest::SHA1.hexdigest(Digest::SHA1.digest(ARGV[0])).upcase' PASSWORD +define mysql::admin_user( + $ensure = present, + $host = '127.0.0.1', + $password +){ + mysql_user{"${name}@${host}": + ensure => $ensure, + password_hash => $password ? { + 'trocla' => trocla("mysql_admin-user_${name}",'mysql'), + default => $password, + }, + } + mysql_grant{"${name}@${host}": + privileges => 'all', + require => Mysql_user["${name}@${host}"], + } +} |