choria-mcorpc-support 2.23.3 → 2.24.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/lib/mcollective.rb +3 -3
  3. data/lib/mcollective/agent/choria_provision.ddl +214 -0
  4. data/lib/mcollective/agent/choria_provision.json +272 -0
  5. data/lib/mcollective/agent/choria_util.ddl +226 -107
  6. data/lib/mcollective/agent/choria_util.json +125 -25
  7. data/lib/mcollective/agent/rpcutil.ddl +242 -183
  8. data/lib/mcollective/agent/rpcutil.json +53 -57
  9. data/lib/mcollective/agent/scout.ddl +1 -1
  10. data/lib/mcollective/agent/scout.json +108 -136
  11. data/lib/mcollective/application/find.rb +1 -1
  12. data/lib/mcollective/application/plugin.rb +8 -173
  13. data/lib/mcollective/client.rb +1 -1
  14. data/lib/mcollective/config.rb +145 -103
  15. data/lib/mcollective/ddl.rb +0 -1
  16. data/lib/mcollective/discovery.rb +11 -63
  17. data/lib/mcollective/discovery/broadcast.ddl +11 -0
  18. data/lib/mcollective/discovery/choria.ddl +6 -4
  19. data/lib/mcollective/discovery/delegate.ddl +13 -0
  20. data/lib/mcollective/discovery/delegate.rb +72 -0
  21. data/lib/mcollective/discovery/external.ddl +13 -0
  22. data/lib/mcollective/discovery/file.ddl +13 -0
  23. data/lib/mcollective/discovery/flatfile.ddl +7 -5
  24. data/lib/mcollective/discovery/inventory.ddl +13 -0
  25. data/lib/mcollective/discovery/mc.ddl +3 -3
  26. data/lib/mcollective/log.rb +1 -2
  27. data/lib/mcollective/optionparser.rb +1 -1
  28. data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
  29. data/lib/mcollective/rpc/client.rb +4 -2
  30. data/lib/mcollective/util.rb +2 -4
  31. data/lib/mcollective/util/choria.rb +14 -8
  32. data/lib/mcollective/util/tasks_support.rb +15 -2
  33. metadata +11 -29
  34. data/lib/mcollective/data.rb +0 -96
  35. data/lib/mcollective/data/agent_data.ddl +0 -22
  36. data/lib/mcollective/data/agent_data.rb +0 -17
  37. data/lib/mcollective/data/base.rb +0 -68
  38. data/lib/mcollective/data/bolt_task_data.ddl +0 -90
  39. data/lib/mcollective/data/bolt_task_data.rb +0 -32
  40. data/lib/mcollective/data/collective_data.ddl +0 -20
  41. data/lib/mcollective/data/collective_data.rb +0 -9
  42. data/lib/mcollective/data/fact_data.ddl +0 -28
  43. data/lib/mcollective/data/fact_data.rb +0 -55
  44. data/lib/mcollective/data/fstat_data.ddl +0 -89
  45. data/lib/mcollective/data/fstat_data.rb +0 -54
  46. data/lib/mcollective/data/result.rb +0 -50
  47. data/lib/mcollective/ddl/dataddl.rb +0 -56
  48. data/lib/mcollective/discovery/choria.rb +0 -223
  49. data/lib/mcollective/discovery/flatfile.rb +0 -47
  50. data/lib/mcollective/discovery/stdin.ddl +0 -11
  51. data/lib/mcollective/discovery/stdin.rb +0 -67
  52. data/lib/mcollective/generators.rb +0 -7
  53. data/lib/mcollective/generators/agent_generator.rb +0 -50
  54. data/lib/mcollective/generators/base.rb +0 -45
  55. data/lib/mcollective/generators/data_generator.rb +0 -50
  56. data/lib/mcollective/generators/templates/action_snippet.erb +0 -13
  57. data/lib/mcollective/generators/templates/data_input_snippet.erb +0 -7
  58. data/lib/mcollective/generators/templates/ddl.erb +0 -8
  59. data/lib/mcollective/generators/templates/plugin.erb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 73c63dbc1dacba7b90acdba3141cfedd3731da11
