Module: Ronin::Puppet
- Defined in:
- lib/ronin/puppet.rb
Class Method Summary collapse
Class Method Details
.clean_up ⇒ Object
46 47 48 49 |
# File 'lib/ronin/puppet.rb', line 46 def clean_up Ronin::Log.info("Cleaning up Puppet run list at #{@run_list}.") File.delete(@run_list) end |
.create_run_list ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/ronin/puppet.rb', line 26 def create_run_list Ronin::Log.info("Building Puppet run list at #{@run_list}.") File.open(@run_list, "w") do |f| @modules.each do |mod| Ronin::Log.info("Adding module '#{mod}' to run list.") f.write "include #{mod}\n" end end end |
.run ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/ronin/puppet.rb', line 37 def run self.create_run_list Ronin::Log.info("Running Puppet, logging puppet output to #{Ronin::Config[:log_path]}/ronin-puppet.log.") @cmd = Mixlib::ShellOut.new("puppet apply --verbose --ordering manifest --logdest #{Ronin::Config[:log_path]}/ronin-puppet.log --modulepath #{Ronin::Config[:module_path]} #{@run_list}") @cmd.run_command self.clean_up end |