class Bagboy::Chef::Knife

Public Instance Methods

create_data_bag( data_bag ) click to toggle source
# File lib/bagboy/chef/knife.rb, line 15
def create_data_bag ( data_bag )
  execute_command knife_command('data bag', "create #{data_bag}")
end
knife_command( command, subcommand ) click to toggle source
# File lib/bagboy/chef/knife.rb, line 19
def knife_command ( command, subcommand )
  "cd #{Bagboy.chef_repo}; knife #{command} #{key_config.to_s}#{config_file_config.to_s}#{subcommand}"
end
setup( opts={} ) click to toggle source
# File lib/bagboy/chef/knife.rb, line 7
def setup( opts={} )
  
end
update_item( data_bag, item ) click to toggle source
# File lib/bagboy/chef/knife.rb, line 11
def update_item ( data_bag, item )
  execute_command knife_command('data bag', "from file #{data_bag} #{item}.json")
end

Private Instance Methods

config_file_config() click to toggle source
# File lib/bagboy/chef/knife.rb, line 29
def config_file_config
  "-c #{Bagboy.config_path} " if Bagboy.config_path != ''
end
execute_command(cmd) click to toggle source
# File lib/bagboy/chef/knife.rb, line 33
def execute_command cmd
  `#{cmd}`
end
key_config() click to toggle source
# File lib/bagboy/chef/knife.rb, line 25
def key_config
   "-k #{Bagboy.key_path} " if Bagboy.key_path != ''
end