knife-node-context-exec 1.0.2 → 1.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/knife/context_exec.rb +21 -19
- data/lib/knife-node-context-exec/version.rb +1 -1
- 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: 46bedee57a032fb09b569f83b7a3e789515b397d
|
4
|
+
data.tar.gz: 505435686cd23f4b02c3d8c0695c921f9b976d12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2470def677777328ade531ab064166d5e948e5424b9bbc6283ca1fbf0879027b37340588c4a4fefa1fd13439276105198159a43020c76ece0f9d63f47828cc8b
|
7
|
+
data.tar.gz: cfac89ee55083e59c5dac2a73a3bda9a6e5b63a702be0305d7f125d939dfc4602146734f4748bbc2a6a9519eebab7748e159ddf9f8564095ecd4a8e9111639ed
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'knife-node-context-exec/version'
|
2
|
+
require 'chef/knife'
|
2
3
|
|
3
4
|
# The knife
|
4
5
|
class ContextExec < Chef::Knife
|
@@ -10,37 +11,38 @@ class ContextExec < Chef::Knife
|
|
10
11
|
end
|
11
12
|
|
12
13
|
option :environment,
|
13
|
-
short: '-E',
|
14
|
-
long: '--environment',
|
14
|
+
short: '-E VALUE',
|
15
|
+
long: '--environment VALUE',
|
15
16
|
description: 'The environment to search.'
|
16
17
|
option :node_query,
|
17
|
-
short: '-Q',
|
18
|
-
long: '--query',
|
18
|
+
short: '-Q VALUE',
|
19
|
+
long: '--query VALUE',
|
19
20
|
description: 'The node query.'
|
20
21
|
option :directory,
|
21
|
-
short: '-D',
|
22
|
-
long: '--directory',
|
22
|
+
short: '-D VALUE',
|
23
|
+
long: '--directory VALUE',
|
23
24
|
description: 'A directory for working files.'
|
24
25
|
option :template_filename,
|
25
|
-
short: '-T',
|
26
|
-
long: '--template',
|
26
|
+
short: '-T VALUE',
|
27
|
+
long: '--template VALUE',
|
27
28
|
description: 'The filename of a template.'
|
28
29
|
option :script_filename,
|
29
|
-
short: '-S',
|
30
|
-
long: '--script',
|
30
|
+
short: '-S VALUE',
|
31
|
+
long: '--script VALUE',
|
31
32
|
description: 'The environment to search.'
|
32
33
|
option :command,
|
33
|
-
short: '-C',
|
34
|
-
long: '--command',
|
34
|
+
short: '-C VALUE',
|
35
|
+
long: '--command VALUE',
|
35
36
|
description: 'The command to run.'
|
36
37
|
option :filter_regex,
|
37
|
-
short: '-R',
|
38
|
-
long: '--regex',
|
38
|
+
short: '-R VALUE',
|
39
|
+
long: '--regex VALUE',
|
39
40
|
description: 'A regex used to filter output.'
|
40
41
|
option :parallel,
|
41
|
-
short: '-P',
|
42
|
-
long: '--parallel',
|
43
|
-
description: 'Run in parallel?'
|
42
|
+
short: '-P VALUE',
|
43
|
+
long: '--parallel VALUE',
|
44
|
+
description: 'Run in parallel?',
|
45
|
+
boolean: true
|
44
46
|
|
45
47
|
def run
|
46
48
|
puts "knife context exec #{KnifeNodeContextExec::VERSION}"
|
@@ -51,7 +53,7 @@ class ContextExec < Chef::Knife
|
|
51
53
|
script_filename = config[:script_filename].to_s
|
52
54
|
command = config[:command].to_s
|
53
55
|
filter_regex = config[:filter_regex].to_s
|
54
|
-
parallel = config[:parallel]
|
56
|
+
parallel = config[:parallel]
|
55
57
|
puts "Environment: #{environment}"
|
56
58
|
puts "Query: #{node_query}"
|
57
59
|
puts "Directory: #{directory}"
|
@@ -65,6 +67,6 @@ class ContextExec < Chef::Knife
|
|
65
67
|
end
|
66
68
|
nodes.each { |node| puts "Found #{node.name}" }
|
67
69
|
KnifeNodeContextExec.run(nodes, directory, template_filename, script_filename, command, filter_regex,
|
68
|
-
parallel
|
70
|
+
parallel, false)
|
69
71
|
end
|
70
72
|
end
|