Puppet Function: include_projects_from_boxen_cli
  
    - Defined in:
- 
      lib/puppet/parser/functions/include_projects_from_boxen_cli.rb
    
    - Function type:
- Ruby 3.x API
 
Overview
  
  
    
      
        include_projects_from_boxen_cli() ⇒ Any 
      
    
  
  
  
  
  
    
      | 
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 | # File 'lib/puppet/parser/functions/include_projects_from_boxen_cli.rb', line 4
newfunction(:include_projects_from_boxen_cli) do |args|
  Puppet::Parser::Functions.function('include')
  projects_file = "#{Facter[:boxen_repodir].value}/.projects"
  if File.exists?(projects_file) && cli_projects = File.read(projects_file).strip
    cli_projects.split(',').each do |project|
      path = "#{Facter[:boxen_repodir].value}/modules/projects/manifests/#{project}.pp"
      if File.exist?(path)
        warning "Setting up '#{project}'. This can be made permanent by having 'include projects::#{project}' in your personal manifest."
        function_include ["projects::#{project}"]
      else
        warning "Don't know anything about '#{project}'. Help out by defining it at '#{path}'."
      end
    end
  end
  FileUtils.rm_rf(projects_file)
end |