summaryrefslogtreecommitdiff
path: root/manifests/onionbalance/key.pp
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2018-11-07 15:43:41 +0100
committerkwadronaut <kwadronaut@leap.se>2018-11-07 15:43:41 +0100
commite598088c2f9263e7682e399b65376d7a2c529ded (patch)
treeaa628edf0ad55dc2adea8bc6f96bf516aaba0a30 /manifests/onionbalance/key.pp
parentd30831f7214da266ad943cf4013f0632e8b15d48 (diff)
parent77070c6bf97ecd6fc860cae6120dca86fa910e5a (diff)
Merge remote-tracking branch 'shared/master'HEADmaster
Diffstat (limited to 'manifests/onionbalance/key.pp')
-rw-r--r--manifests/onionbalance/key.pp25
1 files changed, 25 insertions, 0 deletions
diff --git a/manifests/onionbalance/key.pp b/manifests/onionbalance/key.pp
new file mode 100644
index 0000000..e0016fc
--- /dev/null
+++ b/manifests/onionbalance/key.pp
@@ -0,0 +1,25 @@
+# manage onionbalance keys
+#
+# key_content will be treated as path
+# to a file containing the key content
+# if the value starts with a /
+#
+define tor::onionbalance::key(
+ $key_content,
+ $group,
+){
+
+ if $key_content =~ /^\// {
+ $content = file($key_content)
+ } else {
+ $content = $key_content
+ }
+ Package<| tag == 'onionbalance' |> -> file{
+ "/etc/onionbalance/${name}.key":
+ content => $content,
+ owner => root,
+ group => $group,
+ mode => '0640',
+ notify => Service['onionbalance'];
+ }
+}