chef-busboy 0.0.2 → 0.0.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.
- checksums.yaml +4 -4
- data/lib/chef-busboy.rb +14 -5
- 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: 4b40b3516b2bf5409f1bc5321f8fca808d6d94a1
|
4
|
+
data.tar.gz: 0f71ea9bbb5f2a6e8ebee05702e2e97a03872a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab6c4d9933a9991f5c5e0df595b375409d033d1d1bb945e0f9b674c58dbc2d140cd2a41baa64e0d9263ca1912cb65e3191717e26ea2f6e6b77d8705007d0821c
|
7
|
+
data.tar.gz: ae7af6a5cd4d15aa59d7b626448e1141078868503614d86c193f6154fe3f6978330909cb75974ce71364412523cae6b291ac98669067a078aa4eeb4c8b0c9d5b
|
data/lib/chef-busboy.rb
CHANGED
@@ -20,8 +20,9 @@ class ChefBusBoy < Thor
|
|
20
20
|
puts "Selections confirmed...updating run lists now..."
|
21
21
|
results.each do |node|
|
22
22
|
puts "Updating #{node.name}'s run list with #{options[:recipe_string]}"
|
23
|
-
node.
|
24
|
-
|
23
|
+
full_node = get_connection.node.find("#{node.name}")
|
24
|
+
full_node.run_list << "#{options[:recipe_string]}"
|
25
|
+
get_connection.node.update(full_node)
|
25
26
|
end
|
26
27
|
else
|
27
28
|
puts "Transaction cancelled. Not updating any nodes"
|
@@ -41,10 +42,17 @@ class ChefBusBoy < Thor
|
|
41
42
|
answer = get_user_confirmation("These are the nodes that matched your search and will be updated. Would you like to continue? y/n")
|
42
43
|
if answer
|
43
44
|
puts "Selections confirmed...updating environments now..."
|
45
|
+
count = 0
|
44
46
|
results.each do |node|
|
45
47
|
puts "Changing #{node.name}'s environment to #{options[:environment]}"
|
46
|
-
|
47
|
-
|
48
|
+
full_node = get_connection.node.find("#{node.name}")
|
49
|
+
full_node.chef_environment = "#{options[:environment]}"
|
50
|
+
@@chef_server.node.update(full_node)
|
51
|
+
count = count + 1
|
52
|
+
if count > 50
|
53
|
+
@@chef_server = nil
|
54
|
+
@@chef_server = get_connection
|
55
|
+
end
|
48
56
|
end
|
49
57
|
else
|
50
58
|
puts "Transaction cancelled. Not updating any nodes"
|
@@ -72,7 +80,8 @@ class ChefBusBoy < Thor
|
|
72
80
|
|
73
81
|
def search(string)
|
74
82
|
chef_server = get_connection
|
75
|
-
results = chef_server.partial_search(:node, "#{options[:search_string]}", "", {:rows => 5000})
|
83
|
+
results = chef_server.partial_search(:node, "#{options[:search_string]}", ["chef_environment", "run_list"], {:rows => 5000})
|
84
|
+
#results = chef_server.search(:node, "#{options[:search_string]}", {:rows => 5000})
|
76
85
|
end
|
77
86
|
|
78
87
|
def print_nodes(nodes)
|