This file contains 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
#!./bin/knife exec | |
# A knife exec script to change chef node's name, preserving all the attributes. | |
# | |
# Usage: knife exec rename-node.rb old-name new-name | |
# | |
# Script retrieves the Node object, changes its 'name' attribute, | |
# creates new Node object with updated name and rest of attributes | |
# untouched. Then it deletes old Node and Client objects from | |
# database, and logs into the server to update it: |
This file contains 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
champagne:~OPSCODE_COOKBOOKS/runit (1.9.3-p327) | |
CHEF-154 ✗ % rake spec | |
bundle exec rspec -c -f d spec.rb | |
Chef::Provider::RunitService | |
load_current_resource | |
should create a current resource with the name of the new resource | |
Finished in 0.00362 seconds | |
1 example, 0 failures |