foreman_acd 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -86
  3. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +13 -11
  4. data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +4 -3
  5. data/app/controllers/foreman_acd/api/v2/app_definitions_controller.rb +1 -0
  6. data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +9 -1
  7. data/app/controllers/foreman_acd/app_definitions_controller.rb +14 -9
  8. data/app/controllers/foreman_acd/app_instances_controller.rb +97 -25
  9. data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
  10. data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
  11. data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
  12. data/app/controllers/foreman_acd/remote_execution_controller.rb +3 -6
  13. data/app/controllers/ui_acd_controller.rb +9 -0
  14. data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +42 -0
  15. data/app/lib/actions/foreman_acd/run_configurator.rb +41 -0
  16. data/app/models/concerns/foreman_acd/host_managed_extensions.rb +51 -0
  17. data/app/models/foreman_acd/acd_provider.rb +3 -0
  18. data/app/models/foreman_acd/ansible_playbook.rb +30 -13
  19. data/app/models/foreman_acd/app_definition.rb +24 -1
  20. data/app/models/foreman_acd/app_instance.rb +40 -5
  21. data/app/models/foreman_acd/foreman_host.rb +23 -0
  22. data/app/models/foreman_acd/taxonomy_extensions.rb +17 -0
  23. data/app/services/foreman_acd/app_configurator.rb +7 -10
  24. data/app/services/foreman_acd/app_deployer.rb +59 -47
  25. data/app/services/foreman_acd/inventory_creator.rb +12 -25
  26. data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +11 -2
  27. data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +9 -1
  28. data/app/views/foreman_acd/ansible_playbooks/index.html.erb +3 -3
  29. data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +2 -0
  30. data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +2 -0
  31. data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +6 -0
  32. data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +2 -0
  33. data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +2 -0
  34. data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +6 -0
  35. data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +3 -1
  36. data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +2 -0
  37. data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +2 -0
  38. data/app/views/foreman_acd/app_definitions/_form.html.erb +8 -0
  39. data/app/views/foreman_acd/app_definitions/edit.html.erb +10 -5
  40. data/app/views/foreman_acd/app_definitions/index.html.erb +4 -4
  41. data/app/views/foreman_acd/app_instances/_form.html.erb +3 -3
  42. data/app/views/foreman_acd/app_instances/edit.html.erb +10 -0
  43. data/app/views/foreman_acd/app_instances/index.html.erb +87 -14
  44. data/app/views/foreman_acd/app_instances/report.html.erb +5 -2
  45. data/app/views/templates/job/run_acd_ansible_playbook.erb +14 -1
  46. data/app/views/ui_acd/app_definition.json.rabl +1 -1
  47. data/config/routes.rb +1 -2
  48. data/db/migrate/20200917120220_add_ansible_playbook_id.rb +1 -1
  49. data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +3 -0
  50. data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +3 -0
  51. data/db/migrate/20210112111548_add_organization_to_app_instance.rb +22 -0
  52. data/db/migrate/20210112113853_add_location_to_app_instance.rb +8 -0
  53. data/db/migrate/20210202141658_create_foreman_hosts.rb +24 -0
  54. data/db/migrate/20210204111306_remove_hosts_from_app_instances.rb +8 -0
  55. data/db/migrate/20210209091014_rename_acd_tables.rb +16 -0
  56. data/db/migrate/20210216083522_add_last_progress_report.rb +8 -0
  57. data/db/migrate/20210216091529_add_last_deploy_task.rb +8 -0
  58. data/db/seeds.d/62_acd_proxy_feature.rb +1 -3
  59. data/db/seeds.d/75-job_templates.rb +6 -1
  60. data/lib/foreman_acd/engine.rb +14 -3
  61. data/lib/foreman_acd/plugin.rb +49 -28
  62. data/lib/foreman_acd/version.rb +1 -1
  63. data/locale/en/foreman_acd.edit.po +326 -0
  64. data/locale/en/foreman_acd.po +232 -2
  65. data/{app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb → locale/en/foreman_acd.po.time_stamp} +0 -0
  66. data/locale/foreman_acd.pot +343 -8
  67. data/test/controllers/ansible_playbooks_controller_test.rb +27 -0
  68. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +31 -18
  69. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +8 -0
  70. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +1 -0
  71. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +26 -0
  72. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +1 -0
  73. data/webpack/components/ApplicationDefinition/index.js +2 -0
  74. data/webpack/components/ApplicationInstance/ApplicationInstance.js +67 -30
  75. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +8 -0
  76. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +1 -0
  77. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +16 -2
  78. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +1 -0
  79. data/webpack/components/ApplicationInstance/components/Service.js +1 -1
  80. data/webpack/components/ApplicationInstance/index.js +2 -0
  81. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +53 -60
  82. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +17 -0
  83. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +7 -51
  84. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +2 -4
  85. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +4 -18
  86. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +0 -1
  87. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +1 -1
  88. data/webpack/components/ApplicationInstanceReport/index.js +0 -2
  89. data/webpack/components/ParameterSelection/ParameterSelection.js +10 -0
  90. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +8 -7
  91. data/webpack/components/common/DeleteTableEntry.js +3 -2
  92. data/webpack/components/common/EditTableEntry.js +2 -1
  93. data/webpack/components/common/LockTableEntry.js +2 -1
  94. metadata +48 -6
  95. data/app/views/foreman_acd/app_instances/deploy.html.erb +0 -19
