From: Martin Zobel-Helas Date: Sun, 31 May 2015 19:38:41 +0000 (+0000) Subject: add pubsub::autouser X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=777327c2a2a21004f156f8e2f988c8ad1ff5f29b;p=mirror%2Fdsa-puppet.git add pubsub::autouser Signed-off-by: Martin Zobel-Helas --- diff --git a/modules/pubsub/manifest/autouser.pp b/modules/pubsub/manifest/autouser.pp new file mode 100644 index 000000000..2a27cda6d --- /dev/null +++ b/modules/pubsub/manifest/autouser.pp @@ -0,0 +1,27 @@ +# == Define: pubsub::autouser +# +# Create a user in rabbitmq automatically for debian.org hosts +# Should automatically create a password +# +# === Parameters +# +# === Examples +# +# pubsub::autouser { 'master.debian.org': } +# +define pubsub::autouser () { + + $pubsub_password = hkdf('/etc/puppet/secret', "mq-client-${name}") + + rabbitmq_user { $name: + admin => false, + password => $pubsub_password, + } + + rabbitmq_user_permissions { "${name}@dsa": + configure_permission => '.*', + read_permission => '.*', + write_permission => '.*', + } +} +