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.
- checksums.yaml +4 -4
- data/LICENSE +35 -35
- data/lib/chef/knife/spork-bump.rb +100 -100
- data/lib/chef/knife/spork-check.rb +165 -161
- data/lib/chef/knife/spork-databag-create.rb +54 -54
- data/lib/chef/knife/spork-databag-delete.rb +51 -51
- data/lib/chef/knife/spork-databag-edit.rb +54 -54
- data/lib/chef/knife/spork-databag-fromfile.rb +88 -88
- data/lib/chef/knife/spork-delete.rb +132 -132
- data/lib/chef/knife/spork-environment-check.rb +90 -90
- data/lib/chef/knife/spork-environment-create.rb +63 -63
- data/lib/chef/knife/spork-environment-delete.rb +38 -38
- data/lib/chef/knife/spork-environment-edit.rb +40 -40
- data/lib/chef/knife/spork-environment-fromfile.rb +46 -46
- data/lib/chef/knife/spork-info.rb +34 -34
- data/lib/chef/knife/spork-node-create.rb +41 -41
- data/lib/chef/knife/spork-node-delete.rb +41 -41
- data/lib/chef/knife/spork-node-edit.rb +48 -48
- data/lib/chef/knife/spork-node-fromfile.rb +46 -46
- data/lib/chef/knife/spork-node-runlistadd.rb +51 -51
- data/lib/chef/knife/spork-node-runlistremove.rb +44 -44
- data/lib/chef/knife/spork-node-runlistset.rb +44 -44
- data/lib/chef/knife/spork-omni.rb +112 -112
- data/lib/chef/knife/spork-promote.rb +197 -197
- data/lib/chef/knife/spork-role-create.rb +46 -46
- data/lib/chef/knife/spork-role-delete.rb +50 -50
- data/lib/chef/knife/spork-role-edit.rb +40 -40
- data/lib/chef/knife/spork-role-fromfile.rb +65 -65
- data/lib/chef/knife/spork-upload.rb +151 -151
- data/lib/chef/knife/spork-version.rb +12 -12
- data/lib/knife-spork.rb +3 -3
- data/lib/knife-spork/plugins.rb +27 -27
- data/lib/knife-spork/plugins/campfire.rb +219 -219
- data/lib/knife-spork/plugins/eventinator.rb +329 -329
- data/lib/knife-spork/plugins/foodcritic.rb +46 -46
- data/lib/knife-spork/plugins/git.rb +393 -399
- data/lib/knife-spork/plugins/graphite.rb +25 -25
- data/lib/knife-spork/plugins/grove.rb +167 -167
- data/lib/knife-spork/plugins/hipchat.rb +171 -171
- data/lib/knife-spork/plugins/influxdb.rb +28 -28
- data/lib/knife-spork/plugins/irccat.rb +332 -332
- data/lib/knife-spork/plugins/jabber.rb +133 -133
- data/lib/knife-spork/plugins/plugin.rb +117 -117
- data/lib/knife-spork/plugins/rubocop.rb +56 -56
- data/lib/knife-spork/plugins/slack.rb +125 -125
- data/lib/knife-spork/plugins/statusnet.rb +122 -122
- data/lib/knife-spork/runner.rb +342 -342
- data/lib/knife-spork/version.rb +5 -5
- metadata +4 -51
- data/.gitignore +0 -21
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -3
- data/CHANGELOG.md +0 -445
- data/Gemfile +0 -3
- data/README.md +0 -544
- data/Rakefile +0 -35
- data/knife-spork.gemspec +0 -28
- data/plugins/Campfire.md +0 -43
- data/plugins/Eventinator.md +0 -30
- data/plugins/Foodcritic.md +0 -53
- data/plugins/Git.md +0 -53
- data/plugins/Graphite.md +0 -30
- data/plugins/Grove.md +0 -31
- data/plugins/HipChat.md +0 -69
- data/plugins/Influxdb.md +0 -25
- data/plugins/Irccat.md +0 -50
- data/plugins/Jabber.md +0 -61
- data/plugins/README.md +0 -70
- data/plugins/Rubocop.md +0 -110
- data/plugins/Slack.md +0 -48
- data/plugins/StatusNet.md +0 -41
- data/plugins/Template.md +0 -34
- data/spec/spec_helper.rb +0 -10
- data/spec/test_helpers.rb +0 -46
- data/spec/unit/fixtures/config/spork-config.yml +0 -1
- data/spec/unit/fixtures/cookbooks/example/metadata.rb +0 -8
- data/spec/unit/fixtures/environments/example.json +0 -12
- data/spec/unit/fixtures/knife.rb +0 -6
- data/spec/unit/fixtures/test_client.pem +0 -27
- data/spec/unit/spork_bump_spec.rb +0 -75
- data/spec/unit/spork_info_spec.rb +0 -40
- data/spec/unit/spork_promote_spec.rb +0 -77
- 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
|