From 777327c2a2a21004f156f8e2f988c8ad1ff5f29b Mon Sep 17 00:00:00 2001 From: Martin Zobel-Helas Date: Sun, 31 May 2015 19:38:41 +0000 Subject: [PATCH] add pubsub::autouser Signed-off-by: Martin Zobel-Helas --- modules/pubsub/manifest/autouser.pp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 modules/pubsub/manifest/autouser.pp 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 => '.*', + } +} + -- 2.20.1