@@ -1,19 +1,354 @@
1
- # foreman_acd
2
- #
3
- # This file is distributed under the same license as foreman_acd.
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the foreman_acd package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4
5
  #
5
6
  #, fuzzy
6
7
  msgid ""
7
8
  msgstr ""
8
- "Project-Id-Version: version 0.0.1\n"
9
+ "Project-Id-Version: foreman_acd 1.0.0\n"
9
10
  "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2014-08-20 08:46+0100\n"
11
- "PO-Revision-Date: 2014-08-20 08:46+0100\n"
12
- "Last-Translator: Foreman Team <foreman-dev@googlegroups.com>\n"
13
- "Language-Team: Foreman Team <foreman-dev@googlegroups.com>\n"
11
+ "POT-Creation-Date: 2021-02-05 21:21+0000\n"
12
+ "PO-Revision-Date: 2021-02-05 21:21+0000\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
15
  "Language: \n"
15
16
  "MIME-Version: 1.0\n"
16
17
  "Content-Type: text/plain; charset=UTF-8\n"
17
18
  "Content-Transfer-Encoding: 8bit\n"
18
19
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
19
20
 
21
+ #: ../app/controllers/foreman_acd/ansible_playbooks_controller.rb:22
22
+ msgid ""
23
+ "Successfully created %s. You need to press the \"Import groups\" button\n"
24
+ " before this ansible playbook can be"
25
+ " used in App Definitions!"
26
+ msgstr ""
27
+
28
+ #: ../app/controllers/foreman_acd/ansible_playbooks_controller.rb:116
29
+ msgid "Successfully loaded ansible group variables from %s"
30
+ msgstr ""
31
+
32
+ #: ../app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb:15
33
+ msgid "Show ansible playbook"
34
+ msgstr ""
35
+
36
+ #: ../app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb:19
37
+ msgid "List ansible playbooks"
38
+ msgstr ""
39
+
40
+ #: ../app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb:35
41
+ msgid "Create a ansible playbook"
42
+ msgstr ""
43
+
44
+ #: ../app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb:42
45
+ msgid "Deletes ansible playbook"
46
+ msgstr ""
47
+
48
+ #: ../app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb:48
49
+ msgid "Grab ansible playbook"
50
+ msgstr ""
51
+
52
+ #: ../app/controllers/foreman_acd/api/v2/app_definitions_controller.rb:12
53
+ msgid "Show application definition"
54
+ msgstr ""
55
+
56
+ #: ../app/controllers/foreman_acd/api/v2/app_definitions_controller.rb:16
57
+ msgid "List application definitions"
58
+ msgstr ""
59
+
60
+ #: ../app/controllers/foreman_acd/api/v2/app_definitions_controller.rb:32
61
+ msgid "Create a application definition"
62
+ msgstr ""
63
+
64
+ #: ../app/controllers/foreman_acd/api/v2/app_definitions_controller.rb:39
65
+ msgid "Deletes application definition"
66
+ msgstr ""
67
+
68
+ #: ../app/controllers/foreman_acd/api/v2/app_instances_controller.rb:12
69
+ msgid "Show application instance"
70
+ msgstr ""
71
+
72
+ #: ../app/controllers/foreman_acd/api/v2/app_instances_controller.rb:18
73
+ msgid "List application instances"
74
+ msgstr ""
75
+
76
+ #: ../app/controllers/foreman_acd/api/v2/app_instances_controller.rb:39
77
+ msgid "Create a application instance"
78
+ msgstr ""
79
+
80
+ #: ../app/controllers/foreman_acd/api/v2/app_instances_controller.rb:46
81
+ msgid "Deletes application instance"
82
+ msgstr ""
83
+
84
+ #: ../app/models/foreman_acd/ansible_playbook.rb:37
85
+ msgid "Ansible playbook"
86
+ msgstr ""
87
+
88
+ #: ../app/models/foreman_acd/app_definition.rb:37
89
+ msgid "App Definition"
90
+ msgstr ""
91
+
92
+ #: ../app/models/foreman_acd/app_instance.rb:19
93
+ msgid "App Instance"
94
+ msgstr ""
95
+
96
+ #: ../app/views/foreman_acd/ansible_playbooks/_form.html.erb:5
97
+ msgid "Ansible playbooks"
98
+ msgstr ""
99
+
100
+ #: ../app/views/foreman_acd/ansible_playbooks/_form.html.erb:7
101
+ #: ../app/views/foreman_acd/app_definitions/_form.html.erb:34
102
+ msgid "Locations"
103
+ msgstr ""
104
+
105
+ #: ../app/views/foreman_acd/ansible_playbooks/_form.html.erb:10
106
+ #: ../app/views/foreman_acd/app_definitions/_form.html.erb:37
107
+ msgid "Organizations"
108
+ msgstr ""
109
+
110
+ #: ../app/views/foreman_acd/ansible_playbooks/edit.html.erb:4
111
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:1
112
+ msgid "Ansible Playbooks"
113
+ msgstr ""
114
+
115
+ #: ../app/views/foreman_acd/ansible_playbooks/edit.html.erb:10
116
+ msgid "Edit Ansible Playbook %s"
117
+ msgstr ""
118
+
119
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:4
120
+ #: ../app/views/foreman_acd/ansible_playbooks/new.html.erb:1
121
+ msgid "New Ansible Playbook"
122
+ msgstr ""
123
+
124
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:9
125
+ msgid "AnsiblePlaybook|Name"
126
+ msgstr ""
127
+
128
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:10
129
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:11
130
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:9
131
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:97
132
+ msgid "Description"
133
+ msgstr ""
134
+
135
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:19
136
+ msgid "Import groups"
137
+ msgstr ""
138
+
139
+ #: ../app/views/foreman_acd/ansible_playbooks/index.html.erb:21
140
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:21
141
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:27
142
+ msgid "Delete %s?"
143
+ msgstr ""
144
+
145
+ #: ../app/views/foreman_acd/app_definitions/_form.html.erb:32
146
+ #: ../app/views/foreman_acd/app_definitions/import.html.erb:6
147
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:1
148
+ msgid "Application Definitions"
149
+ msgstr ""
150
+
151
+ #: ../app/views/foreman_acd/app_definitions/edit.html.erb:4
152
+ msgid "App Definitions"
153
+ msgstr ""
154
+
155
+ #: ../app/views/foreman_acd/app_definitions/edit.html.erb:11
156
+ msgid "Edit Application Definition %s"
157
+ msgstr ""
158
+
159
+ #: ../app/views/foreman_acd/app_definitions/import.html.erb:1
160
+ msgid "Import Application Definition"
161
+ msgstr ""
162
+
163
+ #: ../app/views/foreman_acd/app_definitions/import.html.erb:13
164
+ msgid "Application Definition file"
165
+ msgstr ""
166
+
167
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:4
168
+ #: ../app/views/foreman_acd/app_definitions/new.html.erb:1
169
+ msgid "New Application Definition"
170
+ msgstr ""
171
+
172
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:5
173
+ msgid "Import"
174
+ msgstr ""
175
+
176
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:10
177
+ msgid "AppDefinition|Name"
178
+ msgstr ""
179
+
180
+ #: ../app/views/foreman_acd/app_definitions/index.html.erb:22
181
+ msgid "Export"
182
+ msgstr ""
183
+
184
+ #: ../app/views/foreman_acd/app_instances/_form.html.erb:32
185
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:1
186
+ msgid "Application Instances"
187
+ msgstr ""
188
+
189
+ #: ../app/views/foreman_acd/app_instances/edit.html.erb:4
190
+ msgid "App Instances"
191
+ msgstr ""
192
+
193
+ #: ../app/views/foreman_acd/app_instances/edit.html.erb:11
194
+ msgid "Edit Application Instance %s"
195
+ msgstr ""
196
+
197
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:3
198
+ #: ../app/views/foreman_acd/app_instances/new.html.erb:1
199
+ msgid "New Application Instance"
200
+ msgstr ""
201
+
202
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:7
203
+ msgid "AppInstance|Name"
204
+ msgstr ""
205
+
206
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:8
207
+ msgid "Application"
208
+ msgstr ""
209
+
210
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:18
211
+ msgid "Deploy"
212
+ msgstr ""
213
+
214
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:20
215
+ msgid "Run Playbook"
216
+ msgstr ""
217
+
218
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:22
219
+ msgid "Run Playbook - customize first"
220
+ msgstr ""
221
+
222
+ #: ../app/views/foreman_acd/app_instances/index.html.erb:24
223
+ msgid "Report"
224
+ msgstr ""
225
+
226
+ #: ../lib/foreman_acd/plugin.rb:9
227
+ msgid "Applications"
228
+ msgstr ""
229
+
230
+ #: ../lib/foreman_acd/plugin.rb:145
231
+ msgid "Run playbook for ACD"
232
+ msgstr ""
233
+
234
+ #: ../lib/foreman_acd/plugin.rb:147
235
+ msgid "Run an Ansible playbook to configure ACD application"
236
+ msgstr ""
237
+
238
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:74
239
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:114
240
+ msgid "edit entry"
241
+ msgstr ""
242
+
243
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:81
244
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:121
245
+ msgid "change parameters"
246
+ msgstr ""
247
+
248
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:88
249
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:128
250
+ msgid "change ansible variables"
251
+ msgstr ""
252
+
253
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:102
254
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:142
255
+ msgid "edit"
256
+ msgstr ""
257
+
258
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:106
259
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:146
260
+ msgid "settings"
261
+ msgstr ""
262
+
263
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:277
264
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:324
265
+ msgid "change ansible variables for 'all'"
266
+ msgstr ""
267
+
268
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:285
269
+ msgid "Foreman Parameter definition for Application Definition"
270
+ msgstr ""
271
+
272
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:303
273
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:330
274
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:350
275
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:377
276
+ msgid "Save"
277
+ msgstr ""
278
+
279
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:304
280
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:331
281
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:351
282
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:378
283
+ msgid "Cancel"
284
+ msgstr ""
285
+
286
+ #: ../webpack/components/ApplicationDefinition/ApplicationDefinition.js:313
287
+ msgid "Ansible variables for Application Definition"
288
+ msgstr ""
289
+
290
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:53
291
+ msgid ""
292
+ "For some hosts the values for some parameters are missing. Check the values fo"
293
+ "r these hosts:\\n"
294
+ msgstr ""
295
+
296
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:71
297
+ msgid "Unachieved service counts:"
298
+ msgstr ""
299
+
300
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:75
301
+ msgid "- service ${s.name} expects at ${s.minCount} least configured hosts\\n"
302
+ msgstr ""
303
+
304
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:79
305
+ msgid "- service ${s.name} expects no more than ${s.axCount} configured hosts\\n"
306
+ msgstr ""
307
+
308
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:332
309
+ msgid "Foreman Parameter specification for Application Instance"
310
+ msgstr ""
311
+
312
+ #: ../webpack/components/ApplicationInstance/ApplicationInstance.js:360
313
+ msgid "Ansible group variables for Application Instance"
314
+ msgstr ""
315
+
316
+ #: ../webpack/components/ApplicationInstance/components/Service.js:12
317
+ msgid "Min/Max"
318
+ msgstr ""
319
+
320
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:63
321
+ msgid "Value"
322
+ msgstr ""
323
+
324
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:65
325
+ msgid "Default value"
326
+ msgstr ""
327
+
328
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:78
329
+ msgid "Name"
330
+ msgstr ""
331
+
332
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:120
333
+ msgid "Type"
334
+ msgstr ""
335
+
336
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:161
337
+ msgid "Actions"
338
+ msgstr ""
339
+
340
+ #: ../webpack/components/ParameterSelection/ParameterSelectionActions.js:188
341
+ msgid "Failed to fetch data from server."
342
+ msgstr ""
343
+
344
+ #: ../webpack/components/common/DeleteTableEntry.js:24
345
+ msgid "Are you sure you wish to delete this item?"
346
+ msgstr ""
347
+
348
+ #: ../webpack/components/common/DeleteTableEntry.js:26
349
+ msgid "Delete entry"
350
+ msgstr ""
351
+
352
+ #: gemspec.rb:2
353
+ msgid "TODO: Description of ForemanAcd."
354
+ msgstr ""
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_plugin_helper'
4
+ require 'nokogiri'
5
+
6
+ module ForemanAcd
7
+ # Ansible Playbooks Controller tests
8
+ class AnsiblePlaybooksControllerTest < ActionController::TestCase
9
+ setup do
10
+ as_admin { FactoryBot.create(:ansible_playbook) }
11
+ @model = ForemanAcd::AnsiblePlaybook.first
12
+ end
13
+
14
+ basic_index_test('ansible_playbook')
15
+ basic_new_test
16
+ basic_edit_test('ansible_playbook')
17
+
18
+ test 'should destroy ansible playbook' do
19
+ assert_difference('AnsiblePlaybook.count', -1) do
20
+ delete :destroy,
21
+ :params => { :id => @model.id },
22
+ :session => set_session_user
23
+ end
24
+ assert_redirected_to ansible_playbooks_url
25
+ end
26
+ end
27
+ end
@@ -14,6 +14,7 @@ import DeleteTableEntry from '../common/DeleteTableEntry';
14
14
  import RailsData from '../common/RailsData';
