chef-busboy 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/lib/chef-busboy.rb +25 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b5fcdf05bdccc9abfbdcd02bd33d042a5ac9909
|
4
|
+
data.tar.gz: c96c1f70a5efa4f06bb418b25a8842d6139a4b13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea87588b7c1956ffc13ca4eb449f4c852264a3c0c7cf9a1943bfcc3b72d78bb213ed4c36c36b5c51921e545c4d1d90079d212493bfc1fa65d246649362d0f9d5
|
7
|
+
data.tar.gz: 5e3f9f7f1684100981158e570856792aae2b97466019f52f7a9a443232c64ca2b57daf0a472dff76393254aef47399ef85cf92738ed1d857d472e836cc15ccb4
|
data/lib/chef-busboy.rb
CHANGED
@@ -30,6 +30,30 @@ class ChefBusBoy < Thor
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
desc "run_list_delete", "Add recipes the run list for all nodes matching a search"
|
34
|
+
option :search_string, :required => true
|
35
|
+
option :recipe_string, :required => true
|
36
|
+
def run_list_delete()
|
37
|
+
results = search(options[:search_string])
|
38
|
+
if results.empty?
|
39
|
+
puts "No nodes match this search string"
|
40
|
+
else
|
41
|
+
print_nodes(results)
|
42
|
+
answer = get_user_confirmation("These are the nodes that matched your search and will be updated. Would you like to continue? y/n")
|
43
|
+
if answer
|
44
|
+
puts "Selections confirmed...updating run lists now..."
|
45
|
+
results.each do |node|
|
46
|
+
puts "Updating #{node.name}'s run list with #{options[:recipe_string]}"
|
47
|
+
full_node = get_connection.node.find("#{node.name}")
|
48
|
+
full_node.run_list.delete("#{options[:recipe_string]}")
|
49
|
+
get_connection.node.update(full_node)
|
50
|
+
end
|
51
|
+
else
|
52
|
+
puts "Transaction cancelled. Not updating any nodes"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
33
57
|
desc "node_env_change", "Move nodes to new environment"
|
34
58
|
option :search_string, :required => true
|
35
59
|
option :environment, :required => true
|
@@ -75,7 +99,7 @@ class ChefBusBoy < Thor
|
|
75
99
|
|
76
100
|
def search(string)
|
77
101
|
chef_server = get_connection
|
78
|
-
results = chef_server.partial_search(:node, "#{options[:search_string]}",
|
102
|
+
results = chef_server.partial_search(:node, "#{options[:search_string]}", "", {:rows => 5000})
|
79
103
|
#results = chef_server.search(:node, "#{options[:search_string]}", {:rows => 5000})
|
80
104
|
end
|
81
105
|
|
@@ -95,4 +119,3 @@ class ChefBusBoy < Thor
|
|
95
119
|
end
|
96
120
|
}
|
97
121
|
end
|
98
|
-
|