Class: Bolt::Task::PuppetServer

Inherits:
Bolt::Task show all
Defined in:
lib/bolt/task/puppet_server.rb

Constant Summary

Constants inherited from Bolt::Task

ENVIRONMENT_METHODS, METADATA_KEYS, STDIN_METHODS

Instance Attribute Summary

Attributes inherited from Bolt::Task

#files, #metadata, #mtime, #name, #remote

Instance Method Summary collapse

Methods inherited from Bolt::Task

#add_mtimes, #description, #eql?, from_task_signature, #implementations, #module_name, #parameter_defaults, #parameters, #select_implementation, #supports_noop, #tasks_dir, #to_h, #validate_metadata

Constructor Details

#initialize(name, metadata, files, file_cache, remote = false) ⇒ PuppetServer

Returns a new instance of PuppetServer.



10
11
12
13
14
# File 'lib/bolt/task/puppet_server.rb', line 10

def initialize(name, , files, file_cache, remote = false)
  super(name, , files, remote)
  @file_cache = file_cache
  update_file_data
end

Instance Method Details

#file_path(file_name) ⇒ Object



21
22
23
24
# File 'lib/bolt/task/puppet_server.rb', line 21

def file_path(file_name)
  file = file_map[file_name]
  file['path'] ||= @file_cache.update_file(file)
end

#remote_instanceObject



6
7
8
# File 'lib/bolt/task/puppet_server.rb', line 6

def remote_instance
  self.class.new(@name, @metadata, @files, @file_cache, true)
end

#update_file_dataObject

puppetserver file entries have ‘filename’ rather then ‘name’



17
18
19
# File 'lib/bolt/task/puppet_server.rb', line 17

def update_file_data
  @files.each { |f| f['name'] = f['filename'] }
end