15
15
  import EasyHeaderFormatter from '../common/EasyHeaderFormatter';
16
16
  import AnsiblePlaybookSelector from './components/AnsiblePlaybookSelector';
17
+ import { translate as __ } from 'foremanReact/common/I18n';
17
18
 
18
19
  import {
19
20
  Table,
@@ -49,6 +50,10 @@ class ApplicationDefinition extends React.Component {
49
50
  return ansibleGroupObj;
50
51
  }
51
52
 
53
+ addTableEntryAllowed() {
54
+ return this.props.editMode || this.props.ansiblePlaybook.id == ''
55
+ }
56
+
52
57
  componentDidMount() {
53
58
  const {
54
59
  data: { mode, ansiblePlaybook, ansibleDataUrl, services, ansibleVarsAll, hostgroups },
@@ -70,21 +75,21 @@ class ApplicationDefinition extends React.Component {
70
75
  bsStyle="default"
71
76
  onClick={() => activateEditApplicationDefinitionService(additionalData)}
72
77
  >
73
- <Icon type="pf" name="edit" title="edit entry" />
78
+ <Icon type="pf" name="edit" title={__("edit entry")} />
74
79
  </Button>
75
80
  &nbsp;
76
81
  <Button
77
82
  bsStyle="default"
78
83
  onClick={() => openForemanParameterSelectionModal(additionalData)}
79
84
  >
80
- <Icon type="pf" name="settings" title="change parameters" />
85
+ <Icon type="pf" name="settings" title={__("change parameters")} />
81
86
  </Button>
82
87
  &nbsp;
83
88
  <Button
84
89
  bsStyle="default"
85
90
  onClick={() => openAnsibleParameterSelectionModal(additionalData)}
86
91
  >
87
- <span title="change ansible variables">A</span>
92
+ <span title={__("change ansible variables")}>A</span>
88
93
  </Button>
89
94
  &nbsp;
90
95
  <DeleteTableEntry
@@ -98,11 +103,11 @@ class ApplicationDefinition extends React.Component {
98
103
  renderEdit: (value, additionalData) => (
99
104
  <td style={{ padding: '2px' }}>
100
105
  <Button bsStyle="default" disabled>
101
- <Icon type="pf" name="edit" />
106
+ <Icon type="pf" name={__("edit")} />
102
107
  </Button>
103
108
  &nbsp;
104
109
  <Button bsStyle="default" disabled>
105
- <Icon type="pf" name="settings" />
110
+ <Icon type="pf" name={__("settings")} />
106
111
  </Button>
107
112
  &nbsp;
108
113
  <Button
@@ -206,10 +211,12 @@ class ApplicationDefinition extends React.Component {
206
211
  closeForemanParameterSelectionModal,
207
212
  openAnsibleParameterSelectionModal,
208
213
  closeAnsibleParameterSelectionModal,
214
+ changeParameterSelectionMode,
209
215
  ParameterSelectionModal,
210
216
  loadAnsibleData,
211
217
  } = this.props;
212
218
 
219
+
213
220
  return (
214
221
  <span>
215
222
  <div>
@@ -222,13 +229,14 @@ class ApplicationDefinition extends React.Component {
222
229
  selectValue={ ansiblePlaybook.id.toString() }
223
230
  additionalData={{url: ansibleDataUrl }}
224
231
  />
232
+ {ansiblePlaybook.id == '' ? (
233
+ <p style={{ paddingTop: 25 }}>
234
+ <pre>{ "Ansible Playbook can't be blank" }</pre>
235
+ </p>
236
+ ) : (<div></div>)}
237
+
225
238
  </div>
226
239
  <div className="form-group">
227
- <AddTableEntry
228
- hidden={ false }
229
- disabled={ this.props.editMode }
230
- onAddTableEntry={ addApplicationDefinitionService }
231
- />
232
240
  <Table.PfProvider
233
241
  striped
234
242
  bordered
@@ -258,7 +266,7 @@ class ApplicationDefinition extends React.Component {
258
266
  </Table.PfProvider>
259
267
  <AddTableEntry
260
268
  hidden={ false }
261
- disabled={ this.props.editMode }
269
+ disabled={ this.addTableEntryAllowed() }
262
270
  onAddTableEntry={ addApplicationDefinitionService }
263
271
  />
264
272
  <span style={{ marginLeft: 30 }}>
@@ -271,7 +279,7 @@ class ApplicationDefinition extends React.Component {
271
279
  isAllGroup: true
272
280
  })}
273
281
  >
274
- <span title="change ansible variables for 'all'">A</span>
282
+ <span title={__("change ansible variables for 'all'")}>A</span>
275
283
  </Button>
276
284
  </span>
277
285
  </div>
@@ -279,13 +287,14 @@ class ApplicationDefinition extends React.Component {
279
287
  <ForemanModal
280
288
  id="AppDefinitionForemanParamSelection"
281
289
  dialogClassName="param_selection_modal"
282
- title="Foreman Parameter definition for Application Definition"
290
+ title={__("Foreman Parameter definition for Application Definition")}
283
291
  >
284
292
  <ForemanModal.Header closeButton={false}>
285
293
  Parameter definition
286
294
  </ForemanModal.Header>
287
295
  {this.props.parametersData ? (
288
296
  <ParameterSelection
297
+ editModeCallback={ (hide) => changeParameterSelectionMode({ mode: hide })}
289
298
  paramType={ PARAMETER_SELECTION_PARAM_TYPE_FOREMAN }
290
299
  location={ location }
291
300
  organization={ organization }
@@ -296,8 +305,8 @@ class ApplicationDefinition extends React.Component {
296
305
  }
297
306
  <ForemanModal.Footer>
298
307
  <div>
299
- <Button bsStyle="primary" onClick={() => closeForemanParameterSelectionModal({ mode: 'save' })}>Save</Button>
300
- <Button bsStyle="default" onClick={() => closeForemanParameterSelectionModal({ mode: 'cancel' })}>Cancel</Button>
308
+ <Button bsStyle="primary" disabled={this.props.paramEditMode} onClick={() => closeForemanParameterSelectionModal({ mode: 'save' })}>{__("Save")}</Button>
309
+ <Button bsStyle="default" disabled={this.props.paramEditMode} onClick={() => closeForemanParameterSelectionModal({ mode: 'cancel' })}>{__("Cancel")}</Button>
301
310
  </div>
302
311
  </ForemanModal.Footer>
303
312
  </ForemanModal>
@@ -306,13 +315,14 @@ class ApplicationDefinition extends React.Component {
306
315
  <ForemanModal
307
316
  id="AppDefinitionAnsibleParamSelection"
308
317
  dialogClassName="param_selection_modal"
309
- title="Ansible variables for Application Definition"
318
+ title={__("Ansible variables for Application Definition")}
310
319
  >
311
320
  <ForemanModal.Header closeButton={false}>
312
321
  Parameter definition
313
322
  </ForemanModal.Header>
314
323
  {this.props.parametersData ? (
315
324
  <ParameterSelection
325
+ editModeCallback={ (hide) => changeParameterSelectionMode({ mode: hide })}
316
326
  paramType={ PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE }
317
327
  location={ location }
318
328
  organization={ organization }
@@ -322,8 +332,8 @@ class ApplicationDefinition extends React.Component {
322
332
  }
323
333
  <ForemanModal.Footer>
324
334
  <div>
325
- <Button bsStyle="primary" onClick={() => closeAnsibleParameterSelectionModal({ mode: 'save' })}>Save</Button>
326
- <Button bsStyle="default" onClick={() => closeAnsibleParameterSelectionModal({ mode: 'cancel' })}>Cancel</Button>
335
+ <Button bsStyle="primary" disabled={this.props.paramEditMode} onClick={() => closeAnsibleParameterSelectionModal({ mode: 'save' })}>{__("Save")}</Button>
336
+ <Button bsStyle="default" disabled={this.props.paramEditMode} onClick={() => closeAnsibleParameterSelectionModal({ mode: 'cancel' })}>{__("Cancel")}</Button>
327
337
  </div>
328
338
  </ForemanModal.Footer>
329
339
  </ForemanModal>
@@ -353,6 +363,7 @@ ApplicationDefinition.defaultProps = {
353
363
  parametersData: {},
354
364
  columns: [],
355
365
  editParamsOfRowId: null,
366
+ paramEditMode: false,
356
367
  }
357
368
 
358
369
  ApplicationDefinition.propTypes = {
@@ -372,7 +383,9 @@ ApplicationDefinition.propTypes = {
372
383
  closeForemanParameterSelectionModal: PropTypes.func,
373
384
  openAnsibleParameterSelectionModal: PropTypes.func,
374
385
  closeAnsibleParameterSelectionModal: PropTypes.func,
386
+ changeParameterSelectionMode: PropTypes.func,
375
387
  parametersData: PropTypes.object,
388
+ paramEditMode: PropTypes.bool,
376
389
  };
377
390
 
378
391
  export default ApplicationDefinition;