chef-busboy 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef-busboy.rb +25 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7bd58f16011e6e7ff12d8c81d8972b13deb2897
4
- data.tar.gz: 935b222fd7ed544196a4f7f975f9662ee2ced9e1
3
+ metadata.gz: 0b5fcdf05bdccc9abfbdcd02bd33d042a5ac9909
4
+ data.tar.gz: c96c1f70a5efa4f06bb418b25a8842d6139a4b13
5
5
  SHA512:
6
- metadata.gz: 41def709ce978ba753d9f9ed6299545ae50519ea09dca36d9b12c23ba3df3da0974326e77b3997e5e9c8fda7b98179461baefc493e6a4404292ec51b7020cb98
7
- data.tar.gz: 127d0601c7f8a275ff989c94e607e194b6ba1ad9c9c81769c5a0085613c9a3ebfc75b6a5365655fc345f38ebaf8a3cb5396f3b6ee13a9a0de50d32afa913a438
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]}", ["chef_environment", "run_list"], {:rows => 5000})
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
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-busboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan Davidson