knife-flip 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +11 -0
- data/knife-flip.gemspec +1 -1
- data/lib/chef/knife/nodeflip.rb +4 -4
- data/lib/knife-flip.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
A knife plugin to move a node, or all nodes in a role, to a specific environment
|
4
4
|
|
5
|
+
## SCRIPT INSTALL
|
6
|
+
|
7
|
+
Copy *.rb script from lib/chef/knife to your ~/.chef/plugins/knife directory.
|
8
|
+
|
9
|
+
## GEM INSTALL
|
10
|
+
knife-flip is available on rubygems.org - if you have that source in your gemrc, you can simply use:
|
11
|
+
|
12
|
+
````
|
13
|
+
gem install knife-flip
|
14
|
+
````
|
15
|
+
|
5
16
|
## What it does
|
6
17
|
|
7
18
|
````
|
data/knife-flip.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'knife-flip'
|
16
|
-
s.version = '0.1.
|
16
|
+
s.version = '0.1.3'
|
17
17
|
s.date = '2012-02-01'
|
18
18
|
s.rubyforge_project = 'knife-flip'
|
19
19
|
|
data/lib/chef/knife/nodeflip.rb
CHANGED
@@ -25,15 +25,15 @@ module KnifeFlip
|
|
25
25
|
exit 1
|
26
26
|
end
|
27
27
|
|
28
|
-
puts "Looking for #{@node_name}"
|
28
|
+
puts "Looking for an fqdn of #{@node_name}"
|
29
29
|
|
30
30
|
searcher = Chef::Search::Query.new
|
31
|
-
result = searcher.search(:node, "
|
31
|
+
result = searcher.search(:node, "fqdn:#{@node_name}")
|
32
32
|
|
33
33
|
knife_search = Chef::Knife::Search.new
|
34
34
|
node = result.first.first
|
35
35
|
if node.nil?
|
36
|
-
puts "Could not find a node
|
36
|
+
puts "Could not find a node with the fqdn of #{@node_name}"
|
37
37
|
exit 1
|
38
38
|
end
|
39
39
|
|
@@ -54,7 +54,7 @@ module KnifeFlip
|
|
54
54
|
node.save
|
55
55
|
|
56
56
|
knife_search = Chef::Knife::Search.new
|
57
|
-
knife_search.name_args = ['node', "
|
57
|
+
knife_search.name_args = ['node', "fqdn:#{@node_name}"]
|
58
58
|
knife_search.run
|
59
59
|
|
60
60
|
end
|
data/lib/knife-flip.rb
CHANGED