4
- data.tar.gz: 42cfc48d721f69b6ec805e71624a8b8cff0fc141
2
+ SHA256:
3
+ metadata.gz: 707a3ec934abb7197a7eaaf95377c01149aa481f8320ffcfd7d07891094e6373
4
+ data.tar.gz: 6bdc5f52c104d5a10a3f06e5de1194c0633f20a4458d2bbf5b10064b0f153808
5
5
  SHA512:
6
- metadata.gz: 2f5370f390815f5881473b6c0e482db4f821f88ecb2616e33af9aa29a91e1561f1306b24945b1df2fe9d7ad05f8f770908298cb9279ae6dedb90658906654454
7
- data.tar.gz: 250ca8bb59baccda7324a4f21f7db4f938c6fc06cdfe968f46263e0fe11ba55214d237dda44a5db0243500007a8ffec856e336880334d5e0df3d2e53903499a9
6
+ metadata.gz: 9bc9ea26a564281863c042abc4e1e652279c62833240d7281a17cdc04a9485efd54b932d578c29415bc829432a7848acece6ef6f82e8b935e65e26e5e75fc2b0
7
+ data.tar.gz: 8b0b97bc19f45c868b3052c20256cff43960f4b5804ec1fda4cff2f7e65fa427dd34495727ed5adaa01c6b8bc393ef823cec3d5edd14b450938f8c73ec142f32
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,15 +35,14 @@ 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"
43
44
  require "mcollective/message"
44
45
  require "mcollective/optionparser"
45
- require "mcollective/generators"
46
46
  require "mcollective/pluginmanager"
47
47
  require "mcollective/pluginpackager"
48
48
  require "mcollective/rpc"
@@ -53,7 +53,7 @@ module MCollective
53
53
  require "mcollective/util"
54
54
  require "mcollective/validator"
55
55
 
56
- VERSION = "2.23.3".freeze
56
+ VERSION = "2.24.1".freeze
57
57
 
58
58
  def self.version
59
59
  VERSION
