foreman_acd 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +17 -2
  4. data/app/controllers/foreman_acd/app_definitions_controller.rb +104 -7
  5. data/app/controllers/foreman_acd/app_instances_controller.rb +15 -30
  6. data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
  7. data/app/controllers/ui_acd_controller.rb +38 -1
  8. data/app/lib/actions/foreman_acd/run_configurator.rb +1 -0
  9. data/app/models/concerns/foreman_acd/host_managed_extensions.rb +15 -27
  10. data/app/models/foreman_acd/app_instance.rb +47 -2
  11. data/app/models/foreman_acd/foreman_host.rb +8 -0
  12. data/app/services/foreman_acd/app_deployer.rb +19 -2
  13. data/app/services/foreman_acd/inventory_creator.rb +11 -1
  14. data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
  15. data/app/views/foreman_acd/app_definitions/index.html.erb +3 -6
  16. data/app/views/foreman_acd/app_instances/index.html.erb +15 -11
  17. data/app/views/foreman_acd/app_instances/report.html.erb +7 -2
  18. data/app/views/ui_acd/host_report.json.rabl +4 -0
  19. data/app/views/ui_acd/report_data.json.rabl +10 -0
  20. data/app/views/ui_acd/validate_hostname.json.rabl +6 -0
  21. data/config/routes.rb +3 -0
  22. data/db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb +8 -0
  23. data/db/migrate/20210902110645_add_initial_configure_task.rb +8 -0
  24. data/lib/foreman_acd/plugin.rb +6 -6
  25. data/lib/foreman_acd/version.rb +1 -1
  26. data/lib/foreman_acd.rb +27 -9
  27. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
  28. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +28 -9
  29. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +6 -0
  30. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +1 -0
  31. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +30 -9
  32. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +3 -0
  33. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +1 -0
  34. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +30 -5
  35. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +1 -1
  36. data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +3 -3
  37. data/webpack/components/ApplicationDefinition/index.js +6 -0
  38. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +214 -0
  39. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss +1 -0
  40. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +161 -0
  41. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +6 -0
  42. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +79 -0
  43. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +8 -0
  44. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js +129 -0
  45. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +29 -0
  46. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +20 -0
  47. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +43 -0
  48. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +29 -0
  49. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +62 -0
  50. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap +362 -0
  51. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +130 -0
  52. data/webpack/components/ApplicationDefinitionImport/index.js +32 -0
  53. data/webpack/components/ApplicationInstance/ApplicationInstance.js +96 -25
  54. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +112 -6
  55. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +4 -0
  56. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
  57. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +71 -30
  58. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +3 -0
  59. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +2 -0
  60. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +1 -0
  61. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +12 -0
  62. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +97 -7
  63. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +271 -0
  64. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
  65. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +1 -1
  66. data/webpack/components/ApplicationInstance/helper.js +0 -0
  67. data/webpack/components/ApplicationInstance/index.js +6 -0
  68. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +81 -6
  69. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +35 -1
  70. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +3 -0
  71. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -0
  72. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -0
  73. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +1 -124
  74. data/webpack/components/ApplicationInstanceReport/index.js +8 -1
  75. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +104 -0
  76. data/webpack/components/ExistingHostSelection/ExistingHostSelection.scss +15 -0
  77. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +71 -0
  78. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +4 -0
  79. data/webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js +0 -0
  80. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +90 -0
  81. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -0
  82. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +191 -0
  83. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +203 -0
  84. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +19 -0
  85. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js +59 -0
  86. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +36 -0
  87. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap +35 -0
  88. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap +614 -0
  89. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +27 -0
  90. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +48 -0
  91. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +35 -0
  92. data/webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap +77 -0
  93. data/webpack/components/ExistingHostSelection/index.js +26 -0
  94. data/webpack/components/ParameterSelection/ParameterSelection.js +98 -1
  95. data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
  96. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +36 -2
  97. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +2 -0
  98. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +49 -8
  99. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +1 -0
  100. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +2 -0
  101. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +96 -0
  102. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +5 -0
  103. data/webpack/components/ParameterSelection/index.js +2 -1
  104. data/webpack/components/SyncGitRepo/SyncGitRepo.js +2 -10
  105. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +1 -2
  106. data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +0 -1
  107. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +1 -0
  108. data/webpack/components/SyncGitRepo/components/FormTextInput.js +1 -1
  109. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +3 -2
  110. data/webpack/components/common/DeleteTableEntry.js +16 -2
  111. data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +38 -0
  112. data/webpack/helper.js +5 -0
  113. data/webpack/index.js +5 -0
  114. data/webpack/js-yaml.js +3874 -0
  115. data/webpack/reducer.js +13 -2
  116. metadata +46 -2
