Class: Bolt::Plugin::InstallAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/plugin/install_agent.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ InstallAgent

Returns a new instance of InstallAgent.



14
# File 'lib/bolt/plugin/install_agent.rb', line 14

def initialize(*args); end

Instance Method Details

#hooksObject



6
7
8
# File 'lib/bolt/plugin/install_agent.rb', line 6

def hooks
  %i[puppet_library]
end

#nameObject



10
11
12
# File 'lib/bolt/plugin/install_agent.rb', line 10

def name
  'install_agent'
end

#puppet_library(_opts, target, apply_prep) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/bolt/plugin/install_agent.rb', line 16

def puppet_library(_opts, target, apply_prep)
  install_task = apply_prep.get_task("puppet_agent::install")
  service_task = apply_prep.get_task("service", 'action' => 'stop', 'name' => 'puppet')
  proc do
    apply_prep.run_task([target], install_task).first
    apply_prep.set_agent_feature(target)
    apply_prep.run_task([target], service_task, 'action' => 'stop', 'name' => 'puppet').first
    apply_prep.run_task([target], service_task, 'action' => 'disable', 'name' => 'puppet').first
  end
end