Class: Chake::ConfigManager::Chef

Inherits:
Chake::ConfigManager show all
Defined in:
lib/chake/config_manager/chef.rb

Constant Summary collapse

CONFIG =
ENV['CHAKE_CHEF_CONFIG'] || 'config.rb'

Instance Attribute Summary

Attributes inherited from Chake::ConfigManager

#node

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Chake::ConfigManager

all, #bootstrap_steps, get, inherited, init, #initialize, #name, #needs_upload?, #path, priority, short_name, #to_s

Constructor Details

This class inherits a constructor from Chake::ConfigManager

Class Method Details

.accept?(_node) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/chake/config_manager/chef.rb', line 19

def self.accept?(_node)
  true # this is the default, but after everything else
end

Instance Method Details

#apply(config) ⇒ Object



13
14
15
# File 'lib/chake/config_manager/chef.rb', line 13

def apply(config)
  node.run_as_root "sh -c 'rm -f #{node.path}/nodes/*.json && chef-solo -c #{node.path}/#{CONFIG} #{logging} -j #{json_config} --override-runlist recipe[#{config}]'"
end

#convergeObject



9
10
11
# File 'lib/chake/config_manager/chef.rb', line 9

def converge
  node.run_as_root "sh -c 'rm -f #{node.path}/nodes/*.json && chef-solo -c #{node.path}/#{CONFIG} #{logging} -j #{json_config}'"
end