knife-spork 1.7.2 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +35 -35
  3. data/lib/chef/knife/spork-bump.rb +100 -100
  4. data/lib/chef/knife/spork-check.rb +165 -161
  5. data/lib/chef/knife/spork-databag-create.rb +54 -54
  6. data/lib/chef/knife/spork-databag-delete.rb +51 -51
  7. data/lib/chef/knife/spork-databag-edit.rb +54 -54
  8. data/lib/chef/knife/spork-databag-fromfile.rb +88 -88
  9. data/lib/chef/knife/spork-delete.rb +132 -132
  10. data/lib/chef/knife/spork-environment-check.rb +90 -90
  11. data/lib/chef/knife/spork-environment-create.rb +63 -63
  12. data/lib/chef/knife/spork-environment-delete.rb +38 -38
  13. data/lib/chef/knife/spork-environment-edit.rb +40 -40
  14. data/lib/chef/knife/spork-environment-fromfile.rb +46 -46
  15. data/lib/chef/knife/spork-info.rb +34 -34
  16. data/lib/chef/knife/spork-node-create.rb +41 -41
  17. data/lib/chef/knife/spork-node-delete.rb +41 -41
  18. data/lib/chef/knife/spork-node-edit.rb +48 -48
  19. data/lib/chef/knife/spork-node-fromfile.rb +46 -46
  20. data/lib/chef/knife/spork-node-runlistadd.rb +51 -51
  21. data/lib/chef/knife/spork-node-runlistremove.rb +44 -44
  22. data/lib/chef/knife/spork-node-runlistset.rb +44 -44
  23. data/lib/chef/knife/spork-omni.rb +112 -112
  24. data/lib/chef/knife/spork-promote.rb +197 -197
  25. data/lib/chef/knife/spork-role-create.rb +46 -46
  26. data/lib/chef/knife/spork-role-delete.rb +50 -50
  27. data/lib/chef/knife/spork-role-edit.rb +40 -40
  28. data/lib/chef/knife/spork-role-fromfile.rb +65 -65
  29. data/lib/chef/knife/spork-upload.rb +151 -151
  30. data/lib/chef/knife/spork-version.rb +12 -12
  31. data/lib/knife-spork.rb +3 -3
  32. data/lib/knife-spork/plugins.rb +27 -27
  33. data/lib/knife-spork/plugins/campfire.rb +219 -219
  34. data/lib/knife-spork/plugins/eventinator.rb +329 -329
  35. data/lib/knife-spork/plugins/foodcritic.rb +46 -46
  36. data/lib/knife-spork/plugins/git.rb +393 -399
  37. data/lib/knife-spork/plugins/graphite.rb +25 -25
  38. data/lib/knife-spork/plugins/grove.rb +167 -167
  39. data/lib/knife-spork/plugins/hipchat.rb +171 -171
  40. data/lib/knife-spork/plugins/influxdb.rb +28 -28
  41. data/lib/knife-spork/plugins/irccat.rb +332 -332
  42. data/lib/knife-spork/plugins/jabber.rb +133 -133
  43. data/lib/knife-spork/plugins/plugin.rb +117 -117
  44. data/lib/knife-spork/plugins/rubocop.rb +56 -56
  45. data/lib/knife-spork/plugins/slack.rb +125 -125
  46. data/lib/knife-spork/plugins/statusnet.rb +122 -122
  47. data/lib/knife-spork/runner.rb +342 -342
  48. data/lib/knife-spork/version.rb +5 -5
  49. metadata +4 -51
  50. data/.gitignore +0 -21
  51. data/.ruby-gemset +0 -1
  52. data/.ruby-version +0 -1
  53. data/.travis.yml +0 -3
  54. data/CHANGELOG.md +0 -445
  55. data/Gemfile +0 -3
  56. data/README.md +0 -544
  57. data/Rakefile +0 -35
  58. data/knife-spork.gemspec +0 -28
  59. data/plugins/Campfire.md +0 -43
  60. data/plugins/Eventinator.md +0 -30
  61. data/plugins/Foodcritic.md +0 -53
  62. data/plugins/Git.md +0 -53
  63. data/plugins/Graphite.md +0 -30
  64. data/plugins/Grove.md +0 -31
  65. data/plugins/HipChat.md +0 -69
  66. data/plugins/Influxdb.md +0 -25
  67. data/plugins/Irccat.md +0 -50
  68. data/plugins/Jabber.md +0 -61
  69. data/plugins/README.md +0 -70
  70. data/plugins/Rubocop.md +0 -110
  71. data/plugins/Slack.md +0 -48
  72. data/plugins/StatusNet.md +0 -41
  73. data/plugins/Template.md +0 -34
  74. data/spec/spec_helper.rb +0 -10
  75. data/spec/test_helpers.rb +0 -46
  76. data/spec/unit/fixtures/config/spork-config.yml +0 -1
  77. data/spec/unit/fixtures/cookbooks/example/metadata.rb +0 -8
  78. data/spec/unit/fixtures/environments/example.json +0 -12
  79. data/spec/unit/fixtures/knife.rb +0 -6
  80. data/spec/unit/fixtures/test_client.pem +0 -27
  81. data/spec/unit/spork_bump_spec.rb +0 -75
  82. data/spec/unit/spork_info_spec.rb +0 -40
  83. data/spec/unit/spork_promote_spec.rb +0 -77
  84. data/spec/unit/spork_upload_spec.rb +0 -46
