We'll assume an OS X Mavericks (10.9) box here.
You'll need:
- Vagrant
- Vagrant's VMware Fusion provider
# chef-client | |
[Wed, 20 Jun 2012 13:06:33 +0000] INFO: *** Chef 10.12.0 *** | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List is [role[my_app]] | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Run List expands to [chef-client::config, chef-client::service, myplace::my_app] | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Starting Chef Run for 20929809 | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Running start handlers | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Start handlers complete. | |
[Wed, 20 Jun 2012 13:06:35 +0000] INFO: Loading cookbooks [apache2, application, application_java, myplace, build-essential, chef-client, chef_handler, gunicorn, iptables, java, mysql, openssl, passenger_apache2, php, python, runit, tomcat, unicorn, windows, xml, yum] | |
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Missing gem 'mysql' | |
[Wed, 20 Jun 2012 13:06:36 +0000] INFO: Application light-weight resource already initialized -- overriding! |
//Install Macports. | |
//Install aircrack-ng: | |
sudo port install aircrack-ng | |
//Install the latest Xcode, with the Command Line Tools. | |
//Create the following symlink: | |
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport | |
//Figure out which channel you need to sniff: | |
sudo airport -s | |
sudo airport en1 sniff [CHANNEL] |
# set up flags for Numpy C extentions compiling | |
export CFLAGS="-arch i386 -arch x86_64" | |
export FFLAGS="-m32 -m64" | |
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" | |
export CC=gcc-4.2 | |
export CXX="g++ -arch i386 -arch x86_64" | |
pip install numpy | |
# success! |
# A data bag secret lets us use secret ingredients | |
encrypted_data_bag_secret_file = "#{current_dir}/encrypted_data_bag_secret" | |
if not ::File.exists? encrypted_data_bag_secret_file | |
open(encrypted_data_bag_secret_file,'w') do |secretkeyfile| | |
secretkeyfile.write(OpenSSL::PKey::RSA.new(512).to_pem.lines.to_a[1..-2].join.chomp) | |
end | |
end | |
encrypted_data_bag_secret = encrypted_data_bag_secret_file |
This has been moved into the official Chef docs:
https://docs.chef.io/custom_resources_notes.html
This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:
action_class do ... end
block.You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh
so it can download the required packages.
You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to https://github.com
so that it can authenticate.
Your system also needs to have an FQDN that can be resolved, for example depot.example.com
. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in
. The /#/sign-in
is required.
Release in Chef 12.9.41 via PR #4741 core chef now has a feature which has been available in Poise for awhile, which is that notifications from within resources will now notify resources in outer run contexts. This means you can write a recipe with a service resource and send a notification to it from a resource that you write.
Notifications will bubble up from arbitrarily nested resources, so users that write resources that wrap resources which wrap your resource will still find the service resource in your default recipe.
At the same time the resources collection #find()
and #lookup
methods and the more commonly-used DSL method resources("service[ntpd]")
has been changed to also match
In a terminal start a server.
$ python -m SimpleHTTPServer 8000
In another terminal set up the cgroups freezer.