Class: Ronin::Puppet
- Inherits:
-
Object
- Object
- Ronin::Puppet
- Defined in:
- lib/ronin/puppet.rb
Instance Method Summary collapse
- #clean_up ⇒ Object
- #create_run_list ⇒ Object
-
#initialize ⇒ Puppet
constructor
A new instance of Puppet.
- #run ⇒ Object
Constructor Details
Instance 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
28 29 30 31 32 33 34 35 36 |
# File 'lib/ronin/puppet.rb', line 28 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
38 39 40 41 42 43 44 |
# File 'lib/ronin/puppet.rb', line 38 def run self.create_run_list Ronin::Log.info("Running Puppet, logging to #{Ronin::Config[:interpreter_log_path]}/ronin-puppet.log.") @cmd = Mixlib::ShellOut.new("#{Ronin::Util.find_cmd("puppet")} apply --ordering manifest --logdest #{Ronin::Config[:log_path]}/ronin-puppet.log --modulepath #{Ronin::Config[:artifact_path]} #{@run_list}") @cmd.run_command self.clean_up end |