Puppet Function: ensure_directory

Defined in:
puppet/modules/wmflib/lib/puppet/parser/functions/ensure_directory.rb
Function type:
Ruby 3.x API

Overview

ensure_directory()Any

Returns:

  • (Any)


23
24
25
26
27
28
29
30
# File 'puppet/modules/wmflib/lib/puppet/parser/functions/ensure_directory.rb', line 23

newfunction(:ensure_directory, :type => :rvalue, :arity => 1) do |args|
  ensure_param = args.first
  case ensure_param
  when 'present', 'true', true then 'directory'
  when 'absent', 'false', false then ensure_param
  else fail(ArgumentError, "ensure_directory(): invalid argument: '#{ensure_param}'.")
  end
end