From 8e18c759111c649059d25520afa4dbf2a9c9cf08 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 27 Oct 2011 23:28:10 +0200 Subject: add admin_user define with trocla --- manifests/admin_user.pp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 manifests/admin_user.pp (limited to 'manifests/admin_user.pp') 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}"], + } +} -- cgit v1.2.3