choria-mcorpc-support 2.24.3 → 2.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcollective/agent/aaa_signer.ddl +41 -0
- data/lib/mcollective/agent/aaa_signer.json +46 -0
- data/lib/mcollective/agent/choria_provision.ddl +297 -0
- data/lib/mcollective/agent/choria_provision.json +323 -0
- data/lib/mcollective/agent/choria_registry.ddl +65 -0
- data/lib/mcollective/agent/choria_registry.json +74 -0
- data/lib/mcollective/agent/choria_util.ddl +24 -4
- data/lib/mcollective/agent/choria_util.json +24 -24
- data/lib/mcollective/agent/rpcutil.ddl +242 -183
- data/lib/mcollective/agent/rpcutil.json +53 -56
- data/lib/mcollective/agent/scout.ddl +4 -4
- data/lib/mcollective/agent/scout.json +1 -1
- data/lib/mcollective/discovery/delegate.rb +6 -2
- data/lib/mcollective/util/tasks_support.rb +12 -3
- metadata +14 -2
@@ -2,10 +2,10 @@
|
|
2
2
|
"$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json",
|
3
3
|
"metadata": {
|
4
4
|
"name": "rpcutil",
|
5
|
-
"description": "
|
5
|
+
"description": "Utility actions that expose information about the state of the running Server",
|
6
6
|
"author": "R.I.Pienaar <rip@devco.net>",
|
7
|
-
"license": "Apache
|
8
|
-
"version": "0.
|
7
|
+
"license": "Apache-2.0",
|
8
|
+
"version": "0.24.0",
|
9
9
|
"url": "https://choria.io/",
|
10
10
|
"timeout": 2
|
11
11
|
},
|
@@ -18,11 +18,11 @@
|
|
18
18
|
"agents": {
|
19
19
|
"description": "List of agents on the server",
|
20
20
|
"display_as": "Agents",
|
21
|
-
"
|
21
|
+
"type": "array"
|
22
22
|
}
|
23
23
|
},
|
24
24
|
"display": "always",
|
25
|
-
"description": "Inventory of all agents on the server"
|
25
|
+
"description": "Inventory of all agents on the server including versions, licenses and more"
|
26
26
|
},
|
27
27
|
{
|
28
28
|
"action": "collective_info",
|
@@ -32,16 +32,16 @@
|
|
32
32
|
"main_collective": {
|
33
33
|
"description": "The main Collective",
|
34
34
|
"display_as": "Main Collective",
|
35
|
-
"
|
35
|
+
"type": "string"
|
36
36
|
},
|
37
37
|
"collectives": {
|
38
38
|
"description": "All Collectives",
|
39
39
|
"display_as": "All Collectives",
|
40
|
-
"
|
40
|
+
"type": "array"
|
41
41
|
}
|
42
42
|
},
|
43
43
|
"display": "always",
|
44
|
-
"description": "Info about the main and sub collectives",
|
44
|
+
"description": "Info about the main and sub collectives that the server belongs to",
|
45
45
|
"aggregate": [
|
46
46
|
{
|
47
47
|
"function": "summary",
|
@@ -57,74 +57,74 @@
|
|
57
57
|
},
|
58
58
|
"output": {
|
59
59
|
"threads": {
|
60
|
-
"description": "List of threads active in the
|
60
|
+
"description": "List of threads active in the Choria Server",
|
61
61
|
"display_as": "Threads",
|
62
|
-
"
|
62
|
+
"type": "array"
|
63
63
|
},
|
64
64
|
"agents": {
|
65
65
|
"description": "List of agents loaded",
|
66
66
|
"display_as": "Agents",
|
67
|
-
"
|
67
|
+
"type": "array"
|
68
68
|
},
|
69
69
|
"pid": {
|
70
|
-
"description": "Process ID of the
|
70
|
+
"description": "Process ID of the Choria Server",
|
71
71
|
"display_as": "PID",
|
72
|
-
"
|
72
|
+
"type": "integer"
|
73
73
|
},
|
74
74
|
"times": {
|
75
|
-
"description": "Processor time consumed by the
|
75
|
+
"description": "Processor time consumed by the Choria Server",
|
76
76
|
"display_as": "Times",
|
77
|
-
"
|
77
|
+
"type": "hash"
|
78
78
|
},
|
79
79
|
"validated": {
|
80
|
-
"description": "
|
80
|
+
"description": "Count of messages that passed security validation",
|
81
81
|
"display_as": "Security Validated",
|
82
|
-
"
|
82
|
+
"type": "integer"
|
83
83
|
},
|
84
84
|
"unvalidated": {
|
85
|
-
"description": "
|
85
|
+
"description": "Count of messages that failed security validation",
|
86
86
|
"display_as": "Failed Security",
|
87
|
-
"
|
87
|
+
"type": "integer"
|
88
88
|
},
|
89
89
|
"passed": {
|
90
|
-
"description": "
|
90
|
+
"description": "Count of messages that passed filter checks",
|
91
91
|
"display_as": "Passed Filter",
|
92
|
-
"
|
92
|
+
"type": "integer"
|
93
93
|
},
|
94
94
|
"filtered": {
|
95
|
-
"description": "
|
95
|
+
"description": "Count of message that didn't pass filter checks",
|
96
96
|
"display_as": "Failed Filter",
|
97
|
-
"
|
97
|
+
"type": "integer"
|
98
98
|
},
|
99
99
|
"starttime": {
|
100
|
-
"description": "Time the
|
100
|
+
"description": "Time the Choria Server started in unix seconds",
|
101
101
|
"display_as": "Start Time",
|
102
|
-
"
|
102
|
+
"type": "integer"
|
103
103
|
},
|
104
104
|
"total": {
|
105
|
-
"description": "
|
105
|
+
"description": "Count of messages received by the Choria Server",
|
106
106
|
"display_as": "Total Messages",
|
107
|
-
"
|
107
|
+
"type": "integer"
|
108
108
|
},
|
109
109
|
"replies": {
|
110
|
-
"description": "
|
110
|
+
"description": "Count of replies sent back to clients",
|
111
111
|
"display_as": "Replies",
|
112
|
-
"
|
112
|
+
"type": "integer"
|
113
113
|
},
|
114
114
|
"configfile": {
|
115
115
|
"description": "Config file used to start the daemon",
|
116
116
|
"display_as": "Config File",
|
117
|
-
"
|
117
|
+
"type": "string"
|
118
118
|
},
|
119
119
|
"version": {
|
120
|
-
"description": "
|
120
|
+
"description": "Choria Server Version",
|
121
121
|
"display_as": "Version",
|
122
|
-
"
|
122
|
+
"type": "string"
|
123
123
|
},
|
124
124
|
"ttlexpired": {
|
125
|
-
"description": "
|
125
|
+
"description": "Count of messages that did pass TTL checks",
|
126
126
|
"display_as": "TTL Expired",
|
127
|
-
"
|
127
|
+
"type": "integer"
|
128
128
|
}
|
129
129
|
},
|
130
130
|
"display": "always",
|
@@ -151,22 +151,20 @@
|
|
151
151
|
"prompt": "Configuration Item",
|
152
152
|
"description": "The item to retrieve from the server",
|
153
153
|
"type": "string",
|
154
|
-
"default": null,
|
155
154
|
"optional": false,
|
156
155
|
"validation": "^.+$",
|
157
|
-
"maxlength":
|
156
|
+
"maxlength": 120
|
158
157
|
}
|
159
158
|
},
|
160
159
|
"output": {
|
161
160
|
"item": {
|
162
161
|
"description": "The config property being retrieved",
|
163
162
|
"display_as": "Property",
|
164
|
-
"
|
163
|
+
"type": "string"
|
165
164
|
},
|
166
165
|
"value": {
|
167
166
|
"description": "The value that is in use",
|
168
|
-
"display_as": "Value"
|
169
|
-
"default": null
|
167
|
+
"display_as": "Value"
|
170
168
|
}
|
171
169
|
},
|
172
170
|
"display": "always",
|
@@ -187,7 +185,6 @@
|
|
187
185
|
"prompt": "Data Source",
|
188
186
|
"description": "The data plugin to retrieve information from",
|
189
187
|
"type": "string",
|
190
|
-
"default": null,
|
191
188
|
"optional": false,
|
192
189
|
"validation": "^\\w+$",
|
193
190
|
"maxlength": 50
|
@@ -202,8 +199,7 @@
|
|
202
199
|
"maxlength": 200
|
203
200
|
}
|
204
201
|
},
|
205
|
-
"output": {
|
206
|
-
},
|
202
|
+
"output": {},
|
207
203
|
"display": "always",
|
208
204
|
"description": "Get data from a data plugin"
|
209
205
|
},
|
@@ -224,7 +220,7 @@
|
|
224
220
|
"fact": {
|
225
221
|
"description": "The name of the fact being returned",
|
226
222
|
"display_as": "Fact",
|
227
|
-
"
|
223
|
+
"type": "string"
|
228
224
|
},
|
229
225
|
"value": {
|
230
226
|
"description": "The value of the fact",
|
@@ -247,7 +243,7 @@
|
|
247
243
|
"action": "get_facts",
|
248
244
|
"input": {
|
249
245
|
"facts": {
|
250
|
-
"prompt": "Comma-separated list of facts",
|
246
|
+
"prompt": "Comma-separated list of facts to retrieve",
|
251
247
|
"description": "Facts to retrieve",
|
252
248
|
"type": "string",
|
253
249
|
"default": null,
|
@@ -260,7 +256,7 @@
|
|
260
256
|
"values": {
|
261
257
|
"description": "List of values of the facts",
|
262
258
|
"display_as": "Values",
|
263
|
-
"
|
259
|
+
"type": "hash"
|
264
260
|
}
|
265
261
|
},
|
266
262
|
"display": "always",
|
@@ -274,41 +270,42 @@
|
|
274
270
|
"agents": {
|
275
271
|
"description": "List of agent names",
|
276
272
|
"display_as": "Agents",
|
277
|
-
"
|
273
|
+
"type": "array"
|
278
274
|
},
|
279
275
|
"facts": {
|
280
276
|
"description": "List of facts and values",
|
281
277
|
"display_as": "Facts",
|
282
|
-
"
|
278
|
+
"type": "hash"
|
283
279
|
},
|
284
280
|
"classes": {
|
285
281
|
"description": "List of classes on the system",
|
286
282
|
"display_as": "Classes",
|
287
|
-
"
|
283
|
+
"type": "array"
|
288
284
|
},
|
289
285
|
"version": {
|
290
|
-
"description": "
|
286
|
+
"description": "Choria Server Version",
|
291
287
|
"display_as": "Version",
|
292
|
-
"
|
288
|
+
"type": "string"
|
293
289
|
},
|
294
290
|
"main_collective": {
|
295
291
|
"description": "The main Collective",
|
296
292
|
"display_as": "Main Collective",
|
297
|
-
"
|
293
|
+
"type": "string"
|
298
294
|
},
|
299
295
|
"collectives": {
|
300
296
|
"description": "All Collectives",
|
301
297
|
"display_as": "All Collectives",
|
302
|
-
"
|
298
|
+
"type": "array"
|
303
299
|
},
|
304
300
|
"data_plugins": {
|
305
301
|
"description": "List of data plugin names",
|
306
302
|
"display_as": "Data Plugins",
|
307
|
-
"
|
303
|
+
"type": "array"
|
308
304
|
},
|
309
305
|
"machines": {
|
310
306
|
"description": "Autonomous Agents",
|
311
|
-
"display_as": "Machines"
|
307
|
+
"display_as": "Machines",
|
308
|
+
"type": "hash"
|
312
309
|
}
|
313
310
|
},
|
314
311
|
"display": "always",
|
@@ -320,9 +317,9 @@
|
|
320
317
|
},
|
321
318
|
"output": {
|
322
319
|
"pong": {
|
323
|
-
"description": "The local timestamp",
|
320
|
+
"description": "The local Unix timestamp",
|
324
321
|
"display_as": "Timestamp",
|
325
|
-
"
|
322
|
+
"type": "string"
|
326
323
|
}
|
327
324
|
},
|
328
325
|
"display": "always",
|
@@ -2,7 +2,7 @@ metadata :name => "scout",
|
|
2
2
|
:description => "Choria Scout Agent Management API",
|
3
3
|
:author => "R.I.Pienaar <rip@devco.net>",
|
4
4
|
:license => "Apache-2.0",
|
5
|
-
:version => "0.0
|
5
|
+
:version => "0.24.0",
|
6
6
|
:url => "https://choria.io",
|
7
7
|
:provider => "golang",
|
8
8
|
:timeout => 5
|
@@ -132,9 +132,9 @@ action "goss_validate", :description => "Performs a Goss validation using a spec
|
|
132
132
|
:display_as => "Tests"
|
133
133
|
|
134
134
|
summarize do
|
135
|
-
aggregate summary(:tests, :format => "%s
|
136
|
-
aggregate summary(:failures, :format => "%s Failed
|
137
|
-
aggregate summary(:success, :format => "%s Passed
|
135
|
+
aggregate summary(:tests, :format => "%s Tests on %d node(s)")
|
136
|
+
aggregate summary(:failures, :format => "%s Failed test on %d node(s)")
|
137
|
+
aggregate summary(:success, :format => "%s Passed tests on %d node(s)")
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
@@ -10,6 +10,9 @@ module MCollective
|
|
10
10
|
|
11
11
|
cmd = [binary_name, "discover", "-j", "--silent"]
|
12
12
|
|
13
|
+
config = client.options.fetch(:config)
|
14
|
+
cmd << "--config" << config if config
|
15
|
+
|
13
16
|
cmd << "-T" << filter["collective"] if filter["collective"]
|
14
17
|
|
15
18
|
filter.fetch("identity", []).each do |i|
|
@@ -53,17 +56,18 @@ module MCollective
|
|
53
56
|
|
54
57
|
begin
|
55
58
|
Timeout.timeout(timeout + 0.5) do
|
59
|
+
out = stdout.read
|
56
60
|
status = wait_thr.value
|
57
61
|
|
58
62
|
raise("Choria discovery failed: %s" % stderr.read) unless status.exitstatus == 0
|
63
|
+
|
64
|
+
nodes.concat(JSON.parse(out))
|
59
65
|
end
|
60
66
|
rescue Timeout::Error
|
61
67
|
Log.warn("Timeout waiting for Choria to perform discovery")
|
62
68
|
Process.kill("KILL", wait_thr[:pid])
|
63
69
|
raise("Choria failed to complete discovery within %d timeout" % timeout)
|
64
70
|
end
|
65
|
-
|
66
|
-
nodes.concat(JSON.parse(stdout.read))
|
67
71
|
end
|
68
72
|
|
69
73
|
nodes
|
@@ -65,7 +65,7 @@ module MCollective
|
|
65
65
|
# AIO path to binaries like wrappers etc
|
66
66
|
def aio_bin_path
|
67
67
|
if Util.windows?
|
68
|
-
'C:\Program Files\Puppet Labs\Puppet\bin'
|
68
|
+
'C:\Program Files\Puppet Labs\Puppet\puppet\bin'
|
69
69
|
else
|
70
70
|
"/opt/puppetlabs/puppet/bin"
|
71
71
|
end
|
@@ -88,6 +88,13 @@ module MCollective
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
+
# Is this an AIO install?
|
92
|
+
#
|
93
|
+
# @return [Boolean]
|
94
|
+
def aio?
|
95
|
+
File.directory?(aio_bin_path)
|
96
|
+
end
|
97
|
+
|
91
98
|
# Path to the task wrapper executable
|
92
99
|
#
|
93
100
|
# @return [String]
|
@@ -179,6 +186,8 @@ module MCollective
|
|
179
186
|
"_choria_task_caller" => task_caller
|
180
187
|
}
|
181
188
|
|
189
|
+
environment["PATH"] = "#{aio_bin_path}#{File::PATH_SEPARATOR}#{ENV['PATH']}" if aio?
|
190
|
+
|
182
191
|
return environment unless task["input"]
|
183
192
|
return environment unless ["both", "environment"].include?(task_input_method(task))
|
184
193
|
|
@@ -250,7 +259,7 @@ module MCollective
|
|
250
259
|
# act on these tasks either by asking for their status or perhaps killing
|
251
260
|
# them?
|
252
261
|
#
|
253
|
-
# @param command [
|
262
|
+
# @param command [String] command to run
|
254
263
|
# @param environment [Hash] environment to run with
|
255
264
|
# @param stdin [String] stdin to send to the command
|
256
265
|
# @param spooldir [String] path to the spool for this specific request
|
@@ -291,7 +300,7 @@ module MCollective
|
|
291
300
|
Process.exec(environment, command, options)
|
292
301
|
end
|
293
302
|
else
|
294
|
-
pid = Process.spawn(environment, command, options)
|
303
|
+
pid = Process.spawn(environment, [command, command], options)
|
295
304
|
end
|
296
305
|
|
297
306
|
sleep 0.1 until File.exist?(wrapper_stdout)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: choria-mcorpc-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.25.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- R.I.Pienaar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|
@@ -37,6 +37,9 @@ dependencies:
|
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0.6'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.7.0
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -44,6 +47,9 @@ dependencies:
|
|
44
47
|
- - "~>"
|
45
48
|
- !ruby/object:Gem::Version
|
46
49
|
version: '0.6'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.7.0
|
47
53
|
description: Libraries enabling Ruby support for the Choria Orchestration Server
|
48
54
|
email: rip@devco.net
|
49
55
|
executables:
|
@@ -54,9 +60,15 @@ files:
|
|
54
60
|
- bin/mco
|
55
61
|
- lib/mcollective.rb
|
56
62
|
- lib/mcollective/agent.rb
|
63
|
+
- lib/mcollective/agent/aaa_signer.ddl
|
64
|
+
- lib/mcollective/agent/aaa_signer.json
|
57
65
|
- lib/mcollective/agent/bolt_tasks.ddl
|
58
66
|
- lib/mcollective/agent/bolt_tasks.json
|
59
67
|
- lib/mcollective/agent/bolt_tasks.rb
|
68
|
+
- lib/mcollective/agent/choria_provision.ddl
|
69
|
+
- lib/mcollective/agent/choria_provision.json
|
70
|
+
- lib/mcollective/agent/choria_registry.ddl
|
71
|
+
- lib/mcollective/agent/choria_registry.json
|
60
72
|
- lib/mcollective/agent/choria_util.ddl
|
61
73
|
- lib/mcollective/agent/choria_util.json
|
62
74
|
- lib/mcollective/agent/rpcutil.ddl
|