diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-07-27 22:00:14 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-07-27 22:26:17 +0200 |
commit | 706235bc526ed3228dd7307dc737f9415ab4b841 (patch) | |
tree | 38de0a39f7281ee5a99e96df2125bbf059f4a412 /modules/pass | |
parent | Enabled loading of nginx-modules. (diff) | |
download | webdav_server-706235bc526ed3228dd7307dc737f9415ab4b841.tar.gz webdav_server-706235bc526ed3228dd7307dc737f9415ab4b841.tar.xz |
Set up webdav server.
Diffstat (limited to 'modules/pass')
-rw-r--r-- | modules/pass/lib/puppet/functions/pass.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/pass/lib/puppet/functions/pass.rb b/modules/pass/lib/puppet/functions/pass.rb new file mode 100644 index 0000000..176e7e9 --- /dev/null +++ b/modules/pass/lib/puppet/functions/pass.rb @@ -0,0 +1,21 @@ +# require 'open3' + +Puppet::Functions.create_function(:pass) do + dispatch :method do + param 'String', :path + optional_param 'String', :salt + end + + def method(path, salt = path) + # Salt was an attempt to not regenerate the entry every run. + # This however failed, since the command is still run, and puppet + # doesn't diff betwen runs + # -salt #{salt} + # + # TODO fetch passwords in some slightly more portable way + `openssl passwd -apr1 $(sudo -Hu hugo pass #{path})` + # Open3.popen3("sudo -Hu hugo pass #{path}") do |stdin, stdout, stderr, thread| + # stdout.read.chomp + # end + end +end |