foreman_acd 0.6.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +90 -0
  4. data/app/controllers/foreman_acd/app_definitions_controller.rb +104 -7
  5. data/app/controllers/foreman_acd/app_instances_controller.rb +34 -32
  6. data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +1 -1
  7. data/app/controllers/foreman_acd/concerns/app_instance_mixins.rb +36 -0
  8. data/app/controllers/foreman_acd/remote_execution_controller.rb +37 -21
  9. data/app/controllers/ui_acd_controller.rb +42 -3
  10. data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +12 -7
  11. data/app/lib/actions/foreman_acd/run_configurator.rb +11 -7
  12. data/app/models/concerns/foreman_acd/host_managed_extensions.rb +41 -28
  13. data/app/models/foreman_acd/acd_provider.rb +7 -1
  14. data/app/models/foreman_acd/ansible_playbook.rb +2 -1
  15. data/app/models/foreman_acd/app_instance.rb +48 -3
  16. data/app/models/foreman_acd/foreman_host.rb +8 -0
  17. data/app/services/foreman_acd/acd_proxy_proxy_selector.rb +17 -0
  18. data/app/services/foreman_acd/app_configurator.rb +59 -15
  19. data/app/services/foreman_acd/app_deployer.rb +27 -4
  20. data/app/services/foreman_acd/inventory_creator.rb +25 -1
  21. data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +41 -7
  22. data/app/views/foreman_acd/app_definitions/_form.html.erb +5 -1
  23. data/app/views/foreman_acd/app_definitions/import.html.erb +20 -1
  24. data/app/views/foreman_acd/app_definitions/index.html.erb +3 -6
  25. data/app/views/foreman_acd/app_instances/_form.html.erb +5 -1
  26. data/app/views/foreman_acd/app_instances/index.html.erb +18 -12
  27. data/app/views/foreman_acd/app_instances/report.html.erb +8 -3
  28. data/app/views/templates/job/run_acd_ansible_playbook.erb +1 -1
  29. data/app/views/ui_acd/host_report.json.rabl +4 -0
  30. data/app/views/ui_acd/report_data.json.rabl +10 -0
  31. data/app/views/ui_acd/validate_hostname.json.rabl +6 -0
  32. data/config/routes.rb +6 -0
  33. data/db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb +8 -0
  34. data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +8 -0
  35. data/db/migrate/20210818125913_add_is_existing_host_to_foreman_host.rb +8 -0
  36. data/db/migrate/20210902110645_add_initial_configure_task.rb +8 -0
  37. data/db/seeds.d/75-job_templates.rb +1 -1
  38. data/lib/foreman_acd/engine.rb +26 -4
  39. data/lib/foreman_acd/plugin.rb +9 -18
  40. data/lib/foreman_acd/version.rb +1 -1
  41. data/lib/foreman_acd.rb +30 -0
  42. data/lib/tasks/foreman_acd_tasks.rake +0 -12
  43. data/package.json +8 -22
  44. data/test/controllers/ansible_playbooks_controller_test.rb +1 -1
  45. data/test/controllers/app_instances_controller_test.rb +8 -3
  46. data/test/controllers/ui_acd_controller_test.rb +25 -6
  47. data/test/factories/foreman_acd_factories.rb +18 -4
  48. data/test/models/acd_provider_test.rb +37 -0
  49. data/test/models/ansible_playbook_test.rb +11 -0
  50. data/test/models/app_definition_test.rb +1 -1
  51. data/test/models/app_instance_test.rb +2 -0
  52. data/test/models/concerns/host_extensions_test.rb +26 -0
  53. data/test/models/foreman_host_test.rb +12 -0
  54. data/webpack/__mocks__/foremanReact/API.js +2 -0
  55. data/webpack/__mocks__/foremanReact/common/I18n.js +3 -0
  56. data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
  57. data/webpack/__mocks__/foremanReact/components/ForemanModal/ForemanModalActions.js +2 -0
  58. data/webpack/__mocks__/foremanReact/components/ForemanModal.js +7 -0
  59. data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +2 -0
  60. data/webpack/__mocks__/foremanReact/components/common/forms/TextInput.js +2 -0
  61. data/webpack/__mocks__/foremanReact/components/hosts/powerStatus.js +1 -0
  62. data/webpack/__snapshots__/helper.test.js.snap +14 -0
  63. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +35 -11
  64. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +12 -0
  65. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +1 -0
  66. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +30 -9
  67. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +4 -0
  68. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionConfData_1.fixtures.js +288 -0
  69. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +79 -0
  70. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +26 -0
  71. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +119 -0
  72. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +53 -0
  73. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +226 -0
  74. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
  75. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +307 -0
  76. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +2 -1
  77. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +41 -0
  78. data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +121 -0
  79. data/webpack/components/ApplicationDefinition/index.js +8 -0
  80. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.js +214 -0
  81. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImport.scss +1 -0
  82. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportActions.js +161 -0
  83. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportConstants.js +6 -0
  84. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportReducer.js +79 -0
  85. data/webpack/components/ApplicationDefinitionImport/ApplicationDefinitionImportSelectors.js +8 -0
  86. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportConfData_1.fixtures.js +129 -0
  87. data/webpack/components/ApplicationDefinitionImport/__fixtures__/applicationDefinitionImportReducer.fixtures.js +29 -0
  88. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImport.test.js +20 -0
  89. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportReducer.test.js +43 -0
  90. data/webpack/components/ApplicationDefinitionImport/__tests__/ApplicationDefinitionImportSelectors.test.js +29 -0
  91. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImport.test.js.snap +62 -0
  92. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportReducer.test.js.snap +362 -0
  93. data/webpack/components/ApplicationDefinitionImport/__tests__/__snapshots__/ApplicationDefinitionImportSelectors.test.js.snap +130 -0
  94. data/webpack/components/ApplicationDefinitionImport/index.js +32 -0
  95. data/webpack/components/ApplicationInstance/ApplicationInstance.js +105 -31
  96. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +118 -6
  97. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +4 -0
  98. data/webpack/components/ApplicationInstance/ApplicationInstanceHelper.js +15 -0
  99. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +71 -30
  100. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +4 -0
  101. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js +263 -0
  102. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +80 -0
  103. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +24 -0
  104. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +131 -0
  105. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +56 -0
  106. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +300 -0
  107. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2990 -0
  108. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +284 -0
  109. data/webpack/components/ApplicationInstance/components/AppDefinitionSelector.js +1 -0
  110. data/webpack/components/ApplicationInstance/components/ServiceCounter.js +1 -1
  111. data/webpack/components/ApplicationInstance/helper.js +0 -0
  112. data/webpack/components/ApplicationInstance/index.js +8 -0
  113. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +81 -6
  114. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +35 -1
  115. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +3 -0
  116. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +19 -0
  117. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +4 -0
  118. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportData_1.fixtures.js +349 -0
  119. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +20 -0
  120. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +47 -0
  121. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js +41 -0
  122. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +26 -0
  123. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +7 -0
  124. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +718 -0
  125. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +347 -0
  126. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +24 -0
  127. data/webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap +24 -0
  128. data/webpack/components/ApplicationInstanceReport/index.js +8 -1
  129. data/webpack/components/ExistingHostSelection/ExistingHostSelection.js +104 -0
  130. data/webpack/components/ExistingHostSelection/ExistingHostSelection.scss +15 -0
  131. data/webpack/components/ExistingHostSelection/ExistingHostSelectionActions.js +71 -0
  132. data/webpack/components/ExistingHostSelection/ExistingHostSelectionConstants.js +4 -0
  133. data/webpack/components/ExistingHostSelection/ExistingHostSelectionHelper.js +0 -0
  134. data/webpack/components/ExistingHostSelection/ExistingHostSelectionReducer.js +90 -0
  135. data/webpack/components/ExistingHostSelection/ExistingHostSelectionSelectors.js +8 -0
  136. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionConfData_1.fixtures.js +191 -0
  137. data/webpack/components/ExistingHostSelection/__fixtures__/existingHostSelectionReducer.fixtures.js +203 -0
  138. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelection.test.js +19 -0
  139. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionReducer.test.js +59 -0
  140. data/webpack/components/ExistingHostSelection/__tests__/ExistingHostSelectionSelectors.test.js +36 -0
  141. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelection.test.js.snap +35 -0
  142. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionReducer.test.js.snap +614 -0
  143. data/webpack/components/ExistingHostSelection/__tests__/__snapshots__/ExistingHostSelectionSelectors.test.js.snap +27 -0
  144. data/webpack/components/ExistingHostSelection/components/ServiceSelector.js +48 -0
  145. data/webpack/components/ExistingHostSelection/components/__tests__/ServiceSelector.test.js +35 -0
  146. data/webpack/components/ExistingHostSelection/components/__tests__/__snapshots__/ServiceSelector.test.js.snap +77 -0
  147. data/webpack/components/ExistingHostSelection/index.js +26 -0
  148. data/webpack/components/ParameterSelection/ParameterSelection.js +103 -1
  149. data/webpack/components/ParameterSelection/ParameterSelection.scss +7 -0
  150. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +46 -4
  151. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +2 -0
  152. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +5 -1
  153. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +51 -29
  154. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -0
  155. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +124 -84
  156. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +10 -4
  157. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +36 -46
  158. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +33 -25
  159. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +12 -6
  160. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +84 -112
  161. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1589 -878
  162. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +130 -79
  163. data/webpack/components/ParameterSelection/index.js +4 -1
  164. data/webpack/components/SyncGitRepo/SyncGitRepo.js +202 -0
  165. data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
  166. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +123 -0
  167. data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +8 -0
  168. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +80 -0
  169. data/webpack/components/SyncGitRepo/SyncGitRepoSelectors.js +6 -0
  170. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +7 -0
  171. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +44 -0
  172. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +27 -0
  173. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoReducer.test.js +95 -0
  174. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +32 -0
  175. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +31 -0
  176. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoReducer.test.js.snap +137 -0
  177. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +13 -0
  178. data/webpack/components/SyncGitRepo/components/FormTextInput.js +42 -0
  179. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +47 -0
  180. data/webpack/components/SyncGitRepo/index.js +28 -0
  181. data/webpack/components/common/DeleteTableEntry.js +16 -2
  182. data/webpack/components/common/ExtTextInput.js +43 -0
  183. data/webpack/components/common/__tests__/EditTableEntry.test.js +53 -0
  184. data/webpack/components/common/__tests__/LockTableEntry.test.js +35 -0
  185. data/webpack/components/common/__tests__/__snapshots__/DeleteTableEntry.test.js.snap +40 -2
  186. data/webpack/components/common/__tests__/__snapshots__/EditTableEntry.test.js.snap +81 -0
  187. data/webpack/components/common/__tests__/__snapshots__/LockTableEntry.test.js.snap +60 -0
  188. data/webpack/helper.js +35 -1
  189. data/webpack/helper.test.js +56 -0
  190. data/webpack/index.js +7 -0
  191. data/webpack/js-yaml.js +3874 -0
  192. data/webpack/reducer.js +16 -1
  193. data/webpack/test_setup.js +0 -2
  194. metadata +136 -11
  195. data/webpack/components/common/EasyHeaderFormatter.js +0 -18
  196. data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +0 -35
  197. data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +0 -41
