Permalink
Browse files

Extract machine domain in rename_machine recipe to an attribute in no…

…de.default so that it can be easily overwritten.

Also access node in consistent manner.
  • Loading branch information...
1 parent a2c8ccd commit 527211848a5bfdde9195ea4f4116e9a174cad5ac @winston winston committed Jan 23, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −0 attributes/rename_machine.rb
  2. +1 −1 recipes/rename_machine.rb
@@ -0,0 +1 @@
+node.default["machine_domain"] = "pivotallabs.com"
@@ -13,7 +13,7 @@
hostnames.each do |hostname|
log "My hostname: #{hostname}"
- if hostname =~ /pivotallabs.com/ and hostname !~ /^dyn-/
+ if hostname =~ /#{node['machine_domain']}/ and hostname !~ /^dyn-/
hostname = hostname.gsub(/\..*/,"")
# The scutil commands need to run as root, unless

0 comments on commit 5272118

Please sign in to comment.