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
#!/bin/bash | |
#ec2-run-instances --user-data-file chefserver-ec2-userdata.sh -g chef-server --key mykey -t m1.large --instance-initiated-shutdown-behavior terminate ami-1aad5273 | grep INSTANCE | INSTANCE=`cut -f 2` | xargs -I XXX ec2-create-tags XXX --tag Name=chefserver ; sleep 60 ; ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | echo ssh ubuntu@`cut -f 4` | |
# ami-1aad5273 - ubuntu 11.04 64bit server ebs | |
# ami-2cc83145 - alestic ubunt 10.04 LTS 32bit server ebs | |
# ami-2ec83147 - alestic ubunt 10.04 LTS 64bit server ebs | |
# ami-8e1fece7 - amazon 64 bit ebs | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
set -e -x | |
# START CHEF BOOSTRAP |
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
After adding aegisco and updating, there appears to be package conflicts for all the ruby-1.8.7 vs ruby-1.8.5 packages. | |
$ gem list | grep knife\\\|chef | |
chef (0.10.2) | |
knife-ec2 (0.5.6) | |
#using this ami: | |
# http://thecloudmarket.com/image/ami-4a24d623--rightimage-centos-5-4-x64-v5-6-28-ebs#/details | |
$ knife ec2 server create --availability-zone us-east-1a --identity-file ~/mysshkey.pem --image ami-4a24d623 --distro centos5-gems --flavor t1.micro --region us-east-1 --ssh-user root --ssh-key mysshkey -N newserver -V -G servergroup_1,servergroup_1 |
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
$ chef-client -l debug | |
[Sat, 09 Jul 2011 19:23:37 +0000] INFO: *** Chef 0.10.2 *** | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG: Loading plugin os | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG: Loading plugin kernel | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG: Loading plugin ruby | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG: Loading plugin languages | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG: ---- Begin ruby -e "require 'rbconfig'; puts %Q(platform=#{RUBY_PLATFORM},version=#{RUBY_VERSION},release_date=#{RUBY_RELEASE_DATE},target=#{::Config::CONFIG['target']},target_cpu=#{::Config::CONFIG['target_cpu']},target_vendor=#{::Config::CONFIG['target_vendor']},target_os=#{::Config::CONFIG['target_os']},host=#{::Config::CONFIG['host']},host_cpu=#{::Config::CONFIG['host_cpu']},host_os=#{::Config::CONFIG['host_os']},host_vendor=#{::Config::CONFIG['host_vendor']},bin_dir=#{::Config::CONFIG['bindir']},ruby_bin=#{::File.join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name'])},)" STDOUT ---- | |
[Sat, 09 Jul 2011 19:23:37 +0000] DEBUG |
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
When I have https://gist.github.com/368740 put in tasks/databag_dump_load.rake AND I use a knife.rb that includes knife[:aws_*] = 'foo' ala http://rubydoc.info/gems/knife-ec2/0.5.6/file/README.rdoc I get errors. | |
It's interesting that I'm even running rake with --trace and I don't get a stacktrace... | |
rake --trace | |
(in /chef-repo) | |
ERROR: You have an error in your config file /chef-repo/.chef/knife.rb | |
NoMethodError: undefined method `[]=' for #<Chef::Knife:0x110e7e8> | |
/home/chris/clients/fanestra/aws/chef-repo/.chef/knife.rb:16:in `from_file' | |
/home/chris/clients/fanestra/aws/chef-repo/.chef/knife.rb:16:in `from_file' |
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
I'd like to find a way to construct those images from original sources and not depend on the etherboot.org blobs. | |
$ git clone git://git.etherboot.org/scm/people/pravin/BKO.git | |
$ cd BKO/install_help | |
$ ./download_initramfs_images_http.sh | |
downloading dsl initramfs | |
--2011-08-06 06:43:17-- http://rom.etherboot.org/share/pravin/BKO///bko/live/dsl/minirt24.gz | |
Resolving rom.etherboot.org... 140.211.167.171 | |
Connecting to rom.etherboot.org|140.211.167.171|:80... failed: Connection refused. |
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
require 'chef/mixin/shell_out' | |
require 'chef/log' | |
require 'chef/provider' | |
include Chef::Mixin::ShellOut | |
def action_run | |
opts = {} | |
if sentinel_file = @new_resource.creates | |
if ::File.exists?(sentinel_file) |
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
remote_file '/tmp/foo' do | |
source "http://remote/foo" | |
action :nothing | |
end | |
http_request "HEAD http://remote/foo" do | |
message "" | |
url "http://remote/foo" | |
action :head | |
if ::File.exists?('/tmp/foo') |
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
{ | |
"chef_server": { | |
"server_url": "http://breeze.local:4000", | |
"webui_enabled": true, | |
"init_style": "init", | |
"ssl_req": "/C=NZ/ST=Bay of Plenty/L=Tauranga/O=PassionEngine.org/OU=DevOps/CN=chef.server/[email protected]" | |
}, | |
"apache": { | |
"listen_ports": [ "80", "443" ], | |
"contact": "[email protected]", |
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
If I comment out https://github.com/passionengine/ii/blob/master/site-cookbooks/unattended/recipes/default.rb#L141 I get the following error | |
[Tue, 30 Aug 2011 06:08:48 +1200] FATAL: Saving node information to /var/cache/chef/failed-run-data.json | |
[Tue, 30 Aug 2011 06:08:48 +1200] ERROR: Exception handlers complete | |
[Tue, 30 Aug 2011 06:08:48 +1200] DEBUG: Re-raising exception: TypeError - Symbol as array index | |
/var/cache/chef/cookbooks/unattended/recipes/default.rb:142:in `[]' | |
/var/cache/chef/cookbooks/unattended/recipes/default.rb:142:in `from_file' | |
/var/cache/chef/cookbooks/unattended/recipes/default.rb:139:in `each' |
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
DEBUG: Processing remote_file[DP_Bluetooth_wnt5_x86-32_910.torrent from http://driverpacks.net/driverpacks/windows/xp/x86/bluetooth/9.10/download/torrent] on breeze.local | |
INFO: Processing remote_file[DP_Bluetooth_wnt5_x86-32_910.torrent from http://driverpacks.net/driverpacks/windows/xp/x86/bluetooth/9.10/download/torrent] action create (unattended::default line 149) | |
DEBUG: Skipping remote_file[DP_Bluetooth_wnt5_x86-32_910.torrent from http://driverpacks.net/driverpacks/windows/xp/x86/bluetooth/9.10/download/torrent] due to not_if | |
DEBUG: Processing transmission_torrent_file[/var/cache/chef/unattended/drivers/DP_Bluetooth_wnt5_x86-32_910.7z] on breeze.local | |
INFO: Processing transmission_torrent_file[/var/cache/chef/unattended/drivers/DP_Bluetooth_wnt5_x86-32_910.7z] action create (unattended::default line 158) | |
DEBUG: Caching a copy of torrent file /var/cache/chef/unattended/torrents/DP_Bluetooth_wnt5_x86-32_910.torrent at /var/cache/chef/DP_Bluetooth_wnt5_x86-32_910.torrent |