@@ -0,0 +1,214 @@
1
+ metadata :name => "choria_provision",
2
+ :description => "Choria Provisioner",
3
+ :author => "R.I.Pienaar <rip@devco.net>",
4
+ :license => "Apache-2.0",
5
+ :version => "0.22.0",
6
+ :url => "https://choria.io",
7
+ :timeout => 20
8
+
9
+ action "gencsr", :description => "Request a CSR from the Choria Server" do
10
+ display :always
11
+
12
+ input :token,
13
+ :prompt => "Token",
14
+ :description => "Authentication token to pass to the server",
15
+ :type => :string,
16
+ :validation => ".",
17
+ :optional => true,
18
+ :default => "",
19
+ :maxlength => 128
20
+
21
+ input :cn,
22
+ :prompt => "Common Name",
23
+ :description => "The certificate Common Name to place in the CSR",
24
+ :type => :string,
25
+ :validation => "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$",
26
+ :optional => true,
27
+ :maxlength => 80
28
+
29
+ input :C,
30
+ :prompt => "Country",
31
+ :description => "Country Code",
32
+ :type => :string,
33
+ :validation => "^[A-Z]{2}$",
34
+ :optional => true,
35
+ :maxlength => 2
36
+
37
+ input :L,
38
+ :prompt => "Locality",
39
+ :description => "Locality or municipality (such as city or town name)",
40
+ :type => :string,
41
+ :validation => "^[\\w\\s-]+$",
42
+ :optional => true,
43
+ :maxlength => 50
44
+
45
+ input :O,
46
+ :prompt => "Organization",
47
+ :description => "Organization",
48
+ :type => :string,
49
+ :validation => "^[\\w\\s-]+$",
50
+ :optional => true,
51
+ :maxlength => 50
52
+
53
+ input :OU,
54
+ :prompt => "Organizational Unit",
55
+ :description => "Organizational Unit",
56
+ :type => :string,
57
+ :validation => "^[\\w\\s-]+$",
58
+ :optional => true,
59
+ :maxlength => 50
60
+
61
+ input :ST,
62
+ :prompt => "State",
63
+ :description => "State",
64
+ :type => :string,
65
+ :validation => "^[\\w\\s-]+$",
66
+ :optional => true,
67
+ :maxlength => 50
68
+
69
+ output :csr,
70
+ :description => "PEM text block for the CSR",
71
+ :display_as => "CSR"
72
+
73
+ output :ssldir,
74
+ :description => "SSL directory as determined by the server",
75
+ :display_as => "SSL Dir"
76
+ end
77
+
78
+ action "configure", :description => "Configure the Choria Server" do
79
+ input :token,
80
+ :prompt => "Token",
81
+ :description => "Authentication token to pass to the server",
82
+ :type => :string,
83
+ :validation => ".",
84
+ :optional => true,
85
+ :default => "",
86
+ :maxlength => 128
87
+
88
+ input :config,
89
+ :prompt => "Configuration",
90
+ :description => "The configuration to apply to this node",
91
+ :type => :string,
92
+ :validation => "^{.+}$",
93
+ :optional => false,
94
+ :maxlength => 2048
95
+
96
+ input :certificate,
97
+ :prompt => "Certificate",
98
+ :description => "PEM text block for the certificate",
99
+ :type => :string,
100
+ :validation => "^-----BEGIN CERTIFICATE-----",
101
+ :optional => true,
102
+ :maxlength => 10240
103
+
104
+ input :ca,
105
+ :prompt => "CA Bundle",
106
+ :description => "PEM text block for the CA",
107
+ :type => :string,
108
+ :validation => "^-----BEGIN CERTIFICATE-----",
109
+ :optional => true,
110
+ :maxlength => 10240
111
+
112
+ input :ssldir,
113
+ :prompt => "SSL Dir",
114
+ :description => "Directory for storing the certificate in",
115
+ :type => :string,
116
+ :validation => ".",
117
+ :optional => true,
118
+ :maxlength => 500
119
+
120
+ output :message,
121
+ :description => "Status message from the Provisioner",
122
+ :display_as => "Message"
123
+ end
124
+
125
+ action "restart", :description => "Restart the Choria Server" do
126
+ input :token,
127
+ :prompt => "Token",
128
+ :description => "Authentication token to pass to the server",
129
+ :type => :string,
130
+ :validation => ".",
131
+ :optional => true,
132
+ :default => "",
133
+ :maxlength => 128
134
+
135
+ input :splay,
136
+ :prompt => "Splay time",
137
+ :description => "The configuration to apply to this node",
138
+ :type => :number,
139
+ :optional => true
140
+
141
+ output :message,
142
+ :description => "Status message from the Provisioner",
143
+ :display_as => "Message"
144
+ end
145
+
146
+ action "reprovision", :description => "Reenable provision mode in a running Choria Server" do
147
+ display :always
148
+
149
+ input :token,
150
+ :prompt => "Token",
151
+ :description => "Authentication token to pass to the server",
152
+ :type => :string,
153
+ :validation => ".",
154
+ :optional => true,
155
+ :default => "",
156
+ :maxlength => 128
157
+
158
+ output :message,
159
+ :description => "Status message from the Provisioner",
160
+ :display_as => "Message"
161
+ end
162
+
163
+ action "jwt", :description => "Retrieves the Provisioning JWT token if set" do
164
+ display :always
165
+
166
+ input :token,
167
+ :prompt => "Token",
168
+ :description => "Authentication token to pass to the server",
169
+ :type => :string,
170
+ :validation => ".",
171
+ :optional => true,
172
+ :default => "",
173
+ :maxlength => 128
174
+
175
+ output :jwt,
176
+ :description => "The contents of the JWT token",
177
+ :display_as => "JWT Token",
178
+ :default => ""
179
+ end
180
+
181
+ action "release_update", :description => "Performs an in-place binary update and restarts Choria" do
182
+ display :always
183
+
184
+ input :token,
185
+ :prompt => "Token",
186
+ :description => "Authentication token to pass to the server",
187
+ :type => :string,
188
+ :validation => ".",
189
+ :optional => true,
190
+ :default => "",
191
+ :maxlength => 128
192
+
193
+ input :repository,
194
+ :prompt => "Repository URL",
195
+ :description => "HTTP(S) server hosting the update repository",
196
+ :type => :string,
197
+ :validation => "^http(s*):\/\/",
198
+ :optional => false,
199
+ :default => "",
200
+ :maxlength => "512"
201
+
202
+ input :version,
203
+ :prompt => "Version to update to",
204
+ :description => "Package version to update to",
205
+ :type => :string,
206
+ :validation => ".+",
207
+ :optional => false,
208
+ :default => "",
209
+ :maxlength => "32"
210
+
211
+ output :message,
212
+ :description => "Status message from the Provisioner",
213
+ :display_as => "Message"
214
+ end
@@ -0,0 +1,272 @@
1
+ {
2
+ "$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json",
3
+ "metadata": {
4
+ "name": "choria_provision",
5
+ "description": "Choria Provisioner",
6
+ "author": "R.I.Pienaar <rip@devco.net>",
7
+ "license": "Apache-2.0",
8
+ "version": "0.22.0",
9
+ "url": "https://choria.io",
10
+ "timeout": 20
11
+ },
12
+ "actions": [
13
+ {
14
+ "action": "configure",
15
+ "input": {
16
+ "token": {
17
+ "prompt": "Token",
18
+ "description": "Authentication token to pass to the server",
19
+ "type": "string",
20
+ "default": "",
21
+ "optional": true,
22
+ "validation": ".",
23
+ "maxlength": 128
24
+ },
25
+ "config": {
26
+ "prompt": "Configuration",
27
+ "description": "The configuration to apply to this node",
28
+ "type": "string",
29
+ "default": null,
30
+ "optional": false,
31
+ "validation": "^{.+}$",
32
+ "maxlength": 2048
33
+ },
34
+ "certificate": {
35
+ "prompt": "Certificate",
36
+ "description": "PEM text block for the certificate",
37
+ "type": "string",
38
+ "default": null,
39
+ "optional": true,
40
+ "validation": "^-----BEGIN CERTIFICATE-----",
41
+ "maxlength": 10240
42
+ },
43
+ "ca": {
44
+ "prompt": "CA Bundle",
45
+ "description": "PEM text block for the CA",
46
+ "type": "string",
47
+ "default": null,
48
+ "optional": true,
49
+ "validation": "^-----BEGIN CERTIFICATE-----",
50
+ "maxlength": 10240
51
+ },
52
+ "ssldir": {
53
+ "prompt": "SSL Dir",
54
+ "description": "Directory for storing the certificate in",
55
+ "type": "string",
56
+ "default": null,
57
+ "optional": true,
58
+ "validation": ".",
59
+ "maxlength": 500
60
+ }
61
+ },
62
+ "output": {
63
+ "message": {
64
+ "description": "Status message from the Provisioner",
65
+ "display_as": "Message",
66
+ "default": null
67
+ }
68
+ },
69
+ "display": "failed",
70
+ "description": "Configure the Choria Server"
71
+ },
72
+ {
73
+ "action": "gencsr",
74
+ "input": {
75
+ "token": {
76
+ "prompt": "Token",
77
+ "description": "Authentication token to pass to the server",
78
+ "type": "string",
79
+ "default": "",
80
+ "optional": true,
81
+ "validation": ".",
82
+ "maxlength": 128
83
+ },
84
+ "cn": {
85
+ "prompt": "Common Name",
86
+ "description": "The certificate Common Name to place in the CSR",
87
+ "type": "string",
88
+ "default": null,
89
+ "optional": true,
90
+ "validation": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]).)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$",
91
+ "maxlength": 80
92
+ },
93
+ "C": {
94
+ "prompt": "Country",
95
+ "description": "Country Code",
96
+ "type": "string",
97
+ "default": null,
98
+ "optional": true,
99
+ "validation": "^[A-Z]{2}$",
100
+ "maxlength": 2
101
+ },
102
+ "L": {
103
+ "prompt": "Locality",
104
+ "description": "Locality or municipality (such as city or town name)",
105
+ "type": "string",
106
+ "default": null,
107
+ "optional": true,
108
+ "validation": "^[\\w\\s-]+$",
109
+ "maxlength": 50
110
+ },
111
+ "O": {
112
+ "prompt": "Organization",
113
+ "description": "Organization",
114
+ "type": "string",
115
+ "default": null,
116
+ "optional": true,
117
+ "validation": "^[\\w\\s-]+$",
118
+ "maxlength": 50
119
+ },
120
+ "OU": {
121
+ "prompt": "Organizational Unit",
122
+ "description": "Organizational Unit",
123
+ "type": "string",
124
+ "default": null,
125
+ "optional": true,
126
+ "validation": "^[\\w\\s-]+$",
127
+ "maxlength": 50
128
+ },
129
+ "ST": {
130
+ "prompt": "State",
131
+ "description": "State",
132
+ "type": "string",
133
+ "default": null,
134
+ "optional": true,
135
+ "validation": "^[\\w\\s-]+$",
136
+ "maxlength": 50
137
+ }
138
+ },
139
+ "output": {
140
+ "csr": {
141
+ "description": "PEM text block for the CSR",
142
+ "display_as": "CSR",
143
+ "default": null
144
+ },
145
+ "ssldir": {
146
+ "description": "SSL directory as determined by the server",
147
+ "display_as": "SSL Dir",
148
+ "default": null
149
+ }
150
+ },
151
+ "display": "always",
152
+ "description": "Request a CSR from the Choria Server"
153
+ },
154
+ {
155
+ "action": "release_update",
156
+ "input": {
157
+ "token": {
158
+ "prompt": "Token",
159
+ "description": "Authentication token to pass to the server",
160
+ "type": "string",
161
+ "default": "",
162
+ "optional": true,
163
+ "validation": ".",
164
+ "maxlength": 128
165
+ },
166
+ "repository": {
167
+ "prompt": "Repository URL",
168
+ "description": "HTTP(S) server hosting the update repository",
169
+ "type": "string",
170
+ "default": "",
171
+ "optional": false,
172
+ "validation": "^http(s*)://",
173
+ "maxlength": 512
174
+ },
175
+ "version": {
176
+ "prompt": "Version to update to",
177
+ "description": "Package version to update to",
178
+ "type": "string",
179
+ "default": "",
180
+ "optional": false,
181
+ "validation": ".+",
182
+ "maxlength": 32
183
+ }
184
+ },
185
+ "output": {
186
+ "message": {
187
+ "description": "Status message from the Provisioner",
188
+ "display_as": "Message",
189
+ "default": null
190
+ }
191
+ },
192
+ "display": "always",
193
+ "description": "Performs an in-place binary update and restarts Choria"
194
+ },
195
+ {
196
+ "action": "jwt",
197
+ "input": {
198
+ "token": {
199
+ "prompt": "Token",
200
+ "description": "Authentication token to pass to the server",
201
+ "type": "string",
202
+ "default": "",
203
+ "optional": true,
204
+ "validation": ".",
205
+ "maxlength": 128
206
+ }
207
+ },
208
+ "output": {
209
+ "jwt": {
210
+ "description": "The contents of the JWT token",
211
+ "display_as": "JWT Token",
212
+ "default": ""
213
+ }
214
+ },
215
+ "display": "always",
216
+ "description": "Reenable provision mode in a running Choria Server"
217
+ },
218
+ {
219
+ "action": "reprovision",
220
+ "input": {
221
+ "token": {
222
+ "prompt": "Token",
223
+ "description": "Authentication token to pass to the server",
224
+ "type": "string",
225
+ "default": "",
226
+ "optional": true,
227
+ "validation": ".",
228
+ "maxlength": 128
229
+ }
230
+ },
231
+ "output": {
232
+ "message": {
233
+ "description": "Status message from the Provisioner",
234
+ "display_as": "Message",
235
+ "default": null
236
+ }
237
+ },
238
+ "display": "always",
239
+ "description": "Reenable provision mode in a running Choria Server"
240
+ },
241
+ {
242
+ "action": "restart",
243
+ "input": {
244
+ "token": {
245
+ "prompt": "Token",
246
+ "description": "Authentication token to pass to the server",
247
+ "type": "string",
248
+ "default": "",
249
+ "optional": true,
250
+ "validation": ".",
251
+ "maxlength": 128
252
+ },
253
+ "splay": {
254
+ "prompt": "Splay time",
255
+ "description": "The configuration to apply to this node",
256
+ "type": "number",
257
+ "default": null,
258
+ "optional": true
259
+ }
260
+ },
261
+ "output": {
262
+ "message": {
263
+ "description": "Status message from the Provisioner",
264
+ "display_as": "Message",
265
+ "default": null
266
+ }
267
+ },
268
+ "display": "failed",
269
+ "description": "Restart the Choria Server"
270
+ }
271
+ ]
272
+ }