ChefMetalSsh
TODO: Write a gem description
Installation
Add this line to your application's Gemfile:
gem 'chef-metal-ssh'
And then execute:
$ bundle
Or install it yourself as:
$ gem install chef-metal-ssh
Usage
machine "one" do
action :create
converge true
provisioner ChefMetalSsh::SshProvisioner.new
'target_ip' => '192.168.33.21',
'ssh_user' => 'vagrant',
'ssh_connect_options' => {
'ssh_pass' => 'vagrant'
}
recipe 'ssh_test::remote1'
notifies :create, 'machine[two]'
notifies :run, 'execute[run_touch1]'
end
To test it out, clone the repo:
git clone https://github.com/double-z/chef-metal-ssh.git
in the root there is a Vagrantfile with 3 nodes, 1 master and 2 targets.
FYI, nothing will get installed on your local machine in this process.
Run:
vagrant up
which will bring up all 3 nodes.
So then ssh to the master:
vagrant ssh master
the repo test directory has a test cookbook and run_zero
script. its located at /vagrant/test
cd into the test directory:
cd /vagrant/test
then run:
bash run_zero install
this will install the prereqs. then run:
bash run_zero both
this will run the ssh_test::both
recipe which will converge both targets, with target one
notifying target two. target one will converge the ssh_test::remote1
recipe, target two the ssh_test::remote2
recipe.
thats it.
party on wayne.
Contributing
- Fork it ( http://github.com/double-z/chef-metal-ssh/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request