Skip to content

Instantly share code, notes, and snippets.

@jdblack
Created April 3, 2015 20:11
Show Gist options
  • Save jdblack/dad62c6e675274f1e999 to your computer and use it in GitHub Desktop.
Save jdblack/dad62c6e675274f1e999 to your computer and use it in GitHub Desktop.
jblack@comet$ cat ~/.chef/knife.rb | grep -v "^#" | grep -v "digital_ocean_access_token"
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "jblack"
client_key "#{current_dir}/jblack.pem"
validation_client_name "linuxguru-validator"
validation_key "#{current_dir}/linuxguru.chef-validator.pem"
chef_server_url "https://chef.linuxguru.net/organizations/linuxguru"
cache_type 'BasicFile'
cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
cookbook_path "/home/jblack/chef/chef.linuxguru.net/cookbooks"
chef_repo_path "/home/jblack/chef"
client_key '/home/jblack/.chef/jblack-linuxguru.pem'
knife[:host_key_verify] = false
knife[:location] = 'sfo1'
knife[:size] = "512mb"
knife[:ssh_key_ids] = [174936]
knife[:image] = 9801954
13:03 ~
jblack@comet$ knife client list | grep testbox
13:03 ~
jblack@comet$ knife node list | grep testbox
13:03 ~
jblack@comet$ cat testbox.json
{
"name": "testbox",
"chef_environment": "_default",
"json_class": "Chef::Node",
"automatic": {
},
"normal": {
"an_attribute": "value"
},
"chef_type": "node",
"default": {
},
"override": {
},
"run_list": [
]
}
13:03 ~
jblack@comet$ knife node from file testbox.json
Updated Node testbox!
jblack@comet$ knife digital_ocean droplet create -B -N "testbox"
Droplet creation for testbox started. Droplet-ID is 4714052
Waiting for IPv4-Address.done
IPv4 address is: 104.131.146.227
Waiting for sshd:done
Doing old-style registration with the validation key at /home/jblack/.chef/linuxguru.chef-validator.pem...
Delete your validation key in order to use your user credentials instead
Connecting to 104.131.146.227
104.131.146.227 Installing Chef Client...
104.131.146.227 --2015-04-03 16:09:07-- https://www.chef.io/chef/install.sh
104.131.146.227 Resolving www.chef.io (www.chef.io)... 23.235.47.65
104.131.146.227 Connecting to www.chef.io (www.chef.io)|23.235.47.65|:443... connected.
104.131.146.227 HTTP request sent, awaiting response... 200 OK
104.131.146.227 Length: 18358 (18K) [application/x-sh]
104.131.146.227 Saving to: ‘STDOUT’
104.131.146.227
100%[======================================>] 18,358 --.-K/s in 0.001s
104.131.146.227
104.131.146.227 2015-04-03 16:09:07 (14.7 MB/s) - written to stdout [18358/18358]
104.131.146.227
104.131.146.227 Downloading Chef 12 for ubuntu...
104.131.146.227 downloading https://www.chef.io/chef/metadata?v=12&prerelease=false&nightlies=false&p=ubuntu&pv=14.10&m=x86_64
104.131.146.227 to file /tmp/install.sh.1337/metadata.txt
104.131.146.227 trying wget...
104.131.146.227 url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.2.1-1_amd64.deb
104.131.146.227 md5 84119f54115d754373c9891b8759497c
104.131.146.227 sha256 8e0a8a2477c11615f86ffe686a68fa6636112ba82ebe6bb22daa5dd416f3c13e
104.131.146.227 yolo true
104.131.146.227 downloaded metadata file looks valid...
104.131.146.227 downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/13.04/x86_64/chef_12.2.1-1_amd64.deb
104.131.146.227 to file /tmp/install.sh.1337/chef_12.2.1-1_amd64.deb
104.131.146.227 trying wget...
104.131.146.227 Comparing checksum with sha256sum...
104.131.146.227
104.131.146.227 WARNING: Chef-Client has not been regression tested on this O/S Distribution
104.131.146.227 WARNING: Do not use this configuration for Production Applications. Use at your own risk.
104.131.146.227
104.131.146.227 Installing Chef 12
104.131.146.227 installing with dpkg...
104.131.146.227 Selecting previously unselected package chef.
(Reading database ... 115593 files and directories currently installed.)
104.131.146.227 Preparing to unpack .../chef_12.2.1-1_amd64.deb ...
104.131.146.227 Unpacking chef (12.2.1-1) ...
104.131.146.227 Setting up chef (12.2.1-1) ...
104.131.146.227 Thank you for installing Chef!
104.131.146.227 Starting first Chef Client run...
104.131.146.227 Starting Chef Client, version 12.2.1
104.131.146.227 Creating a new client identity for testbox using the validator key.
104.131.146.227 resolving cookbooks for run list: []
104.131.146.227 Synchronizing Cookbooks:
104.131.146.227 Compiling Cookbooks...
104.131.146.227 [2015-04-03T16:09:27-04:00] WARN: Node testbox has an empty run list.
104.131.146.227 Converging 0 resources
104.131.146.227
104.131.146.227 Running handlers:
104.131.146.227 [2015-04-03T16:09:27-04:00] ERROR: Running exception handlers
104.131.146.227 Running handlers complete
104.131.146.227 [2015-04-03T16:09:27-04:00] ERROR: Exception handlers complete
104.131.146.227 [2015-04-03T16:09:27-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
104.131.146.227 Chef Client failed. 0 resources updated in 2.113871479 seconds
104.131.146.227 [2015-04-03T16:09:27-04:00] ERROR: 403 "Forbidden"
104.131.146.227 [2015-04-03T16:09:27-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
jblack@comet$ knife node -y delete testbox
Deleted node[testbox]
13:10 ~
jblack@comet$ ssh root@104.131.146.227
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
50:58:4b:27:90:69:97:e9:27:3d:51:2b:a4:c4:d5:10.
Please contact your system administrator.
Add correct host key in /home/jblack/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/jblack/.ssh/known_hosts:451
remove with: ssh-keygen -f "/home/jblack/.ssh/known_hosts" -R 104.131.146.227
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Welcome to Ubuntu 14.10 (GNU/Linux 3.16.0-28-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Fri Apr 3 16:10:18 EDT 2015
System load: 0.37 Processes: 75
Usage of /: 10.2% of 19.56GB Users logged in: 0
Memory usage: 22% IP address for eth0: 104.131.146.227
Swap usage: 0%
Graph this data and manage this system at:
https://landscape.canonical.com/
0 packages can be updated.
0 updates are security updates.
Last login: Fri Apr 3 16:09:53 2015 from c-24-18-205-199.hsd1.wa.comcast.net
root@testbox:~# chef-client
Starting Chef Client, version 12.2.1
resolving cookbooks for run list: []
Synchronizing Cookbooks:
Compiling Cookbooks...
[2015-04-03T16:10:24-04:00] WARN: Node testbox has an empty run list.
Converging 0 resources
Running handlers:
Running handlers complete
Chef Client finished, 0/0 resources updated in 1.427182815 seconds
root@testbox:~#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment