# File lib/kafo/puppet_command.rb, line 3 def initialize(command, options = []) @command = command # Expand the modules_path to work around the fact that Puppet doesn't # allow modulepath to contain relative (i.e ..) directory references as # of 2.7.23. @options = options.push("--modulepath #{File.expand_path(modules_path)}") @logger = KafoConfigure.logger end
# File lib/kafo/puppet_command.rb, line 17 def add_progress KafoConfigure.verbose ? '' : "$kafo_add_progress=true" end
# File lib/kafo/puppet_command.rb, line 32 def append(suffix) @suffix = suffix self end
# File lib/kafo/puppet_command.rb, line 21 def command result = [ "echo '$kafo_config_file=\"#{KafoConfigure.config_file}\" #{custom_answer_file} #{add_progress} #{@command}'", '|', "RUBYLIB=#{["#{KafoConfigure.gem_root}/modules", ::ENV['RUBYLIB']].join(File::PATH_SEPARATOR)}", "puppet apply #{@options.join(' ')} #{@suffix}", ].join(' ') @logger.debug result result end
# File lib/kafo/puppet_command.rb, line 13 def custom_answer_file KafoConfigure.temp_config_file.nil? ? '' : "$kafo_answer_file=\"#{KafoConfigure.temp_config_file}\"" end