Class: Chef::Knife::ClusterSync

Inherits:
Ironfan::Script show all
Defined in:
lib/chef/knife/cluster_sync.rb

Instance Attribute Summary

Attributes included from Ironfan::KnifeCommon

#broker, #problems

Instance Method Summary (collapse)

Methods inherited from Ironfan::Script

#_run, #aggregates?, #prepares?

Methods included from Ironfan::KnifeCommon

#all_computers, #bootstrapper, #configure_dry_run, #confirm_execution, #confirm_or_exit, #die, #discover_computers, #display, #exit_if_unhealthy!, #gemfile, #get_relevant_slice, #get_slice, #has_problem, #healthy?, included, load_deps, #load_ironfan, #pick_apart, #predicate_str, #progressbar_for_threads, #run, #run_bootstrap, #section, #sub_command, #wait_for_ssh

Instance Method Details

- (Boolean) aggregates_on_noop?

Returns:

  • (Boolean)


68
69
70
# File 'lib/chef/knife/cluster_sync.rb', line 68

def aggregates_on_noop?
  true
end

- (Object) perform_execution(target)



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/chef/knife/cluster_sync.rb', line 48

def perform_execution target
  if config[:chef]
    if config[:dry_run]
      ui.info "(can't do a dry-run when syncing to chef -- skipping)"
    else 
      ui.info "Syncing to Chef:"
      target.save :providers => :chef
    end
  else Chef::Log.debug("Skipping sync to chef") ; end

  if config[:cloud] && target.any?(&:machine?)
    ui.info "Syncing to cloud:"
    target.save :providers => :iaas
  else Chef::Log.debug("Skipping sync to cloud") ; end
end

- (Boolean) prepares_on_noop?

Returns:

  • (Boolean)


64
65
66
# File 'lib/chef/knife/cluster_sync.rb', line 64

def prepares_on_noop?
  true
end

- (Boolean) relevant?(computer)

Returns:

  • (Boolean)


42
43
44
45
46
# File 'lib/chef/knife/cluster_sync.rb', line 42

def relevant?(computer)
  return false    if computer.bogus?
  return true     if config[:sync_all]
  computer.created? or computer.node?
end