@@ -1,48 +1,48 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeEdit < Chef::Knife
5
-
6
- deps do
7
- require 'chef/knife/core/node_editor'
8
- require 'knife-spork/runner'
9
- end
10
-
11
- banner 'knife spork node edit NODE (options)'
12
-
13
- option :all_attributes,
14
- :short => "-a",
15
- :long => "--all",
16
- :boolean => true,
17
- :description => "Display all attributes when editing"
18
-
19
- def run
20
- self.class.send(:include, KnifeSpork::Runner)
21
- self.config = Chef::Config.merge!(config)
22
-
23
- if @name_args.empty?
24
- show_usage
25
- ui.error("You must specify a node name")
26
- exit 1
27
- end
28
-
29
- @object_name = @name_args.first
30
-
31
- run_plugins(:before_nodeedit)
32
- pre_node = load_node(@object_name)
33
- node_edit
34
- post_node = load_node(@object_name)
35
- @object_difference = json_diff(pre_node,post_node).to_s
36
- run_plugins(:after_nodeedit)
37
- end
38
-
39
- private
40
- def node_edit
41
- ne = Chef::Knife::NodeEdit.new
42
- ne.name_args = @name_args
43
- ne.config[:editor] = config[:editor]
44
- ne.config[:all] = config[:all]
45
- ne.run
46
- end
47
- end
48
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeEdit < Chef::Knife
5
+
6
+ deps do
7
+ require 'chef/knife/core/node_editor'
8
+ require 'knife-spork/runner'
9
+ end
10
+
11
+ banner 'knife spork node edit NODE (options)'
12
+
13
+ option :all_attributes,
14
+ :short => "-a",
15
+ :long => "--all",
16
+ :boolean => true,
17
+ :description => "Display all attributes when editing"
18
+
19
+ def run
20
+ self.class.send(:include, KnifeSpork::Runner)
21
+ self.config = Chef::Config.merge!(config)
22
+
23
+ if @name_args.empty?
24
+ show_usage
25
+ ui.error("You must specify a node name")
26
+ exit 1
27
+ end
28
+
29
+ @object_name = @name_args.first
30
+
31
+ run_plugins(:before_nodeedit)
32
+ pre_node = load_node(@object_name)
33
+ node_edit
34
+ post_node = load_node(@object_name)
35
+ @object_difference = json_diff(pre_node,post_node).to_s
36
+ run_plugins(:after_nodeedit)
37
+ end
38
+
39
+ private
40
+ def node_edit
41
+ ne = Chef::Knife::NodeEdit.new
42
+ ne.name_args = @name_args
43
+ ne.config[:editor] = config[:editor]
44
+ ne.config[:all] = config[:all]
45
+ ne.run
46
+ end
47
+ end
48
+ end
@@ -1,46 +1,46 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeFromFile < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node from file FILE (options)'
11
-
12
-
13
- def run
14
- self.class.send(:include, KnifeSpork::Runner)
15
- self.config = Chef::Config.merge!(config)
16
-
17
- if @name_args.empty?
18
- show_usage
19
- ui.error("You must specify a filename")
20
- exit 1
21
- end
22
-
23
- @object_name = JSON.parse(File.read(@name_args.first))["name"]
24
- ui.info @object_name
25
-
26
- run_plugins(:before_nodefromfile)
27
- begin
28
- pre_node = load_node(@object_name.gsub(".json",""))
29
- rescue
30
- pre_node = {}
31
- end
32
- node_fromfile
33
- post_node = load_node(@object_name.gsub(".json",""))
34
- @object_difference = json_diff(pre_node,post_node).to_s
35
- run_plugins(:after_nodefromfile)
36
- end
37
-
38
- private
39
- def node_fromfile
40
- nff = Chef::Knife::NodeFromFile.new
41
- nff.name_args = @name_args
42
- nff.config[:editor] = config[:editor]
43
- nff.run
44
- end
45
- end
46
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeFromFile < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node from file FILE (options)'
11
+
12
+
13
+ def run
14
+ self.class.send(:include, KnifeSpork::Runner)
15
+ self.config = Chef::Config.merge!(config)
16
+
17
+ if @name_args.empty?
18
+ show_usage
19
+ ui.error("You must specify a filename")
20
+ exit 1
21
+ end
22
+
23
+ @object_name = JSON.parse(File.read(@name_args.first))["name"]
24
+ ui.info @object_name
25
+
26
+ run_plugins(:before_nodefromfile)
27
+ begin
28
+ pre_node = load_node(@object_name.gsub(".json",""))
29
+ rescue
30
+ pre_node = {}
31
+ end
32
+ node_fromfile
33
+ post_node = load_node(@object_name.gsub(".json",""))
34
+ @object_difference = json_diff(pre_node,post_node).to_s
35
+ run_plugins(:after_nodefromfile)
36
+ end
37
+
38
+ private
39
+ def node_fromfile
40
+ nff = Chef::Knife::NodeFromFile.new
41
+ nff.name_args = @name_args
42
+ nff.config[:editor] = config[:editor]
43
+ nff.run
44
+ end
45
+ end
46
+ end
@@ -1,51 +1,51 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeRunListAdd < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node run_list add [NODE] [ENTRY[,ENTRY]] (options)'
11
-
12
-
13
- option :after,
14
- :short => "-a ITEM",
15
- :long => "--after ITEM",
16
- :description => "Place the ENTRY in the run list after ITEM"
17
-
18
- def run
19
- self.class.send(:include, KnifeSpork::Runner)
20
- self.config = Chef::Config.merge!(config)
21
-
22
- if @name_args.empty?
23
- show_usage
24
- ui.error("You must specify a node name and item to add")
25
- exit 1
26
- end
27
-
28
- @object_name = @name_args.first
29
-
30
- @object_secondary_name = @name_args[1..-1].map do |entry|
31
- entry.split(',').map { |e| e.strip }
32
- end.flatten.to_s
33
-
34
- run_plugins(:before_noderunlistadd)
35
- pre_node = load_node(@object_name)
36
- node_runlistadd
37
- post_node = load_node(@object_name)
38
- @object_difference = json_diff(pre_node,post_node).to_s
39
- run_plugins(:after_noderunlistadd)
40
- end
41
-
42
- private
43
- def node_runlistadd
44
- nrla = Chef::Knife::NodeRunListAdd.new
45
- nrla.name_args = @name_args
46
- nrla.config[:editor] = config[:editor]
47
- nrla.config[:after] = config[:after]
48
- nrla.run
49
- end
50
- end
51
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeRunListAdd < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node run_list add [NODE] [ENTRY[,ENTRY]] (options)'
11
+
12
+
13
+ option :after,
14
+ :short => "-a ITEM",
15
+ :long => "--after ITEM",
16
+ :description => "Place the ENTRY in the run list after ITEM"
17
+
18
+ def run
19
+ self.class.send(:include, KnifeSpork::Runner)
20
+ self.config = Chef::Config.merge!(config)
21
+
22
+ if @name_args.empty?
23
+ show_usage
24
+ ui.error("You must specify a node name and item to add")
25
+ exit 1
26
+ end
27
+
28
+ @object_name = @name_args.first
29
+
30
+ @object_secondary_name = @name_args[1..-1].map do |entry|
31
+ entry.split(',').map { |e| e.strip }
32
+ end.flatten.to_s
33
+
34
+ run_plugins(:before_noderunlistadd)
35
+ pre_node = load_node(@object_name)
36
+ node_runlistadd
37
+ post_node = load_node(@object_name)
38
+ @object_difference = json_diff(pre_node,post_node).to_s
39
+ run_plugins(:after_noderunlistadd)
40
+ end
41
+
42
+ private
43
+ def node_runlistadd
44
+ nrla = Chef::Knife::NodeRunListAdd.new
45
+ nrla.name_args = @name_args
46
+ nrla.config[:editor] = config[:editor]
47
+ nrla.config[:after] = config[:after]
48
+ nrla.run
49
+ end
50
+ end
51
+ end
@@ -1,44 +1,44 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeRunListRemove < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node run_list add [NODE] [ENTRY[,ENTRY]] (options)'
11
-
12
- def run
13
- self.class.send(:include, KnifeSpork::Runner)
14
- self.config = Chef::Config.merge!(config)
15
-
16
- if @name_args.empty?
17
- show_usage
18
- ui.error("You must specify a node name and item to remove")
19
- exit 1
20
- end
21
-
22
- @object_name = @name_args.first
23
-
24
- @object_secondary_name = @name_args[1..-1].map do |entry|
25
- entry.split(',').map { |e| e.strip }
26
- end.flatten.to_s
27
-
28
- run_plugins(:before_noderunlistremove)
29
- pre_node = load_node(@object_name)
30
- node_runlistremove
31
- post_node = load_node(@object_name)
32
- @object_difference = json_diff(pre_node,post_node).to_s
33
- run_plugins(:after_noderunlistremove)
34
- end
35
-
36
- private
37
- def node_runlistremove
38
- nrla = Chef::Knife::NodeRunListRemove.new
39
- nrla.name_args = @name_args
40
- nrla.config[:editor] = config[:editor]
41
- nrla.run
42
- end
43
- end
44
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeRunListRemove < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node run_list add [NODE] [ENTRY[,ENTRY]] (options)'
11
+
12
+ def run
13
+ self.class.send(:include, KnifeSpork::Runner)
14
+ self.config = Chef::Config.merge!(config)
15
+
16
+ if @name_args.empty?
17
+ show_usage
18
+ ui.error("You must specify a node name and item to remove")
19
+ exit 1
20
+ end
21
+
22
+ @object_name = @name_args.first
23
+
24
+ @object_secondary_name = @name_args[1..-1].map do |entry|
25
+ entry.split(',').map { |e| e.strip }
26
+ end.flatten.to_s
27
+
28
+ run_plugins(:before_noderunlistremove)
29
+ pre_node = load_node(@object_name)
30
+ node_runlistremove
31
+ post_node = load_node(@object_name)
32
+ @object_difference = json_diff(pre_node,post_node).to_s
33
+ run_plugins(:after_noderunlistremove)
34
+ end
35
+
36
+ private
37
+ def node_runlistremove
38
+ nrla = Chef::Knife::NodeRunListRemove.new
39
+ nrla.name_args = @name_args
40
+ nrla.config[:editor] = config[:editor]
41
+ nrla.run
42
+ end
43
+ end
44
+ end
@@ -1,44 +1,44 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeRunListSet < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node run_list set NODE ENTRIES (options)'
11
-
12
- def run
13
- self.class.send(:include, KnifeSpork::Runner)
14
- self.config = Chef::Config.merge!(config)
15
-
16
- if @name_args.size < 2
17
- ui.error "You must supply both a node name and a run list."
18
- show_usage
19
- exit 1
20
- end
21
-
22
- @object_name = @name_args.first
23
-
24
- @object_secondary_name = @name_args[1..-1].map do |entry|
25
- entry.split(',').map { |e| e.strip }
26
- end.flatten.to_s
27
-
28
- run_plugins(:before_noderunlistset)
29
- pre_node = load_node(@object_name)
30
- node_runlistset
31
- post_node = load_node(@object_name)
32
- @object_difference = json_diff(pre_node,post_node).to_s
33
- run_plugins(:after_noderunlistset)
34
- end
35
-
36
- private
37
- def node_runlistset
38
- nrla = Chef::Knife::NodeRunListSet.new
39
- nrla.name_args = @name_args
40
- nrla.config[:editor] = config[:editor]
41
- nrla.run
42
- end
43
- end
44
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeRunListSet < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node run_list set NODE ENTRIES (options)'
11
+
12
+ def run
13
+ self.class.send(:include, KnifeSpork::Runner)
14
+ self.config = Chef::Config.merge!(config)
15
+
16
+ if @name_args.size < 2
17
+ ui.error "You must supply both a node name and a run list."
18
+ show_usage
19
+ exit 1
20
+ end
21
+
22
+ @object_name = @name_args.first
23
+
24
+ @object_secondary_name = @name_args[1..-1].map do |entry|
25
+ entry.split(',').map { |e| e.strip }
26
+ end.flatten.to_s
27
+
28
+ run_plugins(:before_noderunlistset)
29
+ pre_node = load_node(@object_name)
30
+ node_runlistset
31
+ post_node = load_node(@object_name)
32
+ @object_difference = json_diff(pre_node,post_node).to_s
33
+ run_plugins(:after_noderunlistset)
34
+ end
35
+
36
+ private
37
+ def node_runlistset
38
+ nrla = Chef::Knife::NodeRunListSet.new
39
+ nrla.name_args = @name_args
40
+ nrla.config[:editor] = config[:editor]
41
+ nrla.run
42
+ end
43
+ end
44
+ end