Class: PuppetCommand
- Inherits:
-
Object
- Object
- PuppetCommand
- Defined in:
- lib/kafo/puppet_command.rb
Instance Method Summary collapse
- #append(suffix) ⇒ Object
- #command ⇒ Object
-
#initialize(command, options = []) ⇒ PuppetCommand
constructor
A new instance of PuppetCommand.
Constructor Details
#initialize(command, options = []) ⇒ PuppetCommand
Returns a new instance of PuppetCommand.
3 4 5 6 7 |
# File 'lib/kafo/puppet_command.rb', line 3 def initialize(command, = []) @command = command @options = .push("--modulepath #{modules_path}") @logger = Logging.logger.root end |
Instance Method Details
#append(suffix) ⇒ Object
25 26 27 28 |
# File 'lib/kafo/puppet_command.rb', line 25 def append(suffix) @suffix = suffix self end |
#command ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kafo/puppet_command.rb', line 9 def command custom_answer_file = if KafoConfigure.temp_config_file.nil? '' else "$kafo_answer_file=\"#{KafoConfigure.temp_config_file}\"" end result = [ "echo '$kafo_config_file=\"#{KafoConfigure.config_file}\" #{custom_answer_file} #{@command}'", " | ", "puppet apply #{@options.join(' ')} #{@suffix}" ].join @logger.debug result result end |