puppet: Move zulipsecret into its own file.

Apparently puppet doesn't support declaring multiple functions in the
same file.
This commit is contained in:
Tim Abbott 2016-07-31 16:12:28 -07:00
parent b82230559c
commit ff80daef16
2 changed files with 12 additions and 11 deletions

View File

@ -9,15 +9,4 @@ module Puppet::Parser::Functions
default
end
end
newfunction(:zulipsecret, :type => :rvalue) do |args|
default = args.pop
joined = args.join(" ")
output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result=$?.success?
if result
output.strip()
else
default
end
end
end

View File

@ -0,0 +1,12 @@
module Puppet::Parser::Functions
newfunction(:zulipsecret, :type => :rvalue) do |args|
default = args.pop
joined = args.join(" ")
output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result=$?.success?
if result
output.strip()
else
default
end
end
end