- Packaging
veewee
with Vagrant gives the end-user the expectation that Vagrant will also support VeeWee, which isn't true (more on this in a sec). - Packaging
veewee
with Vagrant requires I make sure it works with Vagrant at all times (or at least at that point I package). I'm not willing to do this. Again, more on this in a sec. - Vagrant 1.1+ (that is: experimental builds heading towards 2.0) will merge in VeeWee functionality in an officially supported way. Finally, Vagrant will be able to build its own boxes from ISOs. I'm not sure the name will remain
veewee
but the functionality will be the same and I've talked to @patrickdebois about this already.
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
# Forwarded port configurations were changed so that they no longer | |
# require a unique name: | |
# Before | |
config.vm.forward_port "http", 80, 8080 | |
# After | |
config.vm.forward_port 80, 8080 | |
# After (if you still want to name it you can, optionally) |
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
Last login: Tue Jan 10 17:14:06 on ttys004 | |
foo → ruby -v | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0] | |
foo → time ruby test.rb | |
HELLO! | |
real 0m0.022s | |
user 0m0.017s | |
sys 0m0.005s | |
foo → time ruby test.rb |
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
foo → ruby -v | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0] | |
foo → time vagrant -h | |
Tasks: | |
vagrant box # Commands to manage system boxes | |
vagrant destroy # Destroy the environment, deleting the created virtual machines | |
vagrant halt # Halt the running VMs in the environment | |
vagrant help [TASK] # Describe available tasks or one specific task | |
vagrant init [box_name] [box_url] # Initializes the current folder for Vagrant usage | |
vagrant package # Package a Vagrant environment for distribution |
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
b7b9867e7de60dbc0b8dd2151ec5bca82297d38c094a2e56c61a8d34bb859972 |
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
671ff0e7b1f416c3b04ab80e0a9d14d07b28fc598d29ac7926ef73672477780d |
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
#!/usr/bin/env ruby | |
require 'set' | |
def knife_list(type) | |
Set.new(`knife #{type} list`.split("\n").map { |a| a.strip.chomp }) | |
end | |
nodes = knife_list(:node) | |
clients = knife_list(:client) |
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
vm.channel.execute("tail -f /some/growing/fail") do |type, data| | |
# type is one of [:stdout, :stderr, :exit_status] | |
# data is a string for stdout/stderr and an int for exit status | |
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
# Get the directory where this script is. This will also resolve | |
# any symlinks in the directory/script, so it will be the fully | |
# resolved path. | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
# Useful variables | |
EMBEDDED_DIR=${DIR}/../embedded |
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
# A method for configuration based on partial convergence in Chef. | |
# | |
# Assuming you have knowledge that Chef is two-phased (compilation then convergence), | |
# then this solves the problem where you need to pass data into a resource where the | |
# data comes from a place that requires some convergence to have occurred. Most often | |
# this happens for me in templates. | |
# | |
# Below is a general pattern I use when this is necessary (it is rare). Basically, I | |
# use an OpenStruct to assign some data to it via `ruby_block` (which is processed at | |
# convergence), and then I use that data in the resource that depends on it. Then in the |