@@ -0,0 +1,347 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ApplicationInstanceSelectors should return activeHostId from applicationInstanceReportData_1 fixtures 1`] = `undefined`;
4
+
5
+ exports[`ApplicationInstanceSelectors should return hosts from applicationInstanceReportData_1 fixtures 1`] = `
6
+ Array [
7
+ Object {
8
+ "build": false,
9
+ "hostUrl": "/hosts/great-web-app-db-1.deploy3.dev.atix",
10
+ "id": 8,
11
+ "name": "great-web-app-db-1",
12
+ "powerStatusUrl": "/api/v2/hosts/great-web-app-db-1.deploy3.dev.atix/power",
13
+ "progress_report": Array [
14
+ Object {
15
+ "created": 1615542728.8466988,
16
+ "id": "Set up compute instance great-web-app-db-1.deploy3.dev.atix",
17
+ "name": "Set up compute instance great-web-app-db-1.deploy3.dev.atix",
18
+ "priority": 3,
19
+ "status": "completed",
20
+ "timestamp": "2021-03-12T09:52:10.190Z",
21
+ },
22
+ Object {
23
+ "created": 1615542728.8474095,
24
+ "id": "Query instance details for great-web-app-db-1.deploy3.dev.atix",
25
+ "name": "Query instance details for great-web-app-db-1.deploy3.dev.atix",
26
+ "priority": 5,
27
+ "status": "completed",
28
+ "timestamp": "2021-03-12T09:52:10.385Z",
29
+ },
30
+ Object {
31
+ "created": 1615542728.0081317,
32
+ "id": "dhcp_create_192.168.171.103",
33
+ "name": "Create DHCP Settings for great-web-app-db-1.deploy3.dev.atix",
34
+ "priority": 10,
35
+ "status": "completed",
36
+ "timestamp": "2021-03-12T09:52:10.584Z",
37
+ },
38
+ Object {
39
+ "created": 1615542728.04177,
40
+ "id": "Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
41
+ "name": "Create IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
42
+ "priority": 10,
43
+ "status": "completed",
44
+ "timestamp": "2021-03-12T09:52:10.679Z",
45
+ },
46
+ Object {
47
+ "created": 1615542728.0424814,
48
+ "id": "Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
49
+ "name": "Create Reverse IPv4 DNS record for great-web-app-db-1.deploy3.dev.atix",
50
+ "priority": 10,
51
+ "status": "completed",
52
+ "timestamp": "2021-03-12T09:52:10.798Z",
53
+ },
54
+ Object {
55
+ "created": 1615542728.0881674,
56
+ "id": "Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix",
57
+ "name": "Deploy TFTP PXELinux config for great-web-app-db-1.deploy3.dev.atix",
58
+ "priority": 20,
59
+ "status": "completed",
60
+ "timestamp": "2021-03-12T09:52:11.178Z",
61
+ },
62
+ Object {
63
+ "created": 1615542728.0883749,
64
+ "id": "Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix",
65
+ "name": "Deploy TFTP PXEGrub2 config for great-web-app-db-1.deploy3.dev.atix",
66
+ "priority": 20,
67
+ "status": "completed",
68
+ "timestamp": "2021-03-12T09:52:11.615Z",
69
+ },
70
+ Object {
71
+ "created": 1615542728.088634,
72
+ "id": "Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix",
73
+ "name": "Deploy TFTP PXEGrub config for great-web-app-db-1.deploy3.dev.atix",
74
+ "priority": 20,
75
+ "status": "completed",
76
+ "timestamp": "2021-03-12T09:52:11.642Z",
77
+ },
78
+ Object {
79
+ "created": 1615542728.0888274,
80
+ "id": "Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix",
81
+ "name": "Deploy TFTP iPXE config for great-web-app-db-1.deploy3.dev.atix",
82
+ "priority": 20,
83
+ "status": "completed",
84
+ "timestamp": "2021-03-12T09:52:11.874Z",
85
+ },
86
+ Object {
87
+ "created": 1615542728.0894718,
88
+ "id": "Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix",
89
+ "name": "Fetch TFTP boot files for great-web-app-db-1.deploy3.dev.atix",
90
+ "priority": 25,
91
+ "status": "completed",
92
+ "timestamp": "2021-03-12T09:52:11.981Z",
93
+ },
94
+ Object {
95
+ "created": 1615542728.8482428,
96
+ "id": "Power up compute instance great-web-app-db-1.deploy3.dev.atix",
97
+ "name": "Power up compute instance great-web-app-db-1.deploy3.dev.atix",
98
+ "priority": 1000,
99
+ "status": "completed",
100
+ "timestamp": "2021-03-12T09:52:12.950Z",
101
+ },
102
+ Object {
103
+ "created": 1615542728.8508224,
104
+ "id": "Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix",
105
+ "name": "Cleanup PuppetCA certificates for great-web-app-db-1.deploy3.dev.atix",
106
+ "priority": 51,
107
+ "status": "completed",
108
+ "timestamp": "2021-03-12T09:52:13.390Z",
109
+ },
110
+ Object {
111
+ "created": 1615542728.8514216,
112
+ "id": "Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix",
113
+ "name": "Enable PuppetCA autosigning for great-web-app-db-1.deploy3.dev.atix",
114
+ "priority": 55,
115
+ "status": "completed",
116
+ "timestamp": "2021-03-12T09:52:13.442Z",
117
+ },
118
+ ],
119
+ },
120
+ Object {
121
+ "build": false,
122
+ "hostUrl": "/hosts/great-web-app-web-1.deploy3.dev.atix",
123
+ "id": 9,
124
+ "name": "great-web-app-web-1",
125
+ "powerStatusUrl": "/api/v2/hosts/great-web-app-web-1.deploy3.dev.atix/power",
126
+ "progress_report": Array [
127
+ Object {
128
+ "created": 1615542733.824889,
129
+ "id": "Set up compute instance great-web-app-web-1.deploy3.dev.atix",
130
+ "name": "Set up compute instance great-web-app-web-1.deploy3.dev.atix",
131
+ "priority": 3,
132
+ "status": "completed",
133
+ "timestamp": "2021-03-12T09:52:14.825Z",
134
+ },
135
+ Object {
136
+ "created": 1615542733.825672,
137
+ "id": "Query instance details for great-web-app-web-1.deploy3.dev.atix",
138
+ "name": "Query instance details for great-web-app-web-1.deploy3.dev.atix",
139
+ "priority": 5,
140
+ "status": "completed",
141
+ "timestamp": "2021-03-12T09:52:15.007Z",
142
+ },
143
+ Object {
144
+ "created": 1615542733.5710943,
145
+ "id": "dhcp_create_192.168.171.104",
146
+ "name": "Create DHCP Settings for great-web-app-web-1.deploy3.dev.atix",
147
+ "priority": 10,
148
+ "status": "completed",
149
+ "timestamp": "2021-03-12T09:52:15.181Z",
150
+ },
151
+ Object {
152
+ "created": 1615542733.599793,
153
+ "id": "Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
154
+ "name": "Create IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
155
+ "priority": 10,
156
+ "status": "completed",
157
+ "timestamp": "2021-03-12T09:52:15.251Z",
158
+ },
159
+ Object {
160
+ "created": 1615542733.600369,
161
+ "id": "Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
162
+ "name": "Create Reverse IPv4 DNS record for great-web-app-web-1.deploy3.dev.atix",
163
+ "priority": 10,
164
+ "status": "completed",
165
+ "timestamp": "2021-03-12T09:52:15.328Z",
166
+ },
167
+ Object {
168
+ "created": 1615542733.6356068,
169
+ "id": "Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix",
170
+ "name": "Deploy TFTP PXELinux config for great-web-app-web-1.deploy3.dev.atix",
171
+ "priority": 20,
172
+ "status": "completed",
173
+ "timestamp": "2021-03-12T09:52:15.681Z",
174
+ },
175
+ Object {
176
+ "created": 1615542733.635817,
177
+ "id": "Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix",
178
+ "name": "Deploy TFTP PXEGrub2 config for great-web-app-web-1.deploy3.dev.atix",
179
+ "priority": 20,
180
+ "status": "completed",
181
+ "timestamp": "2021-03-12T09:52:16.152Z",
182
+ },
183
+ Object {
184
+ "created": 1615542733.6360064,
185
+ "id": "Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix",
186
+ "name": "Deploy TFTP PXEGrub config for great-web-app-web-1.deploy3.dev.atix",
187
+ "priority": 20,
188
+ "status": "completed",
189
+ "timestamp": "2021-03-12T09:52:16.183Z",
190
+ },
191
+ Object {
192
+ "created": 1615542733.6362345,
193
+ "id": "Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix",
194
+ "name": "Deploy TFTP iPXE config for great-web-app-web-1.deploy3.dev.atix",
195
+ "priority": 20,
196
+ "status": "completed",
197
+ "timestamp": "2021-03-12T09:52:16.417Z",
198
+ },
199
+ Object {
200
+ "created": 1615542733.6365006,
201
+ "id": "Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix",
202
+ "name": "Fetch TFTP boot files for great-web-app-web-1.deploy3.dev.atix",
203
+ "priority": 25,
204
+ "status": "completed",
205
+ "timestamp": "2021-03-12T09:52:16.523Z",
206
+ },
207
+ Object {
208
+ "created": 1615542733.8267431,
209
+ "id": "Power up compute instance great-web-app-web-1.deploy3.dev.atix",
210
+ "name": "Power up compute instance great-web-app-web-1.deploy3.dev.atix",
211
+ "priority": 1000,
212
+ "status": "completed",
213
+ "timestamp": "2021-03-12T09:52:17.533Z",
214
+ },
215
+ Object {
216
+ "created": 1615542733.8292165,
217
+ "id": "Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix",
218
+ "name": "Cleanup PuppetCA certificates for great-web-app-web-1.deploy3.dev.atix",
219
+ "priority": 51,
220
+ "status": "completed",
221
+ "timestamp": "2021-03-12T09:52:17.944Z",
222
+ },
223
+ Object {
224
+ "created": 1615542733.8294067,
225
+ "id": "Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix",
226
+ "name": "Enable PuppetCA autosigning for great-web-app-web-1.deploy3.dev.atix",
227
+ "priority": 55,
228
+ "status": "completed",
229
+ "timestamp": "2021-03-12T09:52:17.995Z",
230
+ },
231
+ ],
232
+ },
233
+ Object {
234
+ "build": false,
235
+ "hostUrl": "/hosts/great-web-app-web-2.deploy3.dev.atix",
236
+ "id": 10,
237
+ "name": "great-web-app-web-2",
238
+ "powerStatusUrl": "/api/v2/hosts/great-web-app-web-2.deploy3.dev.atix/power",
239
+ "progress_report": Array [
240
+ Object {
241
+ "created": 1615542738.3446305,
242
+ "id": "Set up compute instance great-web-app-web-2.deploy3.dev.atix",
243
+ "name": "Set up compute instance great-web-app-web-2.deploy3.dev.atix",
244
+ "priority": 3,
245
+ "status": "completed",
246
+ "timestamp": "2021-03-12T09:52:19.221Z",
247
+ },
248
+ Object {
249
+ "created": 1615542738.3449144,
250
+ "id": "Query instance details for great-web-app-web-2.deploy3.dev.atix",
251
+ "name": "Query instance details for great-web-app-web-2.deploy3.dev.atix",
252
+ "priority": 5,
253
+ "status": "completed",
254
+ "timestamp": "2021-03-12T09:52:19.419Z",
255
+ },
256
+ Object {
257
+ "created": 1615542738.1321318,
258
+ "id": "dhcp_create_192.168.171.105",
259
+ "name": "Create DHCP Settings for great-web-app-web-2.deploy3.dev.atix",
260
+ "priority": 10,
261
+ "status": "completed",
262
+ "timestamp": "2021-03-12T09:52:19.668Z",
263
+ },
264
+ Object {
265
+ "created": 1615542738.1576574,
266
+ "id": "Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
267
+ "name": "Create IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
268
+ "priority": 10,
269
+ "status": "completed",
270
+ "timestamp": "2021-03-12T09:52:19.749Z",
271
+ },
272
+ Object {
273
+ "created": 1615542738.1582346,
274
+ "id": "Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
275
+ "name": "Create Reverse IPv4 DNS record for great-web-app-web-2.deploy3.dev.atix",
276
+ "priority": 10,
277
+ "status": "completed",
278
+ "timestamp": "2021-03-12T09:52:19.859Z",
279
+ },
280
+ Object {
281
+ "created": 1615542738.1885784,
282
+ "id": "Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix",
283
+ "name": "Deploy TFTP PXELinux config for great-web-app-web-2.deploy3.dev.atix",
284
+ "priority": 20,
285
+ "status": "completed",
286
+ "timestamp": "2021-03-12T09:52:20.221Z",
287
+ },
288
+ Object {
289
+ "created": 1615542738.1888642,
290
+ "id": "Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix",
291
+ "name": "Deploy TFTP PXEGrub2 config for great-web-app-web-2.deploy3.dev.atix",
292
+ "priority": 20,
293
+ "status": "completed",
294
+ "timestamp": "2021-03-12T09:52:20.604Z",
295
+ },
296
+ Object {
297
+ "created": 1615542738.1890883,
298
+ "id": "Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix",
299
+ "name": "Deploy TFTP PXEGrub config for great-web-app-web-2.deploy3.dev.atix",
300
+ "priority": 20,
301
+ "status": "completed",
302
+ "timestamp": "2021-03-12T09:52:20.636Z",
303
+ },
304
+ Object {
305
+ "created": 1615542738.1892834,
306
+ "id": "Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix",
307
+ "name": "Deploy TFTP iPXE config for great-web-app-web-2.deploy3.dev.atix",
308
+ "priority": 20,
309
+ "status": "completed",
310
+ "timestamp": "2021-03-12T09:52:20.895Z",
311
+ },
312
+ Object {
313
+ "created": 1615542738.1898031,
314
+ "id": "Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix",
315
+ "name": "Fetch TFTP boot files for great-web-app-web-2.deploy3.dev.atix",
316
+ "priority": 25,
317
+ "status": "completed",
318
+ "timestamp": "2021-03-12T09:52:20.992Z",
319
+ },
320
+ Object {
321
+ "created": 1615542738.3453662,
322
+ "id": "Power up compute instance great-web-app-web-2.deploy3.dev.atix",
323
+ "name": "Power up compute instance great-web-app-web-2.deploy3.dev.atix",
324
+ "priority": 1000,
325
+ "status": "completed",
326
+ "timestamp": "2021-03-12T09:52:21.864Z",
327
+ },
328
+ Object {
329
+ "created": 1615542738.34748,
330
+ "id": "Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix",
331
+ "name": "Cleanup PuppetCA certificates for great-web-app-web-2.deploy3.dev.atix",
332
+ "priority": 51,
333
+ "status": "completed",
334
+ "timestamp": "2021-03-12T09:52:22.316Z",
335
+ },
336
+ Object {
337
+ "created": 1615542738.3476808,
338
+ "id": "Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix",
339
+ "name": "Enable PuppetCA autosigning for great-web-app-web-2.deploy3.dev.atix",
340
+ "priority": 55,
341
+ "status": "completed",
342
+ "timestamp": "2021-03-12T09:52:22.368Z",
343
+ },
344
+ ],
345
+ },
346
+ ]
347
+ `;
@@ -0,0 +1,24 @@
1
+ import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
+
3
+ import ReportViewer from '../ReportViewer';
4
+
5
+ const noop = () => {};
6
+
7
+ const data = [
8
+ { name: 'report 1', status: 'done' },
9
+ { name: 'report 2', status: 'pending' }
10
+ ];
11
+
12
+ const fixtures = {
13
+ 'should render the report viewer': {
14
+ hidden: false,
15
+ report: data,
16
+ },
17
+ 'should render the hidden report viewer': {
18
+ hidden: true,
19
+ report: data,
20
+ },
21
+ };
22
+
23
+ describe('ReportViewer', () =>
24
+ testComponentSnapshotsWithFixtures(ReportViewer, fixtures));
@@ -0,0 +1,24 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ReportViewer should render the hidden report viewer 1`] = `""`;
4
+
5
+ exports[`ReportViewer should render the report viewer 1`] = `
6
+ Array [
7
+ <div
8
+ className="report_task"
9
+ key="report_task_0"
10
+ >
11
+ report 1
12
+ --
13
+ done
14
+ </div>,
15
+ <div
16
+ className="report_task"
17
+ key="report_task_1"
18
+ >
19
+ report 2
20
+ --
21
+ pending
22
+ </div>,
23
+ ]
24
+ `;
@@ -8,11 +8,19 @@ import * as ApplicationInstanceReportActions from './ApplicationInstanceReportAc
8
8
  import {
9
9
  selectHosts,
10
10
  selectActiveHostId,
11
+ selectDeploymentState,
12
+ selectInitialConfigureState,
13
+ selectInitialConfigureJobUrl,
14
+ selectShowInitialConfigureJob,
11
15
  } from './ApplicationInstanceReportSelectors';
