Skip to content

Instantly share code, notes, and snippets.

@ranjib
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranjib/335e301fe2ad803b41b2 to your computer and use it in GitHub Desktop.
Save ranjib/335e301fe2ad803b41b2 to your computer and use it in GitHub Desktop.
require 'blender/chef'
init(:ssh, user: 'some', password: ask('Pass: '), stdout: $stdout)
init(:chef, config_file: 'knife.rb')
members search(:chef, '*:*')
ssh_task 'run chef' do
execute 'sudo chef-client --no-fork'
end
require 'lxc'
init(:ssh, user: 'ubuntu', password: 'ubuntu', stdout: $stdout)
# can be set manually as well
#members( ['10.0.3.1', '10.0.3.2'])
members( LXC.list_containers.map{|n| LXC::Container.new(n).ip_addresses.first})
ssh_task('check memory') do
execute('free -m')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment