Minor changes. Added placeholder for :doc in Puppet's newfunction to fill later.
This commit is contained in:
parent
e1bb7393bb
commit
55c94178eb
3 changed files with 16 additions and 12 deletions
|
@ -67,7 +67,7 @@ This will result in a variable $foo being added and ready for use.
|
|||
end
|
||||
|
||||
data.each { |param, value| setvar(param, strinterp(value)) }
|
||||
end # def newfunction
|
||||
end # module Puppet::Parser::Functions
|
||||
end
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 et :
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
# persistent_crontab_minutes.rb
|
||||
#
|
||||
|
||||
require 'md5'
|
||||
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:persistent_crontab_minutes, :type => :rvalue) do |arguments|
|
||||
newfunction(:persistent_crontab_minutes, :type => :rvalue, :doc => <<-EOS
|
||||
EOS
|
||||
) do |arguments|
|
||||
|
||||
raise(Puppet::ParseError, "Wrong number of arguments " +
|
||||
"given (#{arguments.size} for 2)") if arguments.size < 2
|
||||
|
||||
require 'md5'
|
||||
|
||||
value = 0
|
||||
|
||||
job = arguments[0]
|
||||
|
@ -55,7 +57,7 @@ module Puppet::Parser::Functions
|
|||
parser.watch_file(file) if File.exists?(file)
|
||||
|
||||
return value
|
||||
end # def newfunction
|
||||
end # module Puppet::Parser::Functions
|
||||
end
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 et :
|
||||
|
|
|
@ -2,14 +2,16 @@
|
|||
# random_crontab_minutes.rb
|
||||
#
|
||||
|
||||
require 'md5'
|
||||
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:random_crontab_minutes, :type => :rvalue) do |arguments|
|
||||
newfunction(:random_crontab_minutes, :type => :rvalue, :doc => <<-EOS
|
||||
EOS
|
||||
) do |arguments|
|
||||
|
||||
raise(Puppet::ParseError, "Wrong number of arguments " +
|
||||
"given (#{arguments.size} for 2)") if arguments.size < 2
|
||||
|
||||
require 'md5'
|
||||
|
||||
job_name = arguments[0]
|
||||
host = arguments[1]
|
||||
|
||||
|
@ -23,7 +25,7 @@ module Puppet::Parser::Functions
|
|||
value = value < 60 ? value : 59
|
||||
|
||||
return value
|
||||
end # def newfunction
|
||||
end # module Puppet::Parser::Functions
|
||||
end
|
||||
end
|
||||
|
||||
# vim: set ts=2 sw=2 et :
|
||||
|
|
Loading…
Reference in a new issue