12
16
 
13
17
  const mapStateToProps = state => ({
14
18
  hosts: selectHosts(state),
15
19
  activeHostId: selectActiveHostId(state),
20
+ deploymentState: selectDeploymentState(state),
21
+ initialConfigureState: selectInitialConfigureState(state),
22
+ initialConfigureJobUrl: selectInitialConfigureJobUrl(state),
23
+ showInitialConfigureJob: selectShowInitialConfigureJob(state),
16
24
  });
17
25
 
18
26
  const mapDispatchToProps = dispatch =>
@@ -22,4 +30,3 @@ export default connect(
22
30
  mapStateToProps,
23
31
  mapDispatchToProps
24
32
  )(ApplicationInstanceReport);
25
-
@@ -0,0 +1,104 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { orderBy } from 'lodash';
4
+ import ServiceSelector from './components/ServiceSelector';
5
+ import { arrayToObject } from '../../helper';
6
+
7
+ import {
8
+ cloneDeep,
9
+ } from 'lodash';
10
+
11
+ import {
12
+ Icon,
13
+ Button,
14
+ DualListControlled,
15
+ } from 'patternfly-react';
16
+
17
+ class ExistingHostSelection extends React.Component {
18
+
19
+ constructor(props) {
20
+ super(props);
21
+ }
22
+
23
+ componentDidMount() {
24
+ const {
25
+ location,
26
+ organization,
27
+ services,
28
+ initExistingHostSelection,
29
+ allHosts,
30
+ } = this.props;
31
+
32
+ initExistingHostSelection(allHosts);
33
+ }
34
+
35
+ render() {
36
+ const {
37
+ location,
38
+ organization,
39
+ services,
40
+ serviceId,
41
+ availableHosts,
42
+ alreadyUsedHosts,
43
+ loadHostsOfHostgroup,
44
+ hostSelectionChanged,
45
+ } = this.props;
46
+
47
+ const serviceList = arrayToObject(services, "id", "name");
48
+ const load_hostgroup_url = "/api/v2/hostgroups/__hostgroup_id__/hosts"
49
+
50
+ return(
51
+ <div>
52
+ <div className="row">
53
+ <ServiceSelector
54
+ label="Service"
55
+ hidden={ false }
56
+ selectValue={ this.props.serviceId ? this.props.serviceId.toString() : '0'}
57
+ options={ serviceList }
58
+ onChange={ loadHostsOfHostgroup }
59
+ additionalData={{ url: load_hostgroup_url, services: services }} />
60
+ </div>
61
+ <div className="row">
62
+ <label className="col-md-2 control-label">{ __("Hosts") }</label>
63
+ {this.props.serviceId != undefined ? (
64
+ <div className="col-md-6">
65
+ <DualListControlled
66
+ onChange={ hostSelectionChanged }
67
+ left={{
68
+ items: cloneDeep(availableHosts),
69
+ }}
70
+ right={{
71
+ items: cloneDeep(alreadyUsedHosts),
72
+ }}
73
+ allowHiddenInputs={false}
74
+ />
75
+ </div>) : (<span>{ __("Please select service first.") }</span>)}
76
+ </div>
77
+ </div>
78
+ );
79
+ }
80
+ }
81
+
82
+ ExistingHostSelection.defaultProps = {
83
+ serviceId: undefined,
84
+ hostsInHostgroup: {},
85
+ availableHosts: [],
86
+ alreadyUsedHosts: [],
87
+ selectedHosts: [],
88
+ };
89
+
90
+ ExistingHostSelection.propTypes = {
91
+ location: PropTypes.string.isRequired,
92
+ organization: PropTypes.string.isRequired,
93
+ services: PropTypes.array.isRequired,
94
+ initExistingHostSelection: PropTypes.func,
95
+ serviceId: PropTypes.number,
96
+ hostsInHostgroup: PropTypes.object,
97
+ availableHosts: PropTypes.array,
98
+ alreadyUsedHosts: PropTypes.array,
99
+ selectedHosts: PropTypes.array,
100
+ loadHostsOfHostgroup: PropTypes.func,
101
+ hostSelectionChanged: PropTypes.func,
102
+ };
103
+
104
+ export default ExistingHostSelection;
@@ -0,0 +1,15 @@
1
+ @import '~@theforeman/vendor/scss/variables';
2
+
3
+ .add_existing_hosts_modal {
4
+ margin-top: 0;
5
+ margin-bottom: 0;
6
+ height: 100%;
7
+ width: 80%;
8
+ max-width: none !important;
9
+ }
10
+
11
+ .row {
12
+ margin-left: 0;
13
+ margin-right: 0;
14
+ margin-bottom: 20px;
15
+ }
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import * as sort from 'sortabular';
3
+ import { translate as __ } from 'foremanReact/common/I18n';
4
+
5
+ import api from 'foremanReact/API';
6
+
7
+ import {
8
+ propsToSnakeCase,
9
+ propsToCamelCase,
10
+ } from 'foremanReact/common/helpers';
11
+
12
+ import {
13
+ EXISTING_HOST_SELECTION_INIT,
14
+ EXISTING_HOST_SELECTION_LOAD_HOSTS_SUCCESS,
15
+ EXISTING_HOST_SELECTION_LOAD_HOSTS_FAILURE,
16
+ EXISTING_HOST_SELECTION_SELECTION_CHANGED,
17
+ } from './ExistingHostSelectionConstants';
18
+
19
+ export const initExistingHostSelection = (
20
+ allHosts,
21
+ ) => dispatch => {
22
+ const initialState = {};
23
+
24
+ initialState.alreadyUsedHosts = undefined;
25
+ initialState.serviceId = undefined;
26
+ initialState.selectedHosts = [];
27
+ initialState.hostsInHostgroup = {};
28
+ initialState.allHosts = allHosts;
29
+
30
+ dispatch({
31
+ type: EXISTING_HOST_SELECTION_INIT,
32
+ payload: initialState,
33
+ });
34
+ }
35
+
36
+ export const loadHostsOfHostgroup = (
37
+ serviceId,
38
+ additionalData
39
+ ) => dispatch => {
40
+
41
+ const selService = additionalData.services.filter(s => (s.id == serviceId))[0];
42
+ const realUrl = additionalData.url.replace("__hostgroup_id__", selService.hostgroup);
43
+
44
+ return api
45
+ .get(realUrl, {}, {})
46
+ .then(({ data }) =>
47
+ dispatch({
48
+ type: EXISTING_HOST_SELECTION_LOAD_HOSTS_SUCCESS,
49
+ payload: {
50
+ hosts: data.results,
51
+ serviceId: parseInt(serviceId),
52
+ }
53
+ })
54
+ )
55
+ .catch(error => dispatch(errorHandler(EXISTING_HOST_SELECTION_LOAD_HOSTS_FAILURE, error)));
56
+ };
57
+
58
+ export const hostSelectionChanged = ({ left, right }) => ({
59
+ type: EXISTING_HOST_SELECTION_SELECTION_CHANGED,
60
+ payload: {
61
+ selection: right.items,
62
+ }
63
+ });
64
+
65
+ const errorHandler = (msg, err) => {
66
+ const error = {
67
+ errorMsg: __('Failed to fetch data from server.'),
68
+ statusText: err,
69
+ };
70
+ return { type: msg, payload: { error } };
71
+ };
@@ -0,0 +1,4 @@
1
+ export const EXISTING_HOST_SELECTION_INIT = 'EXISTING_HOST_SELECTION_INIT';
2
+ export const EXISTING_HOST_SELECTION_LOAD_HOSTS_SUCCESS = 'EXISTING_HOST_SELECTION_LOAD_HOSTS_SUCCESS';
3
+ export const EXISTING_HOST_SELECTION_LOAD_HOSTS_FAILURE = 'EXISTING_HOST_SELECTION_LOAD_HOSTS_FAILURE';
4
+ export const EXISTING_HOST_SELECTION_SELECTION_CHANGED = 'EXISTING_HOST_SELECTION_SELECTION_CHANGED';