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.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/lib/mcollective.rb +3 -2
  3. data/lib/mcollective/agent/choria_util.ddl +206 -107
  4. data/lib/mcollective/agent/choria_util.json +101 -1
  5. data/lib/mcollective/agent/rpcutil.json +2 -3
  6. data/lib/mcollective/agent/scout.json +107 -135
  7. data/lib/mcollective/application/facts.rb +2 -67
  8. data/lib/mcollective/application/find.rb +1 -1
  9. data/lib/mcollective/application/plugin.rb +2 -15
  10. data/lib/mcollective/client.rb +1 -1
  11. data/lib/mcollective/config.rb +135 -103
  12. data/lib/mcollective/ddl.rb +0 -1
  13. data/lib/mcollective/discovery.rb +11 -63
  14. data/lib/mcollective/discovery/broadcast.ddl +11 -0
  15. data/lib/mcollective/discovery/choria.ddl +6 -4
  16. data/lib/mcollective/discovery/delegate.ddl +13 -0
  17. data/lib/mcollective/discovery/delegate.rb +73 -0
  18. data/lib/mcollective/discovery/external.ddl +13 -0
  19. data/lib/mcollective/discovery/file.ddl +13 -0
  20. data/lib/mcollective/discovery/flatfile.ddl +7 -5
  21. data/lib/mcollective/discovery/inventory.ddl +13 -0
  22. data/lib/mcollective/discovery/mc.ddl +3 -3
  23. data/lib/mcollective/generators.rb +0 -1
  24. data/lib/mcollective/optionparser.rb +1 -1
  25. data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
  26. data/lib/mcollective/rpc/client.rb +4 -2
  27. data/lib/mcollective/util.rb +25 -35
  28. data/lib/mcollective/util/tasks_support.rb +15 -2
  29. metadata +9 -23
  30. data/lib/mcollective/data.rb +0 -96
  31. data/lib/mcollective/data/agent_data.ddl +0 -22
  32. data/lib/mcollective/data/agent_data.rb +0 -17
  33. data/lib/mcollective/data/base.rb +0 -68
  34. data/lib/mcollective/data/bolt_task_data.ddl +0 -90
  35. data/lib/mcollective/data/bolt_task_data.rb +0 -32
  36. data/lib/mcollective/data/collective_data.ddl +0 -20
  37. data/lib/mcollective/data/collective_data.rb +0 -9
  38. data/lib/mcollective/data/fact_data.ddl +0 -28
  39. data/lib/mcollective/data/fact_data.rb +0 -55
  40. data/lib/mcollective/data/fstat_data.ddl +0 -89
  41. data/lib/mcollective/data/fstat_data.rb +0 -54
  42. data/lib/mcollective/data/result.rb +0 -50
  43. data/lib/mcollective/ddl/dataddl.rb +0 -56
  44. data/lib/mcollective/discovery/choria.rb +0 -223
  45. data/lib/mcollective/discovery/flatfile.rb +0 -47
  46. data/lib/mcollective/discovery/stdin.ddl +0 -11
  47. data/lib/mcollective/discovery/stdin.rb +0 -67
  48. data/lib/mcollective/generators/data_generator.rb +0 -50
  49. data/lib/mcollective/generators/templates/data_input_snippet.erb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 88cacd67cd1dd9b6289e5b896b920d3467e3a220
4
- data.tar.gz: a7cf2dccf0ae9133abd81866296784fb6791b0e0
2
+ SHA256:
3
+ metadata.gz: 8c9b96995926bcb736c4d7340f1e35c82673db5ce74de15443a79fba36873a2a
4
+ data.tar.gz: f00bd913097f164271403440750015b73041d61b54712dadc728f0b56859d9c9
5
5
  SHA512:
6
- metadata.gz: 368859ec015b8605af21238d7c6d93aa4472c728948d61dcf07095a7728509f4fcdafb2d5867aef0b941a09572ce7ad43ec4ce54a91cde8e6de26fc48a888b9c
7
- data.tar.gz: d1ce8dbd24f8f1a24163e4e5c69d9514d98372885bf14b6f3efd59b824c842d5ed2efee50df7551eec577e0dd15cfc7da36f66f732b6fd35ab74ca7f30f8d9cc
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.23.1".freeze
57
+ VERSION = "2.24.1".freeze
57
58
 
58
59
  def self.version
59
60
  VERSION
@@ -1,152 +1,251 @@
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
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 "machine_transition", :description => "Attempts to force a transition in a hosted Choria Autonomous Agent" do
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 => "Instance ID",
95
+ :prompt => "Instance ID",
14
96
  :description => "Machine Instance ID",
15
- :type => :string,
16
- :validation => '^.+-.+-.+-.+-.+$',
17
- :maxlength => 36,
18
- :optional => true
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 => "Name",
104
+ :prompt => "Name",
30
105
  :description => "Machine Name",
31
- :type => :string,
32
- :validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
33
- :maxlength => 128,
34
- :optional => true
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 => "Path",
113
+ :prompt => "Path",
38
114
  :description => "Machine Path",
39
- :type => :string,
40
- :validation => '.+',
41
- :maxlength => 512,
42
- :optional => true
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
- output :success,
53
- :description => "Indicates if the transition was successfully accepted",
54
- :display_as => "Accepted"
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
- output :machine_names,
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 => "Machine IDs"
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 => "Machine States"
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 "info", :description => "Choria related information from the running Daemon and Middleware" do
78
- output :security,
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
- output :connector_tls,
91
- :description => "If the connector is running with TLS security enabled",
92
- :display_as => "Connector TLS"
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
- output :choria_version,
99
- :description => "Choria version",
100
- :display_as => "Choria Version"
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
- output :client_flavour,
107
- :description => "Middleware client gem flavour",
108
- :display_as => "Middleware Client Flavour"
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
- output :connected_server,
115
- :description => "Connected middleware server",
116
- :display_as => "Connected Broker"
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
- output :facter_domain,
123
- :description => "Facter domain",
124
- :display_as => "Facter Domain"
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 :middleware_servers,
139
- :description => "Middleware Servers configured or discovered",
140
- :display_as => "Middleware"
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
+ }