class Chake::ConfigManager::Chef

Constants

CONFIG

Public Class Methods

accept?(_node) click to toggle source
# File lib/chake/config_manager/chef.rb, line 19
def self.accept?(_node)
  true # this is the default, but after everything else
end

Public Instance Methods

apply(config) click to toggle source
# 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
converge() click to toggle source
# 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

Private Instance Methods

json_config() click to toggle source
# File lib/chake/config_manager/chef.rb, line 25
def json_config
  parts = [node.path, Chake.tmpdir, "#{node.hostname}.json"].compact
  File.join(parts)
end
logging() click to toggle source
# File lib/chake/config_manager/chef.rb, line 30
def logging
  (node.silent && '-l fatal') || ''
end