Puppet Function: include_all_projects

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

Overview

include_all_projects()Any

Returns:

  • (Any)


2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/puppet/parser/functions/include_all_projects.rb', line 2

newfunction(:include_all_projects) do |args|
  Puppet::Parser::Functions.function('include')

  repo = "#{Facter[:boxen_home].value}/repo"
  Dir["#{repo}/modules/projects/manifests/*.pp"].each do |project|
    class_name = project.split('/').last

    next if class_name =~ /all\.pp$/

    function_include [class_name.gsub(/\.pp$/, '')]
  end
end