choria-mcorpc-support 2.23.1 → 2.24.2
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 +5 -5
- data/lib/mcollective.rb +3 -2
- data/lib/mcollective/agent/choria_util.ddl +206 -107
- data/lib/mcollective/agent/choria_util.json +101 -1
- data/lib/mcollective/agent/rpcutil.json +2 -3
- data/lib/mcollective/agent/scout.json +107 -135
- data/lib/mcollective/application/facts.rb +2 -67
- data/lib/mcollective/application/find.rb +1 -1
- data/lib/mcollective/application/plugin.rb +2 -15
- data/lib/mcollective/client.rb +1 -1
- data/lib/mcollective/config.rb +135 -103
- data/lib/mcollective/ddl.rb +0 -1
- data/lib/mcollective/discovery.rb +11 -63
- data/lib/mcollective/discovery/broadcast.ddl +11 -0
- data/lib/mcollective/discovery/choria.ddl +6 -4
- data/lib/mcollective/discovery/delegate.ddl +13 -0
- data/lib/mcollective/discovery/delegate.rb +73 -0
- data/lib/mcollective/discovery/external.ddl +13 -0
- data/lib/mcollective/discovery/file.ddl +13 -0
- data/lib/mcollective/discovery/flatfile.ddl +7 -5
- data/lib/mcollective/discovery/inventory.ddl +13 -0
- data/lib/mcollective/discovery/mc.ddl +3 -3
- data/lib/mcollective/generators.rb +0 -1
- data/lib/mcollective/optionparser.rb +1 -1
- data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
- data/lib/mcollective/rpc/client.rb +4 -2
- data/lib/mcollective/util.rb +25 -35
- data/lib/mcollective/util/tasks_support.rb +15 -2
- metadata +9 -23
- data/lib/mcollective/data.rb +0 -96
- data/lib/mcollective/data/agent_data.ddl +0 -22
- data/lib/mcollective/data/agent_data.rb +0 -17
- data/lib/mcollective/data/base.rb +0 -68
- data/lib/mcollective/data/bolt_task_data.ddl +0 -90
- data/lib/mcollective/data/bolt_task_data.rb +0 -32
- data/lib/mcollective/data/collective_data.ddl +0 -20
- data/lib/mcollective/data/collective_data.rb +0 -9
- data/lib/mcollective/data/fact_data.ddl +0 -28
- data/lib/mcollective/data/fact_data.rb +0 -55
- data/lib/mcollective/data/fstat_data.ddl +0 -89
- data/lib/mcollective/data/fstat_data.rb +0 -54
- data/lib/mcollective/data/result.rb +0 -50
- data/lib/mcollective/ddl/dataddl.rb +0 -56
- data/lib/mcollective/discovery/choria.rb +0 -223
- data/lib/mcollective/discovery/flatfile.rb +0 -47
- data/lib/mcollective/discovery/stdin.ddl +0 -11
- data/lib/mcollective/discovery/stdin.rb +0 -67
- data/lib/mcollective/generators/data_generator.rb +0 -50
- data/lib/mcollective/generators/templates/data_input_snippet.erb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8c9b96995926bcb736c4d7340f1e35c82673db5ce74de15443a79fba36873a2a
|
4
|
+
data.tar.gz: f00bd913097f164271403440750015b73041d61b54712dadc728f0b56859d9c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 996376fe60e4d07d576f18900fb17c062888e467dc04354b58665d7f16ac55dbd44a778146d70e517ea4e5c5ba11cc3437a83ac83644ff9493fcb3c48cc5fece
|
7
|
+
data.tar.gz: 217bcb3d3b7ec754dcb0756c68d68ec539546b44f084191b5abd47a21628b1029deabe118ab356db34a5727565734d34bf74c15d4c518a9fcc8109a066442fab
|
data/lib/mcollective.rb
CHANGED
@@ -15,6 +15,7 @@ require "mcollective/monkey_patches"
|
|
15
15
|
require "mcollective/cache"
|
16
16
|
require "mcollective/exceptions"
|
17
17
|
require "systemu"
|
18
|
+
require "open3"
|
18
19
|
|
19
20
|
# == The Marionette Collective
|
20
21
|
#
|
@@ -34,9 +35,9 @@ module MCollective
|
|
34
35
|
require "mcollective/client"
|
35
36
|
require "mcollective/config"
|
36
37
|
require "mcollective/connector"
|
37
|
-
require "mcollective/data"
|
38
38
|
require "mcollective/ddl"
|
39
39
|
require "mcollective/discovery"
|
40
|
+
require "mcollective/discovery/delegate"
|
40
41
|
require "mcollective/facts"
|
41
42
|
require "mcollective/logger"
|
42
43
|
require "mcollective/log"
|
@@ -53,7 +54,7 @@ module MCollective
|
|
53
54
|
require "mcollective/util"
|
54
55
|
require "mcollective/validator"
|
55
56
|
|
56
|
-
VERSION = "2.
|
57
|
+
VERSION = "2.24.1".freeze
|
57
58
|
|
58
59
|
def self.version
|
59
60
|
VERSION
|
@@ -1,152 +1,251 @@
|
|
1
|
-
metadata
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
metadata :name => "choria_util",
|
2
|
+
:description => "Choria Utilities",
|
3
|
+
:author => "R.I.Pienaar <rip@devco.net>",
|
4
|
+
:license => "Apache-2.0",
|
5
|
+
:version => "0.19.0",
|
6
|
+
:url => "https://choria.io",
|
7
|
+
:timeout => 2
|
8
8
|
|
9
|
-
requires :mcollective => "2.9.0"
|
10
9
|
|
11
|
-
action "
|
10
|
+
action "info", :description => "Choria related information from the running Daemon and Middleware" do
|
11
|
+
display :failed
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
output :choria_version,
|
16
|
+
:description => "Choria version",
|
17
|
+
:display_as => "Choria Version"
|
18
|
+
|
19
|
+
output :client_flavour,
|
20
|
+
:description => "Middleware client gem flavour",
|
21
|
+
:display_as => "Middleware Client Flavour"
|
22
|
+
|
23
|
+
output :client_options,
|
24
|
+
:description => "Active Middleware client gem options",
|
25
|
+
:display_as => "Middleware Client Options"
|
26
|
+
|
27
|
+
output :client_stats,
|
28
|
+
:description => "Middleware client gem statistics",
|
29
|
+
:display_as => "Middleware Client Stats"
|
30
|
+
|
31
|
+
output :client_version,
|
32
|
+
:description => "Middleware client library version",
|
33
|
+
:display_as => "Middleware Client Library Version"
|
34
|
+
|
35
|
+
output :connected_server,
|
36
|
+
:description => "Connected middleware server",
|
37
|
+
:display_as => "Connected Broker"
|
38
|
+
|
39
|
+
output :connector,
|
40
|
+
:description => "Connector plugin",
|
41
|
+
:display_as => "Connector"
|
42
|
+
|
43
|
+
output :connector_tls,
|
44
|
+
:description => "If the connector is running with TLS security enabled",
|
45
|
+
:display_as => "Connector TLS"
|
46
|
+
|
47
|
+
output :facter_command,
|
48
|
+
:description => "Command used for Facter",
|
49
|
+
:display_as => "Facter"
|
50
|
+
|
51
|
+
output :facter_domain,
|
52
|
+
:description => "Facter domain",
|
53
|
+
:display_as => "Facter Domain"
|
54
|
+
|
55
|
+
output :middleware_servers,
|
56
|
+
:description => "Middleware Servers configured or discovered",
|
57
|
+
:display_as => "Middleware"
|
58
|
+
|
59
|
+
output :path,
|
60
|
+
:description => "Active OS PATH",
|
61
|
+
:display_as => "Path"
|
62
|
+
|
63
|
+
output :secure_protocol,
|
64
|
+
:description => "If the protocol is running with PKI security enabled",
|
65
|
+
:display_as => "Protocol Secure"
|
66
|
+
|
67
|
+
output :security,
|
68
|
+
:description => "Security Provider plugin",
|
69
|
+
:display_as => "Security Provider"
|
70
|
+
|
71
|
+
output :srv_domain,
|
72
|
+
:description => "Configured SRV domain",
|
73
|
+
:display_as => "SRV Domain"
|
74
|
+
|
75
|
+
output :using_srv,
|
76
|
+
:description => "Indicates if SRV records are considered",
|
77
|
+
:display_as => "SRV Used"
|
78
|
+
|
79
|
+
summarize do
|
80
|
+
aggregate summary(:choria_version)
|
81
|
+
aggregate summary(:client_version)
|
82
|
+
aggregate summary(:client_flavour)
|
83
|
+
aggregate summary(:connected_server)
|
84
|
+
aggregate summary(:srv_domain)
|
85
|
+
aggregate summary(:using_srv)
|
86
|
+
aggregate summary(:secure_protocol)
|
87
|
+
aggregate summary(:connector_tls)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
action "machine_state", :description => "Retrieves the current state of a specific Choria Autonomous Agent" do
|
92
|
+
display :ok
|
93
|
+
|
12
94
|
input :instance,
|
13
|
-
:prompt
|
95
|
+
:prompt => "Instance ID",
|
14
96
|
:description => "Machine Instance ID",
|
15
|
-
:type
|
16
|
-
:validation
|
17
|
-
:maxlength
|
18
|
-
:optional
|
97
|
+
:type => :string,
|
98
|
+
:validation => '^.+-.+-.+-.+-.+$',
|
99
|
+
:maxlength => 36,
|
100
|
+
:optional => true
|
19
101
|
|
20
|
-
input :version,
|
21
|
-
:prompt => "Version",
|
22
|
-
:description => "Machine Version",
|
23
|
-
:type => :string,
|
24
|
-
:validation => '^\d+\.\d+\.\d+$',
|
25
|
-
:maxlength => 20,
|
26
|
-
:optional => true
|
27
102
|
|
28
103
|
input :name,
|
29
|
-
:prompt
|
104
|
+
:prompt => "Name",
|
30
105
|
:description => "Machine Name",
|
31
|
-
:type
|
32
|
-
:validation
|
33
|
-
:maxlength
|
34
|
-
:optional
|
106
|
+
:type => :string,
|
107
|
+
:validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
|
108
|
+
:maxlength => 128,
|
109
|
+
:optional => true
|
110
|
+
|
35
111
|
|
36
112
|
input :path,
|
37
|
-
:prompt
|
113
|
+
:prompt => "Path",
|
38
114
|
:description => "Machine Path",
|
39
|
-
:type
|
40
|
-
:validation
|
41
|
-
:maxlength
|
42
|
-
:optional
|
115
|
+
:type => :string,
|
116
|
+
:validation => '.+',
|
117
|
+
:maxlength => 512,
|
118
|
+
:optional => true
|
43
119
|
|
44
|
-
input :transition,
|
45
|
-
:prompt => "Transition Name",
|
46
|
-
:description => "The transition event to send to the machine",
|
47
|
-
:type => :string,
|
48
|
-
:validation => '^[a-zA-Z][a-zA-Z0-9_-]+$',
|
49
|
-
:maxlength => 128,
|
50
|
-
:optional => false
|
51
120
|
|
52
|
-
|
53
|
-
|
54
|
-
|
121
|
+
|
122
|
+
|
123
|
+
output :available_transitions,
|
124
|
+
:description => "The list of available transitions this autonomous agent can make",
|
125
|
+
:type => "array",
|
126
|
+
:display_as => "Available Transitions"
|
127
|
+
|
128
|
+
output :current_state,
|
129
|
+
:description => "The Choria Scout specific state for Scout checks",
|
130
|
+
:display_as => "Scout State"
|
131
|
+
|
132
|
+
output :id,
|
133
|
+
:description => "The unique running ID of the autonomous agent",
|
134
|
+
:type => "string",
|
135
|
+
:display_as => "ID"
|
136
|
+
|
137
|
+
output :name,
|
138
|
+
:description => "The name of the autonomous agent",
|
139
|
+
:type => "string",
|
140
|
+
:display_as => "Name"
|
141
|
+
|
142
|
+
output :path,
|
143
|
+
:description => "The location on disk where the autonomous agent is stored",
|
144
|
+
:type => "string",
|
145
|
+
:display_as => "Path"
|
146
|
+
|
147
|
+
output :scout,
|
148
|
+
:description => "True when this autonomous agent represents a Choria Scout Check",
|
149
|
+
:type => "boolean",
|
150
|
+
:display_as => "Scout Check"
|
151
|
+
|
152
|
+
output :start_time,
|
153
|
+
:description => "The time the autonomous agent was started in unix seconds",
|
154
|
+
:type => "string",
|
155
|
+
:display_as => "Started"
|
156
|
+
|
157
|
+
output :state,
|
158
|
+
:description => "The current state the agent is in",
|
159
|
+
:type => "string",
|
160
|
+
:display_as => "State"
|
161
|
+
|
162
|
+
output :version,
|
163
|
+
:description => "The version of the autonomous agent",
|
164
|
+
:type => "string",
|
165
|
+
:display_as => "Version"
|
166
|
+
|
167
|
+
summarize do
|
168
|
+
aggregate summary(:state)
|
169
|
+
aggregate summary(:name)
|
170
|
+
aggregate summary(:version)
|
171
|
+
end
|
55
172
|
end
|
56
173
|
|
57
174
|
action "machine_states", :description => "States of the hosted Choria Autonomous Agents" do
|
58
175
|
display :always
|
59
176
|
|
60
|
-
|
61
|
-
:description => "List of running machine names",
|
62
|
-
:display_as => "Machine Names"
|
177
|
+
|
63
178
|
|
64
179
|
output :machine_ids,
|
65
180
|
:description => "List of running machine IDs",
|
66
|
-
:display_as
|
181
|
+
:display_as => "Machine IDs"
|
182
|
+
|
183
|
+
output :machine_names,
|
184
|
+
:description => "List of running machine names",
|
185
|
+
:display_as => "Machine Names"
|
67
186
|
|
68
187
|
output :states,
|
69
188
|
:description => "Hash map of machine statusses indexed by machine ID",
|
70
|
-
:display_as
|
189
|
+
:display_as => "Machine States"
|
71
190
|
|
72
191
|
summarize do
|
73
192
|
aggregate summary(:machine_names)
|
74
193
|
end
|
75
194
|
end
|
76
195
|
|
77
|
-
action "
|
78
|
-
|
79
|
-
:description => "Security Provider plugin",
|
80
|
-
:display_as => "Security Provider"
|
81
|
-
|
82
|
-
output :secure_protocol,
|
83
|
-
:description => "If the protocol is running with PKI security enabled",
|
84
|
-
:display_as => "Protocol Secure"
|
85
|
-
|
86
|
-
output :connector,
|
87
|
-
:description => "Connector plugin",
|
88
|
-
:display_as => "Connector"
|
196
|
+
action "machine_transition", :description => "Attempts to force a transition in a hosted Choria Autonomous Agent" do
|
197
|
+
display :failed
|
89
198
|
|
90
|
-
|
91
|
-
|
92
|
-
|
199
|
+
input :instance,
|
200
|
+
:prompt => "Instance ID",
|
201
|
+
:description => "Machine Instance ID",
|
202
|
+
:type => :string,
|
203
|
+
:validation => '^.+-.+-.+-.+-.+$',
|
204
|
+
:maxlength => 36,
|
205
|
+
:optional => true
|
93
206
|
|
94
|
-
output :path,
|
95
|
-
:description => "Active OS PATH",
|
96
|
-
:display_as => "Path"
|
97
207
|
|
98
|
-
|
99
|
-
|
100
|
-
|
208
|
+
input :name,
|
209
|
+
:prompt => "Name",
|
210
|
+
:description => "Machine Name",
|
211
|
+
:type => :string,
|
212
|
+
:validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
|
213
|
+
:maxlength => 128,
|
214
|
+
:optional => true
|
101
215
|
|
102
|
-
output :client_version,
|
103
|
-
:description => "Middleware client library version",
|
104
|
-
:display_as => "Middleware Client Library Version"
|
105
216
|
|
106
|
-
|
107
|
-
|
108
|
-
|
217
|
+
input :path,
|
218
|
+
:prompt => "Path",
|
219
|
+
:description => "Machine Path",
|
220
|
+
:type => :string,
|
221
|
+
:validation => '.+',
|
222
|
+
:maxlength => 512,
|
223
|
+
:optional => true
|
109
224
|
|
110
|
-
output :client_options,
|
111
|
-
:description => "Active Middleware client gem options",
|
112
|
-
:display_as => "Middleware Client Options"
|
113
225
|
|
114
|
-
|
115
|
-
|
116
|
-
|
226
|
+
input :transition,
|
227
|
+
:prompt => "Transition Name",
|
228
|
+
:description => "The transition event to send to the machine",
|
229
|
+
:type => :string,
|
230
|
+
:validation => '^[a-zA-Z][a-zA-Z0-9_-]+$',
|
231
|
+
:maxlength => 128,
|
232
|
+
:optional => false
|
117
233
|
|
118
|
-
output :client_stats,
|
119
|
-
:description => "Middleware client gem statistics",
|
120
|
-
:display_as => "Middleware Client Stats"
|
121
234
|
|
122
|
-
|
123
|
-
|
124
|
-
|
235
|
+
input :version,
|
236
|
+
:prompt => "Version",
|
237
|
+
:description => "Machine Version",
|
238
|
+
:type => :string,
|
239
|
+
:validation => '^\d+\.\d+\.\d+$',
|
240
|
+
:maxlength => 20,
|
241
|
+
:optional => true
|
125
242
|
|
126
|
-
output :facter_command,
|
127
|
-
:description => "Command used for Facter",
|
128
|
-
:display_as => "Facter"
|
129
243
|
|
130
|
-
output :srv_domain,
|
131
|
-
:description => "Configured SRV domain",
|
132
|
-
:display_as => "SRV Domain"
|
133
244
|
|
134
|
-
output :using_srv,
|
135
|
-
:description => "Indicates if SRV records are considered",
|
136
|
-
:display_as => "SRV Used"
|
137
245
|
|
138
|
-
output :
|
139
|
-
:description => "
|
140
|
-
:display_as
|
246
|
+
output :success,
|
247
|
+
:description => "Indicates if the transition was successfully accepted",
|
248
|
+
:display_as => "Accepted"
|
141
249
|
|
142
|
-
summarize do
|
143
|
-
aggregate summary(:choria_version)
|
144
|
-
aggregate summary(:client_version)
|
145
|
-
aggregate summary(:client_flavour)
|
146
|
-
aggregate summary(:connected_server)
|
147
|
-
aggregate summary(:srv_domain)
|
148
|
-
aggregate summary(:using_srv)
|
149
|
-
aggregate summary(:secure_protocol)
|
150
|
-
aggregate summary(:connector_tls)
|
151
|
-
end
|
152
250
|
end
|
251
|
+
|
@@ -149,6 +149,106 @@
|
|
149
149
|
}
|
150
150
|
]
|
151
151
|
},
|
152
|
+
{
|
153
|
+
"action": "machine_state",
|
154
|
+
"description": "Retrieves the current state of a specific Choria Autonomous Agent",
|
155
|
+
"display": "ok",
|
156
|
+
"input": {
|
157
|
+
"instance": {
|
158
|
+
"prompt": "Instance ID",
|
159
|
+
"description": "Machine Instance ID",
|
160
|
+
"type": "string",
|
161
|
+
"default": null,
|
162
|
+
"optional": true,
|
163
|
+
"validation": "^.+-.+-.+-.+-.+$",
|
164
|
+
"maxlength": 36
|
165
|
+
},
|
166
|
+
"name": {
|
167
|
+
"prompt": "Name",
|
168
|
+
"description": "Machine Name",
|
169
|
+
"type": "string",
|
170
|
+
"default": null,
|
171
|
+
"optional": true,
|
172
|
+
"validation": "^[a-zA-Z][a-zA-Z0-9_-]+",
|
173
|
+
"maxlength": 128
|
174
|
+
},
|
175
|
+
"path": {
|
176
|
+
"prompt": "Path",
|
177
|
+
"description": "Machine Path",
|
178
|
+
"type": "string",
|
179
|
+
"default": null,
|
180
|
+
"optional": true,
|
181
|
+
"validation": ".+",
|
182
|
+
"maxlength": 512
|
183
|
+
}
|
184
|
+
},
|
185
|
+
"aggregate": [
|
186
|
+
{
|
187
|
+
"function": "summary",
|
188
|
+
"args": [
|
189
|
+
"state"
|
190
|
+
]
|
191
|
+
},
|
192
|
+
{
|
193
|
+
"function": "summary",
|
194
|
+
"args": [
|
195
|
+
"name"
|
196
|
+
]
|
197
|
+
},
|
198
|
+
{
|
199
|
+
"function": "summary",
|
200
|
+
"args": [
|
201
|
+
"version"
|
202
|
+
]
|
203
|
+
}
|
204
|
+
],
|
205
|
+
"output": {
|
206
|
+
"name": {
|
207
|
+
"type": "string",
|
208
|
+
"description": "The name of the autonomous agent",
|
209
|
+
"display_as": "Name"
|
210
|
+
},
|
211
|
+
"version": {
|
212
|
+
"type": "string",
|
213
|
+
"description": "The version of the autonomous agent",
|
214
|
+
"display_as": "Version"
|
215
|
+
},
|
216
|
+
"state": {
|
217
|
+
"type": "string",
|
218
|
+
"description": "The current state the agent is in",
|
219
|
+
"display_as": "State"
|
220
|
+
},
|
221
|
+
"path": {
|
222
|
+
"type": "string",
|
223
|
+
"description": "The location on disk where the autonomous agent is stored",
|
224
|
+
"display_as": "Path"
|
225
|
+
},
|
226
|
+
"id": {
|
227
|
+
"type": "string",
|
228
|
+
"description": "The unique running ID of the autonomous agent",
|
229
|
+
"display_as": "ID"
|
230
|
+
},
|
231
|
+
"start_time": {
|
232
|
+
"type": "string",
|
233
|
+
"description": "The time the autonomous agent was started in unix seconds",
|
234
|
+
"display_as": "Started"
|
235
|
+
},
|
236
|
+
"available_transitions": {
|
237
|
+
"type": "array",
|
238
|
+
"description": "The list of available transitions this autonomous agent can make",
|
239
|
+
"display_as": "Available Transitions"
|
240
|
+
},
|
241
|
+
"scout": {
|
242
|
+
"type": "boolean",
|
243
|
+
"description": "True when this autonomous agent represents a Choria Scout Check",
|
244
|
+
"display_as": "Scout Check"
|
245
|
+
},
|
246
|
+
"current_state": {
|
247
|
+
"description": "The Choria Scout specific state for Scout checks",
|
248
|
+
"display_as": "Scout State"
|
249
|
+
}
|
250
|
+
}
|
251
|
+
},
|
152
252
|
{
|
153
253
|
"action": "machine_states",
|
154
254
|
"input": {
|
@@ -241,4 +341,4 @@
|
|
241
341
|
"description": "Attempts to force a transition in a hosted Choria Autonomous Agent"
|
242
342
|
}
|
243
343
|
]
|
244
|
-
}
|
344
|
+
}
|