This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[adam@latte](1)% ./knife node list ~/src/sandbox/opscode/chef/chef/bin | |
[ | |
"ws1.domain.local", | |
"ws2.domain.local" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[adam@latte]% ./knife terremark server delete webserver3 ~/src/sandbox/opscode/chef/chef/bin | |
Do you really want to delete server ID 331176 named webserver3? (Y/N) y | |
Cleaning up internet services... | |
Waiting for power off task [53929]........ | |
Deleting vApp 331176..... | |
WARN: Deleted server webserver3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[adam@latte]% ./knife terremark server create mastodon ~/src/sandbox/opscode/chef/chef/bin | |
Instantiating vApp mastodon | |
Waiting for deploy task [53842].................................................... | |
Waiting for power on task [53843]................ | |
Bootstrapping mastodon... | |
204.51.114.233 knife sudo password: | |
204.51.114.233 | |
0% [Working]33 | |
Get:1 http://security.ubuntu.com karmic-security Release.gpg [189B] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command = <<EOH | |
bash -c ' | |
echo nameserver 208.67.222.222 > /etc/resolv.conf | |
echo nameserver 208.67.220.220 >> /etc/resolv.conf | |
if [ ! -f /usr/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private_ip = terremark.get_vapp(vapp_id).body['IpAddress'] | |
#ssh_internet_service_id = terremark.add_internet_service(terremark.default_public_ip_id, 'SSH', 'TCP', 22).body['Id'] | |
#ssh_node_service_id = terremark.add_node_service(ssh_internet_service_id, private_ip, 'SSH', 22).body['Id'] | |
puts "\nBootstrapping #{h.color(server_name, :bold)}..." | |
password = terremark.get_vapp_template(12).body['Description'].scan(/\npassword: (.*)\n/).first.first | |
public_ip = terremark.get_public_ip(terremark.default_public_ip_id).body['Name'] | |
ssh = Fog::SSH.new(private_ip, 'vcloud', :password => password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"node": { | |
"normal": { | |
"dmi": { | |
}, | |
"command": { | |
"ps": "ps -ef" | |
}, | |
"kernel": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Author:: Adam Jacob (<[email protected]>) | |
# Copyright:: Copyright (c) 2010 Opscode, Inc. | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[adam@latte]% ./knife cookbook site vendor wordpress 0.5.0 -d ~/src/sandbox/opscode/chef/chef/bin | |
INFO: Downloading wordpress from the cookbooks site at version 0.5.0 | |
INFO: Cookbook saved: /Users/adam/src/sandbox/opscode/chef-repo/cookbooks/wordpress.tar.gz | |
INFO: Checking out the master branch. | |
INFO: Checking the status of the vendor branch. | |
INFO: Creating vendor branch. | |
INFO: Removing pre-existing version. | |
INFO: Uncompressing wordpress version 0.5.0. | |
INFO: Adding changes. | |
INFO: Committing changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case node[:platform] | |
when "ubuntu" | |
include_recipe "something" | |
when "redhat" | |
include_recipe "something_else" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# Use knife to put the apache2 0.9.1 cookbook in your local repository | |
## | |
[adam@latte](1)% ./knife cookbook site vendor apache2 0.9.1 ~/src/sandbox/opscode/chef/chef/bin | |
INFO: Downloading apache2 from the cookbooks site at version 0.9.1 | |
INFO: Cookbook saved: /Users/adam/src/sandbox/opscode/chef-repo/cookbooks/apache2.tar.gz | |
INFO: Checking out the master branch. | |
INFO: Checking the status of the vendor branch. | |
INFO: Creating vendor branch. | |
INFO: Removing pre-existing version. |