mirror of https://github.com/zulip/zulip.git
puppet: Move zulipsecret into its own file.
Apparently puppet doesn't support declaring multiple functions in the same file.
This commit is contained in:
parent
b82230559c
commit
ff80daef16
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue