Class: ReimageCommand
- Inherits:
-
Object
- Object
- ReimageCommand
- Defined in:
- lib/commands/reimage.rb
Overview
require_relative ‘utils’
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
12 13 14 |
# File 'lib/commands/reimage.rb', line 12 def self.synopsis "Reimage a machine via puppet" end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/commands/reimage.rb', line 16 def execute # Parse the options argv = if argv.length < 1 end with_target_vms("puppet") do |machine| @env.ui.info "Removing #{machine.name}'s cert on puppet master", :color => :green argv.each do |target| ssh_cmd(machine, "puppet cert clean #{target}.localdev.livefyre.com", {:error_check => false}) end end with_target_vms(argv) do |machine| @env.ui.info "Destroying #{machine.name}", :color => :green machine.action(:destroy, :force_confirm_destroy => true) machine.action(:up) # this is hack to get around a bug in the vagrant # initialization. # this is the issue on REHL: # https://github.com/mitchellh/vagrant/pull/1577 # cycle_iface machine, "eth1" # ssh_cmd machine, "rm -rf /var/lib/puppet/" # ssh_cmd machine, "/puppet_configs/scripts/ensure_hostname #{machine.name}.localdev.livefyre.com" # @env.ui.info "Installing puppet for #{machine.name}" # ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_installed client" # @env.ui.info "Running puppet on#{machine.name}" # ssh_cmd machine, "/puppet_configs/scripts/ensure_puppet_converged -w" end end |