data/webpack/reducer.js CHANGED
@@ -2,8 +2,10 @@ import { combineReducers } from 'redux';
2
2
 
3
3
  import parameterSelectionParameters from './components/ParameterSelection/ParameterSelectionReducer';
4
4
  import applicationDefinitionConf from './components/ApplicationDefinition/ApplicationDefinitionReducer';
5
+ import applicationDefinitionImportConf from './components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer';
5
6
  import applicationInstanceConf from './components/ApplicationInstance/ApplicationInstanceReducer';
6
7
  import applicationInstanceReport from './components/ApplicationInstanceReport/ApplicationInstanceReportReducer';
8
+ import existingHostSelectionConf from './components/ExistingHostSelection/ExistingHostSelectionReducer';
7
9
  import syncGitRepoConf from './components/SyncGitRepo/SyncGitRepoReducer';
8
10
 
9
11
  import {
@@ -14,6 +16,7 @@ import {
14
16
  import {
15
17
  APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
16
18
  APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
19
+ APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE,
17
20
  } from './components/ApplicationInstance/ApplicationInstanceConstants';
18
21
 
19
22
  const rootReducer = (state = {}, action) => {
@@ -28,6 +31,7 @@ const rootReducer = (state = {}, action) => {
28
31
  action.payload.parameterSelection = param_state.parameters;
29
32
  }
30
33
  const app_def_state = applicationDefinitionConf(state.applicationDefinitionConf, action);
34
+ const app_def_import_state = applicationDefinitionImportConf(state.applicationDefinitionImportConf, action);
31
35
 
32
36
  if (action.type == APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE) {
33
37
  action.payload.parameterSelection = param_state.parameters;
@@ -35,15 +39,22 @@ const rootReducer = (state = {}, action) => {
35
39
  if (action.type == APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE) {
36
40
  action.payload.parameterSelection = param_state.parameters;
37
41
  }
38
- const app_ins_state = applicationInstanceConf(state.applicationInstanceConf, action);
39
42
 
43
+ const ex_host_state = existingHostSelectionConf(state.existingHostSelectionConf, action);
44
+ if (action.type == APPLICATION_INSTANCE_ADD_EXISTING_HOSTS_MODAL_CLOSE) {
45
+ action.payload.selectedHosts = ex_host_state.selectedHosts;
46
+ }
47
+
48
+ const app_ins_state = applicationInstanceConf(state.applicationInstanceConf, action);
40
49
  const sync_git_repo_state = syncGitRepoConf(state.syncGitRepoConf, action);
41
50
 
42
51
  return {
43
52
  applicationDefinitionConf: app_def_state,
53
+ applicationDefinitionImportConf: app_def_import_state,
44
54
  applicationInstanceConf: app_ins_state,
45
- parameterSelectionParameters: param_state,
46
55
  applicationInstanceReport: app_ins_report_state,
56
+ existingHostSelectionConf: ex_host_state,
57
+ parameterSelectionParameters: param_state,
47
58
  syncGitRepoConf: sync_git_repo_state,
48
59
  };
49
60
  };
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_acd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-31 00:00:00.000000000 Z
11
+ date: 2021-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -102,6 +102,7 @@ files:
102
102
  - app/controllers/foreman_acd/application_controller.rb
103
103
  - app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb
104
104
  - app/controllers/foreman_acd/concerns/app_definition_parameters.rb
105
+ - app/controllers/foreman_acd/concerns/app_instance_mixins.rb
105
106
  - app/controllers/foreman_acd/concerns/app_instance_parameters.rb
106
107
  - app/controllers/foreman_acd/remote_execution_controller.rb
107
108
  - app/controllers/ui_acd_controller.rb
@@ -149,8 +150,11 @@ files:
149
150
  - app/views/ui_acd/domain.json.rabl
150
151
  - app/views/ui_acd/environment.json.rabl
151
152
  - app/views/ui_acd/foreman_data.json.rabl
153
+ - app/views/ui_acd/host_report.json.rabl
152
154
  - app/views/ui_acd/lifecycle_environment.json.rabl
153
155
  - app/views/ui_acd/ptable.json.rabl
156
+ - app/views/ui_acd/report_data.json.rabl
157
+ - app/views/ui_acd/validate_hostname.json.rabl
154
158
  - config/routes.rb
155
159
  - db/migrate/20190610202252_create_app_definitions.rb
156
160
  - db/migrate/20190625140305_create_app_instances.rb
@@ -167,6 +171,8 @@ files:
167
171
  - db/migrate/20210216091529_add_last_deploy_task.rb
168
172
  - db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb
169
173
  - db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb
174
+ - db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb
175
+ - db/migrate/20210902110645_add_initial_configure_task.rb
170
176
  - db/seeds.d/62_acd_proxy_feature.rb
171
177
  - db/seeds.d/75-job_templates.rb
172
178
  - lib/foreman_acd.rb
@@ -197,6 +203,7 @@ files:
197
203
  - webpack/__mocks__/foremanReact/common/I18n.js
198
204
  - webpack/__mocks__/foremanReact/common/helpers.js
199
205
  - webpack/__mocks__/foremanReact/components/ForemanModal.js
206
+ - webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js
200
207
  - webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js
201
208
  - webpack/__mocks__/foremanReact/components/common/forms/Select.js
202
209
  - webpack/__mocks__/foremanReact/components/common/forms/TextInput.js
@@ -221,10 +228,26 @@ files:
221
228
  - webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js
222
229
  - webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap
223
230
  - webpack/components/ApplicationDefinition/index.js
231
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js
232
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss
233
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js
234
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js
235
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js
236
+ - webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js
237
+ - webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js
238
+ - webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js
239
+ - webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js
240
+ - webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js
241
+ - webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js
242
+ - webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap
243
+ - webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap
244
+ - webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap
245
+ - webpack/components/ApplicationDefinitionImport/index.js
224
246
  - webpack/components/ApplicationInstance/ApplicationInstance.js
225
247
  - webpack/components/ApplicationInstance/ApplicationInstance.scss
226
248
  - webpack/components/ApplicationInstance/ApplicationInstanceActions.js
227
249
  - webpack/components/ApplicationInstance/ApplicationInstanceConstants.js
250
+ - webpack/components/ApplicationInstance/ApplicationInstanceHelper.js
228
251
  - webpack/components/ApplicationInstance/ApplicationInstanceReducer.js
229
252
  - webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js
230
253
  - webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js
@@ -238,6 +261,7 @@ files:
238
261
  - webpack/components/ApplicationInstance/components/AppDefinitionSelector.js
239
262
  - webpack/components/ApplicationInstance/components/Service.js
240
263
  - webpack/components/ApplicationInstance/components/ServiceCounter.js
264
+ - webpack/components/ApplicationInstance/helper.js
241
265
  - webpack/components/ApplicationInstance/index.js
242
266
  - webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js
243
267
  - webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss
@@ -257,6 +281,25 @@ files:
257
281
  - webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js
258
282
  - webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap
259
283
  - webpack/components/ApplicationInstanceReport/index.js
284
+ - webpack/components/ExistingHostSelection/ExistingHostSelection.js
285
+ - webpack/components/ExistingHostSelection/ExistingHostSelection.scss
286
+ - webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js
287
+ - webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js
288
+ - webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js
289
+ - webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js
290
+ - webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js
291
+ - webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js
292
+ - webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js
293
+ - webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js
294
+ - webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js
295
+ - webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js
296
+ - webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap
297
+ - webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap
298
+ - webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap
299
+ - webpack/components/ExistingHostSelection/components/ServiceSelector.js
300
+ - webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js
301
+ - webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap
302
+ - webpack/components/ExistingHostSelection/index.js
260
303
  - webpack/components/ParameterSelection/ParameterSelection.js
261
304
  - webpack/components/ParameterSelection/ParameterSelection.scss
262
305
  - webpack/components/ParameterSelection/ParameterSelectionActions.js
@@ -313,6 +356,7 @@ files:
313
356
  - webpack/helper.js
314
357
  - webpack/helper.test.js
315
358
  - webpack/index.js
359
+ - webpack/js-yaml.js
316
360
  - webpack/reducer.js
317
361
  - webpack/test_setup.js
318
362
  homepage: https://www.orcharhino.com