2014-04-11 00:31:44 -07:00
|
|
|
require_relative 'lib/output'
|
|
|
|
|
|
|
|
desc "Provision the node"
|
|
|
|
task :init,:node do |t,args|
|
2014-06-21 01:08:08 -07:00
|
|
|
args.with_defaults(:node => `hostname`.gsub('.local', '').strip)
|
2014-04-13 08:46:20 -07:00
|
|
|
# TODO: chop off the *.local in osx hostnames
|
2014-04-11 00:31:44 -07:00
|
|
|
|
|
|
|
path = "#{File.dirname(__FILE__)}/node/#{args.node}.rb"
|
|
|
|
if File.exists?(path)
|
|
|
|
echo "Setting up node: #{args.node}"
|
|
|
|
require_relative "node/#{args.node}"
|
2014-04-13 08:46:20 -07:00
|
|
|
echo "Done!"
|
2014-04-11 00:31:44 -07:00
|
|
|
else
|
|
|
|
echo "#{args.node} node does not exist!"
|
|
|
|
end
|
|
|
|
end
|
2014-04-13 08:46:20 -07:00
|
|
|
|
2014-06-18 12:50:39 -07:00
|
|
|
desc "Update the node"
|
|
|
|
task :default => :init
|