- From: Michael Hale <
>
- To: chef <
>
- Subject: [chef] Re: Announcing Spiceweasel
- Date: Sat, 5 Mar 2011 20:56:31 -0500
Instead of using yaml why not just call knife from a rake script? You
could use filelists to describe the things to upload or even use knife
at the library level to speed things up.
On Sat, Mar 5, 2011 at 10:44 AM, Matt Ray
<
>
wrote:
>
Yesterday I released a new CLI tool for generating knife commands from
>
simple YAML describing your Chef-managed infrastructure. It's on
>
GitHub (http://bit.ly/spcwsl) and RubyGems (gem install spiceweasel)
>
if you're interested. The YAML syntax is very simple, but this isn't
>
intended to be anything more than a simple-batchloader. Eventually it
>
will support deleting and rebuilding the YAML-described infrastructure
>
as well as re-running chef-client on each listed node.
>
>
The YAML file:
>
>
cookbooks:
>
- apache2
>
- apt
>
- mysql
>
roles:
>
- base
>
- monitoring
>
- webserver
>
data bags:
>
users:
>
- alice
>
- bob
>
- chuck
>
data:
>
nodes:
>
serverA:
>
- role[loadbalancer]
>
- -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems
>
ec2 5:
>
- role[webserver]
>
- -S mray -I ~/.ssh/mray.pem -x ubuntu -G default -i ami-a403f7cd
>
-f m1.small
>
rackspace 3:
>
- recipe[mysql] role[clustered_mysql]
>
- --image 49 --flavor 2
>
>
turns into
>
>
knife cookbook upload apache2
>
knife cookbook upload apt
>
knife cookbook upload mysql
>
knife role from file base.rb
>
knife role from file monitoring.rb
>
knife role from file webserver.rb
>
knife data bag create data
>
knife data bag create users
>
knife data bag from file users data_bags/alice.json
>
knife data bag from file users data_bags/bob.json
>
knife data bag from file users data_bags/chuck.json
>
knife bootstrap serverA 'role[loadbalancer]' -i ~/.ssh/mray.pem -x
>
user --sudo -d ubuntu10.04-gems
>
knife ec2 server create 'role[webserver]' -S mray -I ~/.ssh/mray.pem
>
-x ubuntu -G default -i ami-a403f7cd -f m1.small
>
knife ec2 server create 'role[webserver]' -S mray -I ~/.ssh/mray.pem
>
-x ubuntu -G default -i ami-a403f7cd -f m1.small
>
knife ec2 server create 'role[webserver]' -S mray -I ~/.ssh/mray.pem
>
-x ubuntu -G default -i ami-a403f7cd -f m1.small
>
knife ec2 server create 'role[webserver]' -S mray -I ~/.ssh/mray.pem
>
-x ubuntu -G default -i ami-a403f7cd -f m1.small
>
knife ec2 server create 'role[webserver]' -S mray -I ~/.ssh/mray.pem
>
-x ubuntu -G default -i ami-a403f7cd -f m1.small
>
knife rackspace server create 'recipe[mysql]' 'role[clustered_mysql]'
>
--image 49 --flavor 2
>
knife rackspace server create 'recipe[mysql]' 'role[clustered_mysql]'
>
--image 49 --flavor 2
>
knife rackspace server create 'recipe[mysql]' 'role[clustered_mysql]'
>
--image 49 --flavor 2
>
>
Feedback is appreciated!
>
>
Thanks,
>
Matt Ray
>
Technical Evangelist | Opscode, Inc
>
E:
>
>
T: (512) 731-2218
>
Twitter, Github: mattray
>
Archive powered by MHonArc 2.6.16.