foreman_acd 0.2.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +107 -56
  3. data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +199 -0
  4. data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +72 -0
  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 +62 -0
  7. data/app/controllers/foreman_acd/app_definitions_controller.rb +19 -10
  8. data/app/controllers/foreman_acd/app_instances_controller.rb +111 -137
  9. data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +23 -0
  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 +62 -0
  13. data/app/controllers/ui_acd_controller.rb +20 -3
  14. data/app/lib/actions/foreman_acd/deploy_all_hosts.rb +47 -0
  15. data/app/lib/actions/foreman_acd/run_configurator.rb +44 -0
  16. data/app/models/concerns/foreman_acd/host_managed_extensions.rb +51 -0
  17. data/app/models/foreman_acd/acd_provider.rb +36 -0
  18. data/app/models/foreman_acd/ansible_playbook.rb +68 -0
  19. data/app/models/foreman_acd/app_definition.rb +25 -0
  20. data/app/models/foreman_acd/app_instance.rb +42 -0
  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/acd_proxy_proxy_selector.rb +17 -0
  24. data/app/services/foreman_acd/app_configurator.rb +98 -0
  25. data/app/services/foreman_acd/app_deployer.rb +157 -0
  26. data/app/services/foreman_acd/inventory_creator.rb +68 -0
  27. data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +64 -0
  28. data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +11 -0
  29. data/app/views/foreman_acd/ansible_playbooks/index.html.erb +30 -0
  30. data/app/views/foreman_acd/ansible_playbooks/new.html.erb +3 -0
  31. data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +5 -0
  32. data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +5 -0
  33. data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +9 -0
  34. data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +5 -0
  35. data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +5 -0
  36. data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +9 -0
  37. data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +5 -0
  38. data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +5 -0
  39. data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +5 -0
  40. data/app/views/foreman_acd/app_definitions/_form.html.erb +34 -12
  41. data/app/views/foreman_acd/app_definitions/edit.html.erb +10 -0
  42. data/app/views/foreman_acd/app_definitions/index.html.erb +4 -4
  43. data/app/views/foreman_acd/app_instances/_form.html.erb +11 -9
  44. data/app/views/foreman_acd/app_instances/edit.html.erb +10 -0
  45. data/app/views/foreman_acd/app_instances/index.html.erb +89 -10
  46. data/app/views/foreman_acd/app_instances/report.html.erb +6 -3
  47. data/app/views/templates/job/run_acd_ansible_playbook.erb +62 -0
  48. data/app/views/ui_acd/ansible_data.json.rabl +6 -0
  49. data/app/views/ui_acd/app.json.rabl +6 -2
  50. data/app/views/ui_acd/app_definition.json.rabl +1 -1
  51. data/app/views/ui_acd/{fdata.json.rabl → foreman_data.json.rabl} +1 -1
  52. data/config/routes.rb +32 -2
  53. data/db/migrate/20200916091018_create_ansible_playbooks.rb +20 -0
  54. data/db/migrate/20200917120220_add_ansible_playbook_id.rb +14 -0
  55. data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +8 -0
  56. data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +8 -0
  57. data/db/migrate/20210112111548_add_organization_to_app_instance.rb +22 -0
  58. data/db/migrate/20210112113853_add_location_to_app_instance.rb +8 -0
  59. data/db/migrate/20210202141658_create_foreman_hosts.rb +24 -0
  60. data/db/migrate/20210204111306_remove_hosts_from_app_instances.rb +8 -0
  61. data/db/migrate/20210209091014_rename_acd_tables.rb +16 -0
  62. data/db/migrate/20210216083522_add_last_progress_report.rb +8 -0
  63. data/db/migrate/20210216091529_add_last_deploy_task.rb +8 -0
  64. data/db/migrate/20210316151145_add_git_commit_to_ansible_playbooks.rb +8 -0
  65. data/db/migrate/20210503122809_add_git_url_to_ansible_playbooks.rb +8 -0
  66. data/db/seeds.d/62_acd_proxy_feature.rb +4 -0
  67. data/db/seeds.d/75-job_templates.rb +13 -0
  68. data/lib/foreman_acd.rb +12 -0
  69. data/lib/foreman_acd/engine.rb +43 -3
  70. data/lib/foreman_acd/plugin.rb +88 -22
  71. data/lib/foreman_acd/version.rb +1 -1
  72. data/lib/tasks/foreman_acd_tasks.rake +0 -12
  73. data/locale/en/foreman_acd.edit.po +326 -0
  74. data/locale/en/foreman_acd.po +232 -2
  75. data/locale/en/foreman_acd.po.time_stamp +0 -0
  76. data/locale/foreman_acd.pot +343 -8
  77. data/package.json +9 -9
  78. data/test/controllers/ansible_playbooks_controller_test.rb +27 -0
  79. data/test/controllers/app_instances_controller_test.rb +8 -3
  80. data/test/controllers/ui_acd_controller_test.rb +22 -6
  81. data/test/factories/foreman_acd_factories.rb +18 -4
  82. data/test/models/acd_provider_test.rb +37 -0
  83. data/test/models/ansible_playbook_test.rb +11 -0
  84. data/test/models/app_definition_test.rb +1 -1
  85. data/test/models/app_instance_test.rb +2 -0
  86. data/test/models/concerns/host_extensions_test.rb +26 -0
  87. data/test/models/foreman_host_test.rb +12 -0
  88. data/webpack/__mocks__/foremanReact/API.js +2 -0
  89. data/webpack/__mocks__/foremanReact/common/I18n.js +3 -0
  90. data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
  91. data/webpack/__mocks__/foremanReact/components/ForemanModal.js +7 -0
  92. data/webpack/__mocks__/foremanReact/components/common/forms/CommonForm.js +2 -0
  93. data/webpack/__mocks__/foremanReact/components/common/forms/TextInput.js +2 -0
  94. data/webpack/__mocks__/foremanReact/components/hosts/powerStatus.js +1 -0
  95. data/webpack/__snapshots__/helper.test.js.snap +14 -0
  96. data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +159 -29
  97. data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +106 -14
  98. data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +8 -2
  99. data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +26 -0
  100. data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +143 -21
  101. data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +3 -0
  102. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionConfData_1.fixtures.js +288 -0
  103. data/webpack/components/ApplicationDefinition/__fixtures__/applicationDefinitionReducer.fixtures.js +79 -0
  104. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinition.test.js +25 -0
  105. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionReducer.test.js +119 -0
  106. data/webpack/components/ApplicationDefinition/__tests__/ApplicationDefinitionSelectors.test.js +41 -0
  107. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinition.test.js.snap +200 -0
  108. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionReducer.test.js.snap +3033 -0
  109. data/webpack/components/ApplicationDefinition/__tests__/__snapshots__/ApplicationDefinitionSelectors.test.js.snap +299 -0
  110. data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +50 -0
  111. data/webpack/components/ApplicationDefinition/components/__tests__/AnsiblePlaybookSelector.test.js +41 -0
  112. data/webpack/components/ApplicationDefinition/components/__tests__/__snapshots__/AnsiblePlaybookSelector.test.js.snap +121 -0
  113. data/webpack/components/ApplicationDefinition/index.js +6 -0
  114. data/webpack/components/ApplicationInstance/ApplicationInstance.js +151 -44
  115. data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +47 -10
  116. data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +5 -2
  117. data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +114 -28
  118. data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +3 -1
  119. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceConfData_1.fixtures.js +263 -0
  120. data/webpack/components/ApplicationInstance/__fixtures__/applicationInstanceReducer.fixtures.js +78 -0
  121. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstance.test.js +23 -0
  122. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceReducer.test.js +119 -0
  123. data/webpack/components/ApplicationInstance/__tests__/ApplicationInstanceSelectors.test.js +44 -0
  124. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstance.test.js.snap +209 -0
  125. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceReducer.test.js.snap +2719 -0
  126. data/webpack/components/ApplicationInstance/__tests__/__snapshots__/ApplicationInstanceSelectors.test.js.snap +276 -0
  127. data/webpack/components/ApplicationInstance/components/Service.js +1 -1
  128. data/webpack/components/ApplicationInstance/index.js +4 -0
  129. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.js +53 -60
  130. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReport.scss +17 -0
  131. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportActions.js +7 -51
  132. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportConstants.js +2 -4
  133. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportReducer.js +4 -18
  134. data/webpack/components/ApplicationInstanceReport/ApplicationInstanceReportSelectors.js +0 -1
  135. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportData_1.fixtures.js +349 -0
  136. data/webpack/components/ApplicationInstanceReport/__fixtures__/applicationInstanceReportReducer.fixtures.js +20 -0
  137. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReport.test.js +47 -0
  138. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportReducer.test.js +41 -0
  139. data/webpack/components/ApplicationInstanceReport/__tests__/ApplicationInstanceReportSelectors.test.js +26 -0
  140. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReport.test.js.snap +130 -0
  141. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportReducer.test.js.snap +718 -0
  142. data/webpack/components/ApplicationInstanceReport/__tests__/__snapshots__/ApplicationInstanceReportSelectors.test.js.snap +347 -0
  143. data/webpack/components/ApplicationInstanceReport/components/ReportViewer.js +1 -1
  144. data/webpack/components/ApplicationInstanceReport/components/__tests__/ReportViewer.test.js +24 -0
  145. data/webpack/components/ApplicationInstanceReport/components/__tests__/__snapshots__/ReportViewer.test.js.snap +24 -0
  146. data/webpack/components/ApplicationInstanceReport/index.js +0 -2
  147. data/webpack/components/ParameterSelection/ParameterSelection.js +85 -50
  148. data/webpack/components/ParameterSelection/ParameterSelectionActions.js +68 -62
  149. data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +6 -3
  150. data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +0 -32
  151. data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +47 -35
  152. data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -2
  153. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionData_1.fixtures.js +116 -84
  154. data/webpack/components/ParameterSelection/__fixtures__/parameterSelectionReducer.fixtures.js +10 -4
  155. data/webpack/components/ParameterSelection/__tests__/ParameterSelection.test.js +36 -46
  156. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionReducer.test.js +31 -25
  157. data/webpack/components/ParameterSelection/__tests__/ParameterSelectionSelectors.test.js +6 -6
  158. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelection.test.js.snap +2 -126
  159. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionReducer.test.js.snap +1483 -872
  160. data/webpack/components/ParameterSelection/__tests__/__snapshots__/ParameterSelectionSelectors.test.js.snap +117 -79
  161. data/webpack/components/ParameterSelection/index.js +4 -4
  162. data/webpack/components/SyncGitRepo/SyncGitRepo.js +210 -0
  163. data/webpack/components/SyncGitRepo/SyncGitRepo.scss +1 -0
  164. data/webpack/components/SyncGitRepo/SyncGitRepoActions.js +124 -0
  165. data/webpack/components/SyncGitRepo/SyncGitRepoConstants.js +9 -0
  166. data/webpack/components/SyncGitRepo/SyncGitRepoReducer.js +80 -0
  167. data/webpack/components/SyncGitRepo/SyncGitRepoSelectors.js +6 -0
  168. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoConfData_1.fixtures.js +7 -0
  169. data/webpack/components/SyncGitRepo/__fixtures__/syncGitRepoReducer.fixtures.js +44 -0
  170. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepo.test.js +27 -0
  171. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoReducer.test.js +95 -0
  172. data/webpack/components/SyncGitRepo/__tests__/SyncGitRepoSelectors.test.js +32 -0
  173. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepo.test.js.snap +30 -0
  174. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoReducer.test.js.snap +137 -0
  175. data/webpack/components/SyncGitRepo/__tests__/__snapshots__/SyncGitRepoSelectors.test.js.snap +13 -0
  176. data/webpack/components/SyncGitRepo/components/FormTextInput.js +42 -0
  177. data/webpack/components/SyncGitRepo/components/ScmTypeSelector.js +46 -0
  178. data/webpack/components/SyncGitRepo/index.js +28 -0
  179. data/webpack/components/common/DeleteTableEntry.js +3 -3
  180. data/webpack/components/common/EditTableEntry.js +50 -0
  181. data/webpack/components/common/ExtTextInput.js +43 -0
  182. data/webpack/components/common/LockTableEntry.js +60 -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 +2 -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 +15 -1
  189. data/webpack/helper.test.js +37 -0
  190. data/webpack/index.js +2 -0
  191. data/webpack/reducer.js +18 -11
  192. metadata +184 -10
  193. data/app/views/foreman_acd/app_instances/deploy.html.erb +0 -19
  194. data/webpack/components/common/__tests__/__snapshots__/AddParameter.test.js.snap +0 -35
  195. data/webpack/components/common/__tests__/__snapshots__/DeleteParameter.test.js.snap +0 -41
@@ -0,0 +1,2719 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`ApplicationInstanceReducer should activate edit host 1`] = `
4
+ Object {
5
+ "ansibleVarsAll": Array [
6
+ Object {
7
+ "id": 0,
8
+ "name": "repository",
9
+ "value": "https://github.com/bennojoy/mywebapp.git",
10
+ },
11
+ ],
12
+ "appDefinition": Object {
13
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
14
+ "created_at": "2021-03-11 12:51:34 +0100",
15
+ "description": "",
16
+ "id": 1,
17
+ "location_ids": Array [
18
+ 2,
19
+ ],
20
+ "name": "LAMP",
21
+ "organization_ids": Array [
22
+ 1,
23
+ ],
24
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
25
+ "updated_at": "2021-03-13 00:06:12 +0100",
26
+ },
27
+ "columns": Array [
28
+ Object {
29
+ "cell": Object {
30
+ "formatters": Array [
31
+ null,
32
+ ],
33
+ },
34
+ "header": Object {
35
+ "formatters": Array [
36
+ null,
37
+ ],
38
+ "label": "Hostname",
39
+ "props": Object {
40
+ "index": 0,
41
+ "style": Object {
42
+ "width": "30%",
43
+ },
44
+ },
45
+ },
46
+ "property": "hostname",
47
+ },
48
+ Object {
49
+ "cell": Object {
50
+ "formatters": Array [
51
+ null,
52
+ ],
53
+ },
54
+ "header": Object {
55
+ "formatters": Array [
56
+ null,
57
+ ],
58
+ "label": "Description",
59
+ "props": Object {
60
+ "index": 1,
61
+ "style": Object {
62
+ "width": "30%",
63
+ },
64
+ },
65
+ },
66
+ "property": "description",
67
+ },
68
+ Object {
69
+ "cell": Object {
70
+ "formatters": Array [
71
+ null,
72
+ ],
73
+ },
74
+ "header": Object {
75
+ "formatters": Array [
76
+ null,
77
+ ],
78
+ "label": "Service",
79
+ "props": Object {
80
+ "index": 2,
81
+ "style": Object {
82
+ "width": "20%",
83
+ },
84
+ },
85
+ },
86
+ "property": "service",
87
+ },
88
+ Object {
89
+ "cell": Object {
90
+ "formatters": Array [
91
+ null,
92
+ ],
93
+ },
94
+ "header": Object {
95
+ "formatters": Array [
96
+ null,
97
+ ],
98
+ "label": "Actions",
99
+ "props": Object {
100
+ "index": 4,
101
+ "style": Object {
102
+ "width": "20%",
103
+ },
104
+ },
105
+ },
106
+ "property": "actions",
107
+ },
108
+ ],
109
+ "editMode": true,
110
+ "error": Object {
111
+ "errorMsg": "",
112
+ "status": "",
113
+ "statusText": "",
114
+ },
115
+ "hosts": Array [
116
+ Object {
117
+ "ansibleParameters": Array [
118
+ Object {
119
+ "id": 0,
120
+ "name": "mysqlservice",
121
+ "value": "mysqld",
122
+ },
123
+ Object {
124
+ "id": 1,
125
+ "name": "mysql_port",
126
+ "value": "3306",
127
+ },
128
+ Object {
129
+ "id": 2,
130
+ "name": "dbuser",
131
+ "value": "webapp",
132
+ },
133
+ Object {
134
+ "id": 3,
135
+ "name": "dbname",
136
+ "value": "ANSAP01",
137
+ },
138
+ Object {
139
+ "id": 4,
140
+ "name": "upassword",
141
+ "value": "Bond@007",
142
+ },
143
+ Object {
144
+ "id": 5,
145
+ "name": "masterpassword",
146
+ "value": "MySQL@007",
147
+ },
148
+ ],
149
+ "description": "",
150
+ "foremanParameters": Array [],
151
+ "hostname": "great-web-app-db-1",
152
+ "id": 4,
153
+ "service": "2",
154
+ },
155
+ Object {
156
+ "ansibleParameters": Array [
157
+ Object {
158
+ "id": 0,
159
+ "name": "dummy_var",
160
+ "value": "0",
161
+ },
162
+ ],
163
+ "description": "",
164
+ "foremanParameters": Array [],
165
+ "hostname": "great-web-app-web-1",
166
+ "id": 1,
167
+ "service": "1",
168
+ },
169
+ Object {
170
+ "ansibleParameters": Array [
171
+ Object {
172
+ "id": 0,
173
+ "name": "dummy_var",
174
+ "value": "0",
175
+ },
176
+ ],
177
+ "backup": Object {
178
+ "ansibleParameters": Array [
179
+ Object {
180
+ "id": 0,
181
+ "name": "dummy_var",
182
+ "value": "0",
183
+ },
184
+ ],
185
+ "description": "",
186
+ "foremanParameters": Array [],
187
+ "hostname": "great-web-app-web-2",
188
+ "id": 2,
189
+ "service": "1",
190
+ },
191
+ "description": "",
192
+ "foremanParameters": Array [],
193
+ "hostname": "great-web-app-web-2",
194
+ "id": 2,
195
+ "service": "1",
196
+ },
197
+ ],
198
+ "loading": false,
199
+ "name": false,
200
+ "services": Array [
201
+ Object {
202
+ "ansibleGroup": "webservers",
203
+ "ansibleParameters": Array [
204
+ Object {
205
+ "id": 0,
206
+ "name": "dummy_var",
207
+ "value": "0",
208
+ },
209
+ ],
210
+ "currentCount": 2,
211
+ "description": "",
212
+ "foremanParameters": Array [
213
+ Object {
214
+ "description": "",
215
+ "id": 1,
216
+ "locked": false,
217
+ "name": "CP",
218
+ "type": "computeprofile",
219
+ "value": "1",
220
+ },
221
+ Object {
222
+ "description": "",
223
+ "id": 2,
224
+ "locked": true,
225
+ "name": "LE",
226
+ "type": "lifecycleenv",
227
+ "value": "1",
228
+ },
229
+ ],
230
+ "hostgroup": "1",
231
+ "id": 1,
232
+ "maxCount": "",
233
+ "minCount": "2",
234
+ "name": "web",
235
+ },
236
+ Object {
237
+ "ansibleGroup": "dbservers",
238
+ "ansibleParameters": Array [
239
+ Object {
240
+ "id": 0,
241
+ "name": "mysqlservice",
242
+ "value": "mysqld",
243
+ },
244
+ Object {
245
+ "id": 1,
246
+ "locked": true,
247
+ "name": "mysql_port",
248
+ "value": "3306",
249
+ },
250
+ Object {
251
+ "id": 2,
252
+ "name": "dbuser",
253
+ "value": "webapp",
254
+ },
255
+ Object {
256
+ "id": 3,
257
+ "name": "dbname",
258
+ "value": "ANSAP01",
259
+ },
260
+ Object {
261
+ "id": 4,
262
+ "name": "upassword",
263
+ "value": "Bond@007",
264
+ },
265
+ Object {
266
+ "id": 5,
267
+ "name": "masterpassword",
268
+ "value": "MySQL@007",
269
+ },
270
+ ],
271
+ "currentCount": 1,
272
+ "description": "",
273
+ "foremanParameters": Array [],
274
+ "hostgroup": "1",
275
+ "id": 2,
276
+ "maxCount": "",
277
+ "minCount": "1",
278
+ "name": "db",
279
+ },
280
+ ],
281
+ }
282
+ `;
283
+
284
+ exports[`ApplicationInstanceReducer should add a host 1`] = `
285
+ Object {
286
+ "ansibleVarsAll": Array [
287
+ Object {
288
+ "id": 0,
289
+ "name": "repository",
290
+ "value": "https://github.com/bennojoy/mywebapp.git",
291
+ },
292
+ ],
293
+ "appDefinition": Object {
294
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
295
+ "created_at": "2021-03-11 12:51:34 +0100",
296
+ "description": "",
297
+ "id": 1,
298
+ "location_ids": Array [
299
+ 2,
300
+ ],
301
+ "name": "LAMP",
302
+ "organization_ids": Array [
303
+ 1,
304
+ ],
305
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
306
+ "updated_at": "2021-03-13 00:06:12 +0100",
307
+ },
308
+ "columns": Array [
309
+ Object {
310
+ "cell": Object {
311
+ "formatters": Array [
312
+ null,
313
+ ],
314
+ },
315
+ "header": Object {
316
+ "formatters": Array [
317
+ null,
318
+ ],
319
+ "label": "Hostname",
320
+ "props": Object {
321
+ "index": 0,
322
+ "style": Object {
323
+ "width": "30%",
324
+ },
325
+ },
326
+ },
327
+ "property": "hostname",
328
+ },
329
+ Object {
330
+ "cell": Object {
331
+ "formatters": Array [
332
+ null,
333
+ ],
334
+ },
335
+ "header": Object {
336
+ "formatters": Array [
337
+ null,
338
+ ],
339
+ "label": "Description",
340
+ "props": Object {
341
+ "index": 1,
342
+ "style": Object {
343
+ "width": "30%",
344
+ },
345
+ },
346
+ },
347
+ "property": "description",
348
+ },
349
+ Object {
350
+ "cell": Object {
351
+ "formatters": Array [
352
+ null,
353
+ ],
354
+ },
355
+ "header": Object {
356
+ "formatters": Array [
357
+ null,
358
+ ],
359
+ "label": "Service",
360
+ "props": Object {
361
+ "index": 2,
362
+ "style": Object {
363
+ "width": "20%",
364
+ },
365
+ },
366
+ },
367
+ "property": "service",
368
+ },
369
+ Object {
370
+ "cell": Object {
371
+ "formatters": Array [
372
+ null,
373
+ ],
374
+ },
375
+ "header": Object {
376
+ "formatters": Array [
377
+ null,
378
+ ],
379
+ "label": "Actions",
380
+ "props": Object {
381
+ "index": 4,
382
+ "style": Object {
383
+ "width": "20%",
384
+ },
385
+ },
386
+ },
387
+ "property": "actions",
388
+ },
389
+ ],
390
+ "editMode": true,
391
+ "error": Object {
392
+ "errorMsg": "",
393
+ "status": "",
394
+ "statusText": "",
395
+ },
396
+ "hosts": Array [
397
+ Object {
398
+ "ansibleParameters": Array [
399
+ Object {
400
+ "id": 0,
401
+ "name": "mysqlservice",
402
+ "value": "mysqld",
403
+ },
404
+ Object {
405
+ "id": 1,
406
+ "name": "mysql_port",
407
+ "value": "3306",
408
+ },
409
+ Object {
410
+ "id": 2,
411
+ "name": "dbuser",
412
+ "value": "webapp",
413
+ },
414
+ Object {
415
+ "id": 3,
416
+ "name": "dbname",
417
+ "value": "ANSAP01",
418
+ },
419
+ Object {
420
+ "id": 4,
421
+ "name": "upassword",
422
+ "value": "Bond@007",
423
+ },
424
+ Object {
425
+ "id": 5,
426
+ "name": "masterpassword",
427
+ "value": "MySQL@007",
428
+ },
429
+ ],
430
+ "description": "",
431
+ "foremanParameters": Array [],
432
+ "hostname": "great-web-app-db-1",
433
+ "id": 4,
434
+ "service": "2",
435
+ },
436
+ Object {
437
+ "ansibleParameters": Array [
438
+ Object {
439
+ "id": 0,
440
+ "name": "dummy_var",
441
+ "value": "0",
442
+ },
443
+ ],
444
+ "description": "",
445
+ "foremanParameters": Array [],
446
+ "hostname": "great-web-app-web-1",
447
+ "id": 1,
448
+ "service": "1",
449
+ },
450
+ Object {
451
+ "ansibleParameters": Array [
452
+ Object {
453
+ "id": 0,
454
+ "name": "dummy_var",
455
+ "value": "0",
456
+ },
457
+ ],
458
+ "description": "",
459
+ "foremanParameters": Array [],
460
+ "hostname": "great-web-app-web-2",
461
+ "id": 2,
462
+ "service": "1",
463
+ },
464
+ Object {
465
+ "ansibleParameters": Array [],
466
+ "backup": Object {
467
+ "ansibleParameters": Array [],
468
+ "description": "",
469
+ "foremanParameters": Array [],
470
+ "hostname": "",
471
+ "id": 5,
472
+ "newEntry": true,
473
+ "service": "",
474
+ },
475
+ "description": "",
476
+ "foremanParameters": Array [],
477
+ "hostname": "",
478
+ "id": 5,
479
+ "newEntry": true,
480
+ "service": "",
481
+ },
482
+ ],
483
+ "loading": false,
484
+ "name": false,
485
+ "services": Array [
486
+ Object {
487
+ "ansibleGroup": "webservers",
488
+ "ansibleParameters": Array [
489
+ Object {
490
+ "id": 0,
491
+ "name": "dummy_var",
492
+ "value": "0",
493
+ },
494
+ ],
495
+ "currentCount": 2,
496
+ "description": "",
497
+ "foremanParameters": Array [
498
+ Object {
499
+ "description": "",
500
+ "id": 1,
501
+ "locked": false,
502
+ "name": "CP",
503
+ "type": "computeprofile",
504
+ "value": "1",
505
+ },
506
+ Object {
507
+ "description": "",
508
+ "id": 2,
509
+ "locked": true,
510
+ "name": "LE",
511
+ "type": "lifecycleenv",
512
+ "value": "1",
513
+ },
514
+ ],
515
+ "hostgroup": "1",
516
+ "id": 1,
517
+ "maxCount": "",
518
+ "minCount": "2",
519
+ "name": "web",
520
+ },
521
+ Object {
522
+ "ansibleGroup": "dbservers",
523
+ "ansibleParameters": Array [
524
+ Object {
525
+ "id": 0,
526
+ "name": "mysqlservice",
527
+ "value": "mysqld",
528
+ },
529
+ Object {
530
+ "id": 1,
531
+ "locked": true,
532
+ "name": "mysql_port",
533
+ "value": "3306",
534
+ },
535
+ Object {
536
+ "id": 2,
537
+ "name": "dbuser",
538
+ "value": "webapp",
539
+ },
540
+ Object {
541
+ "id": 3,
542
+ "name": "dbname",
543
+ "value": "ANSAP01",
544
+ },
545
+ Object {
546
+ "id": 4,
547
+ "name": "upassword",
548
+ "value": "Bond@007",
549
+ },
550
+ Object {
551
+ "id": 5,
552
+ "name": "masterpassword",
553
+ "value": "MySQL@007",
554
+ },
555
+ ],
556
+ "currentCount": 1,
557
+ "description": "",
558
+ "foremanParameters": Array [],
559
+ "hostgroup": "1",
560
+ "id": 2,
561
+ "maxCount": "",
562
+ "minCount": "1",
563
+ "name": "db",
564
+ },
565
+ ],
566
+ }
567
+ `;
568
+
569
+ exports[`ApplicationInstanceReducer should cancel edit host 1`] = `
570
+ Object {
571
+ "ansibleVarsAll": Array [
572
+ Object {
573
+ "id": 0,
574
+ "name": "repository",
575
+ "value": "https://github.com/bennojoy/mywebapp.git",
576
+ },
577
+ ],
578
+ "appDefinition": Object {
579
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
580
+ "created_at": "2021-03-11 12:51:34 +0100",
581
+ "description": "",
582
+ "id": 1,
583
+ "location_ids": Array [
584
+ 2,
585
+ ],
586
+ "name": "LAMP",
587
+ "organization_ids": Array [
588
+ 1,
589
+ ],
590
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
591
+ "updated_at": "2021-03-13 00:06:12 +0100",
592
+ },
593
+ "columns": Array [
594
+ Object {
595
+ "cell": Object {
596
+ "formatters": Array [
597
+ null,
598
+ ],
599
+ },
600
+ "header": Object {
601
+ "formatters": Array [
602
+ null,
603
+ ],
604
+ "label": "Hostname",
605
+ "props": Object {
606
+ "index": 0,
607
+ "style": Object {
608
+ "width": "30%",
609
+ },
610
+ },
611
+ },
612
+ "property": "hostname",
613
+ },
614
+ Object {
615
+ "cell": Object {
616
+ "formatters": Array [
617
+ null,
618
+ ],
619
+ },
620
+ "header": Object {
621
+ "formatters": Array [
622
+ null,
623
+ ],
624
+ "label": "Description",
625
+ "props": Object {
626
+ "index": 1,
627
+ "style": Object {
628
+ "width": "30%",
629
+ },
630
+ },
631
+ },
632
+ "property": "description",
633
+ },
634
+ Object {
635
+ "cell": Object {
636
+ "formatters": Array [
637
+ null,
638
+ ],
639
+ },
640
+ "header": Object {
641
+ "formatters": Array [
642
+ null,
643
+ ],
644
+ "label": "Service",
645
+ "props": Object {
646
+ "index": 2,
647
+ "style": Object {
648
+ "width": "20%",
649
+ },
650
+ },
651
+ },
652
+ "property": "service",
653
+ },
654
+ Object {
655
+ "cell": Object {
656
+ "formatters": Array [
657
+ null,
658
+ ],
659
+ },
660
+ "header": Object {
661
+ "formatters": Array [
662
+ null,
663
+ ],
664
+ "label": "Actions",
665
+ "props": Object {
666
+ "index": 4,
667
+ "style": Object {
668
+ "width": "20%",
669
+ },
670
+ },
671
+ },
672
+ "property": "actions",
673
+ },
674
+ ],
675
+ "editMode": false,
676
+ "error": Object {
677
+ "errorMsg": "",
678
+ "status": "",
679
+ "statusText": "",
680
+ },
681
+ "hosts": Array [
682
+ Object {
683
+ "ansibleParameters": Array [
684
+ Object {
685
+ "id": 0,
686
+ "name": "mysqlservice",
687
+ "value": "mysqld",
688
+ },
689
+ Object {
690
+ "id": 1,
691
+ "name": "mysql_port",
692
+ "value": "3306",
693
+ },
694
+ Object {
695
+ "id": 2,
696
+ "name": "dbuser",
697
+ "value": "webapp",
698
+ },
699
+ Object {
700
+ "id": 3,
701
+ "name": "dbname",
702
+ "value": "ANSAP01",
703
+ },
704
+ Object {
705
+ "id": 4,
706
+ "name": "upassword",
707
+ "value": "Bond@007",
708
+ },
709
+ Object {
710
+ "id": 5,
711
+ "name": "masterpassword",
712
+ "value": "MySQL@007",
713
+ },
714
+ ],
715
+ "description": "",
716
+ "foremanParameters": Array [],
717
+ "hostname": "great-web-app-db-1",
718
+ "id": 4,
719
+ "service": "2",
720
+ },
721
+ Object {
722
+ "ansibleParameters": Array [
723
+ Object {
724
+ "id": 0,
725
+ "name": "dummy_var",
726
+ "value": "0",
727
+ },
728
+ ],
729
+ "description": "",
730
+ "foremanParameters": Array [],
731
+ "hostname": "great-web-app-web-1",
732
+ "id": 1,
733
+ "service": "1",
734
+ },
735
+ Object {
736
+ "ansibleParameters": Array [
737
+ Object {
738
+ "id": 0,
739
+ "name": "dummy_var",
740
+ "value": "0",
741
+ },
742
+ ],
743
+ "description": "",
744
+ "foremanParameters": Array [],
745
+ "hostname": "great-web-app-web-2",
746
+ "id": 2,
747
+ "service": "1",
748
+ },
749
+ ],
750
+ "loading": false,
751
+ "name": false,
752
+ "services": Array [
753
+ Object {
754
+ "ansibleGroup": "webservers",
755
+ "ansibleParameters": Array [
756
+ Object {
757
+ "id": 0,
758
+ "name": "dummy_var",
759
+ "value": "0",
760
+ },
761
+ ],
762
+ "currentCount": 2,
763
+ "description": "",
764
+ "foremanParameters": Array [
765
+ Object {
766
+ "description": "",
767
+ "id": 1,
768
+ "locked": false,
769
+ "name": "CP",
770
+ "type": "computeprofile",
771
+ "value": "1",
772
+ },
773
+ Object {
774
+ "description": "",
775
+ "id": 2,
776
+ "locked": true,
777
+ "name": "LE",
778
+ "type": "lifecycleenv",
779
+ "value": "1",
780
+ },
781
+ ],
782
+ "hostgroup": "1",
783
+ "id": 1,
784
+ "maxCount": "",
785
+ "minCount": "2",
786
+ "name": "web",
787
+ },
788
+ Object {
789
+ "ansibleGroup": "dbservers",
790
+ "ansibleParameters": Array [
791
+ Object {
792
+ "id": 0,
793
+ "name": "mysqlservice",
794
+ "value": "mysqld",
795
+ },
796
+ Object {
797
+ "id": 1,
798
+ "locked": true,
799
+ "name": "mysql_port",
800
+ "value": "3306",
801
+ },
802
+ Object {
803
+ "id": 2,
804
+ "name": "dbuser",
805
+ "value": "webapp",
806
+ },
807
+ Object {
808
+ "id": 3,
809
+ "name": "dbname",
810
+ "value": "ANSAP01",
811
+ },
812
+ Object {
813
+ "id": 4,
814
+ "name": "upassword",
815
+ "value": "Bond@007",
816
+ },
817
+ Object {
818
+ "id": 5,
819
+ "name": "masterpassword",
820
+ "value": "MySQL@007",
821
+ },
822
+ ],
823
+ "currentCount": 1,
824
+ "description": "",
825
+ "foremanParameters": Array [],
826
+ "hostgroup": "1",
827
+ "id": 2,
828
+ "maxCount": "",
829
+ "minCount": "1",
830
+ "name": "db",
831
+ },
832
+ ],
833
+ }
834
+ `;
835
+
836
+ exports[`ApplicationInstanceReducer should change edit host 1`] = `
837
+ Object {
838
+ "ansibleVarsAll": Array [
839
+ Object {
840
+ "id": 0,
841
+ "name": "repository",
842
+ "value": "https://github.com/bennojoy/mywebapp.git",
843
+ },
844
+ ],
845
+ "appDefinition": Object {
846
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
847
+ "created_at": "2021-03-11 12:51:34 +0100",
848
+ "description": "",
849
+ "id": 1,
850
+ "location_ids": Array [
851
+ 2,
852
+ ],
853
+ "name": "LAMP",
854
+ "organization_ids": Array [
855
+ 1,
856
+ ],
857
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
858
+ "updated_at": "2021-03-13 00:06:12 +0100",
859
+ },
860
+ "columns": Array [
861
+ Object {
862
+ "cell": Object {
863
+ "formatters": Array [
864
+ null,
865
+ ],
866
+ },
867
+ "header": Object {
868
+ "formatters": Array [
869
+ null,
870
+ ],
871
+ "label": "Hostname",
872
+ "props": Object {
873
+ "index": 0,
874
+ "style": Object {
875
+ "width": "30%",
876
+ },
877
+ },
878
+ },
879
+ "property": "hostname",
880
+ },
881
+ Object {
882
+ "cell": Object {
883
+ "formatters": Array [
884
+ null,
885
+ ],
886
+ },
887
+ "header": Object {
888
+ "formatters": Array [
889
+ null,
890
+ ],
891
+ "label": "Description",
892
+ "props": Object {
893
+ "index": 1,
894
+ "style": Object {
895
+ "width": "30%",
896
+ },
897
+ },
898
+ },
899
+ "property": "description",
900
+ },
901
+ Object {
902
+ "cell": Object {
903
+ "formatters": Array [
904
+ null,
905
+ ],
906
+ },
907
+ "header": Object {
908
+ "formatters": Array [
909
+ null,
910
+ ],
911
+ "label": "Service",
912
+ "props": Object {
913
+ "index": 2,
914
+ "style": Object {
915
+ "width": "20%",
916
+ },
917
+ },
918
+ },
919
+ "property": "service",
920
+ },
921
+ Object {
922
+ "cell": Object {
923
+ "formatters": Array [
924
+ null,
925
+ ],
926
+ },
927
+ "header": Object {
928
+ "formatters": Array [
929
+ null,
930
+ ],
931
+ "label": "Actions",
932
+ "props": Object {
933
+ "index": 4,
934
+ "style": Object {
935
+ "width": "20%",
936
+ },
937
+ },
938
+ },
939
+ "property": "actions",
940
+ },
941
+ ],
942
+ "error": Object {
943
+ "errorMsg": "",
944
+ "status": "",
945
+ "statusText": "",
946
+ },
947
+ "hosts": Array [
948
+ Object {
949
+ "ansibleParameters": Array [
950
+ Object {
951
+ "id": 0,
952
+ "name": "mysqlservice",
953
+ "value": "mysqld",
954
+ },
955
+ Object {
956
+ "id": 1,
957
+ "name": "mysql_port",
958
+ "value": "3306",
959
+ },
960
+ Object {
961
+ "id": 2,
962
+ "name": "dbuser",
963
+ "value": "webapp",
964
+ },
965
+ Object {
966
+ "id": 3,
967
+ "name": "dbname",
968
+ "value": "ANSAP01",
969
+ },
970
+ Object {
971
+ "id": 4,
972
+ "name": "upassword",
973
+ "value": "Bond@007",
974
+ },
975
+ Object {
976
+ "id": 5,
977
+ "name": "masterpassword",
978
+ "value": "MySQL@007",
979
+ },
980
+ ],
981
+ "description": "",
982
+ "foremanParameters": Array [],
983
+ "hostname": "great-web-app-db-1",
984
+ "id": 4,
985
+ "service": "2",
986
+ },
987
+ Object {
988
+ "ansibleParameters": Array [
989
+ Object {
990
+ "id": 0,
991
+ "name": "dummy_var",
992
+ "value": "0",
993
+ },
994
+ ],
995
+ "description": "",
996
+ "foremanParameters": Array [],
997
+ "hostname": "great-web-app-web-1",
998
+ "id": 1,
999
+ "service": "1",
1000
+ },
1001
+ Object {
1002
+ "ansibleParameters": Array [
1003
+ Object {
1004
+ "id": 0,
1005
+ "name": "dummy_var",
1006
+ "value": "0",
1007
+ },
1008
+ ],
1009
+ "backup": Object {
1010
+ "ansibleParameters": Array [
1011
+ Object {
1012
+ "id": 0,
1013
+ "name": "dummy_var",
1014
+ "value": "0",
1015
+ },
1016
+ ],
1017
+ "description": "",
1018
+ "foremanParameters": Array [],
1019
+ "hostname": "great-web-app-web-2",
1020
+ "id": 2,
1021
+ "service": "1",
1022
+ },
1023
+ "description": "",
1024
+ "foremanParameters": Array [],
1025
+ "hostname": "great-web-app-web-2",
1026
+ "id": 2,
1027
+ "name": "helloworld",
1028
+ "service": "1",
1029
+ },
1030
+ ],
1031
+ "loading": false,
1032
+ "name": false,
1033
+ "services": Array [
1034
+ Object {
1035
+ "ansibleGroup": "webservers",
1036
+ "ansibleParameters": Array [
1037
+ Object {
1038
+ "id": 0,
1039
+ "name": "dummy_var",
1040
+ "value": "0",
1041
+ },
1042
+ ],
1043
+ "currentCount": 2,
1044
+ "description": "",
1045
+ "foremanParameters": Array [
1046
+ Object {
1047
+ "description": "",
1048
+ "id": 1,
1049
+ "locked": false,
1050
+ "name": "CP",
1051
+ "type": "computeprofile",
1052
+ "value": "1",
1053
+ },
1054
+ Object {
1055
+ "description": "",
1056
+ "id": 2,
1057
+ "locked": true,
1058
+ "name": "LE",
1059
+ "type": "lifecycleenv",
1060
+ "value": "1",
1061
+ },
1062
+ ],
1063
+ "hostgroup": "1",
1064
+ "id": 1,
1065
+ "maxCount": "",
1066
+ "minCount": "2",
1067
+ "name": "web",
1068
+ },
1069
+ Object {
1070
+ "ansibleGroup": "dbservers",
1071
+ "ansibleParameters": Array [
1072
+ Object {
1073
+ "id": 0,
1074
+ "name": "mysqlservice",
1075
+ "value": "mysqld",
1076
+ },
1077
+ Object {
1078
+ "id": 1,
1079
+ "locked": true,
1080
+ "name": "mysql_port",
1081
+ "value": "3306",
1082
+ },
1083
+ Object {
1084
+ "id": 2,
1085
+ "name": "dbuser",
1086
+ "value": "webapp",
1087
+ },
1088
+ Object {
1089
+ "id": 3,
1090
+ "name": "dbname",
1091
+ "value": "ANSAP01",
1092
+ },
1093
+ Object {
1094
+ "id": 4,
1095
+ "name": "upassword",
1096
+ "value": "Bond@007",
1097
+ },
1098
+ Object {
1099
+ "id": 5,
1100
+ "name": "masterpassword",
1101
+ "value": "MySQL@007",
1102
+ },
1103
+ ],
1104
+ "currentCount": 1,
1105
+ "description": "",
1106
+ "foremanParameters": Array [],
1107
+ "hostgroup": "1",
1108
+ "id": 2,
1109
+ "maxCount": "",
1110
+ "minCount": "1",
1111
+ "name": "db",
1112
+ },
1113
+ ],
1114
+ }
1115
+ `;
1116
+
1117
+ exports[`ApplicationInstanceReducer should confirm edit host 1`] = `
1118
+ Object {
1119
+ "ansibleVarsAll": Array [
1120
+ Object {
1121
+ "id": 0,
1122
+ "name": "repository",
1123
+ "value": "https://github.com/bennojoy/mywebapp.git",
1124
+ },
1125
+ ],
1126
+ "appDefinition": Object {
1127
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
1128
+ "created_at": "2021-03-11 12:51:34 +0100",
1129
+ "description": "",
1130
+ "id": 1,
1131
+ "location_ids": Array [
1132
+ 2,
1133
+ ],
1134
+ "name": "LAMP",
1135
+ "organization_ids": Array [
1136
+ 1,
1137
+ ],
1138
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
1139
+ "updated_at": "2021-03-13 00:06:12 +0100",
1140
+ },
1141
+ "columns": Array [
1142
+ Object {
1143
+ "cell": Object {
1144
+ "formatters": Array [
1145
+ null,
1146
+ ],
1147
+ },
1148
+ "header": Object {
1149
+ "formatters": Array [
1150
+ null,
1151
+ ],
1152
+ "label": "Hostname",
1153
+ "props": Object {
1154
+ "index": 0,
1155
+ "style": Object {
1156
+ "width": "30%",
1157
+ },
1158
+ },
1159
+ },
1160
+ "property": "hostname",
1161
+ },
1162
+ Object {
1163
+ "cell": Object {
1164
+ "formatters": Array [
1165
+ null,
1166
+ ],
1167
+ },
1168
+ "header": Object {
1169
+ "formatters": Array [
1170
+ null,
1171
+ ],
1172
+ "label": "Description",
1173
+ "props": Object {
1174
+ "index": 1,
1175
+ "style": Object {
1176
+ "width": "30%",
1177
+ },
1178
+ },
1179
+ },
1180
+ "property": "description",
1181
+ },
1182
+ Object {
1183
+ "cell": Object {
1184
+ "formatters": Array [
1185
+ null,
1186
+ ],
1187
+ },
1188
+ "header": Object {
1189
+ "formatters": Array [
1190
+ null,
1191
+ ],
1192
+ "label": "Service",
1193
+ "props": Object {
1194
+ "index": 2,
1195
+ "style": Object {
1196
+ "width": "20%",
1197
+ },
1198
+ },
1199
+ },
1200
+ "property": "service",
1201
+ },
1202
+ Object {
1203
+ "cell": Object {
1204
+ "formatters": Array [
1205
+ null,
1206
+ ],
1207
+ },
1208
+ "header": Object {
1209
+ "formatters": Array [
1210
+ null,
1211
+ ],
1212
+ "label": "Actions",
1213
+ "props": Object {
1214
+ "index": 4,
1215
+ "style": Object {
1216
+ "width": "20%",
1217
+ },
1218
+ },
1219
+ },
1220
+ "property": "actions",
1221
+ },
1222
+ ],
1223
+ "editMode": false,
1224
+ "error": Object {
1225
+ "errorMsg": "",
1226
+ "status": "",
1227
+ "statusText": "",
1228
+ },
1229
+ "hosts": Array [
1230
+ Object {
1231
+ "ansibleParameters": Array [
1232
+ Object {
1233
+ "id": 0,
1234
+ "name": "mysqlservice",
1235
+ "value": "mysqld",
1236
+ },
1237
+ Object {
1238
+ "id": 1,
1239
+ "name": "mysql_port",
1240
+ "value": "3306",
1241
+ },
1242
+ Object {
1243
+ "id": 2,
1244
+ "name": "dbuser",
1245
+ "value": "webapp",
1246
+ },
1247
+ Object {
1248
+ "id": 3,
1249
+ "name": "dbname",
1250
+ "value": "ANSAP01",
1251
+ },
1252
+ Object {
1253
+ "id": 4,
1254
+ "name": "upassword",
1255
+ "value": "Bond@007",
1256
+ },
1257
+ Object {
1258
+ "id": 5,
1259
+ "name": "masterpassword",
1260
+ "value": "MySQL@007",
1261
+ },
1262
+ ],
1263
+ "description": "",
1264
+ "foremanParameters": Array [],
1265
+ "hostname": "great-web-app-db-1",
1266
+ "id": 4,
1267
+ "service": "2",
1268
+ },
1269
+ Object {
1270
+ "ansibleParameters": Array [
1271
+ Object {
1272
+ "id": 0,
1273
+ "name": "dummy_var",
1274
+ "value": "0",
1275
+ },
1276
+ ],
1277
+ "description": "",
1278
+ "foremanParameters": Array [],
1279
+ "hostname": "great-web-app-web-1",
1280
+ "id": 1,
1281
+ "service": "1",
1282
+ },
1283
+ Object {
1284
+ "ansibleParameters": Array [
1285
+ Object {
1286
+ "id": 0,
1287
+ "name": "dummy_var",
1288
+ "value": "0",
1289
+ },
1290
+ ],
1291
+ "description": "",
1292
+ "foremanParameters": Array [],
1293
+ "hostname": "great-web-app-web-2",
1294
+ "id": 2,
1295
+ "service": "1",
1296
+ },
1297
+ ],
1298
+ "loading": false,
1299
+ "name": false,
1300
+ "services": Array [
1301
+ Object {
1302
+ "ansibleGroup": "webservers",
1303
+ "ansibleParameters": Array [
1304
+ Object {
1305
+ "id": 0,
1306
+ "name": "dummy_var",
1307
+ "value": "0",
1308
+ },
1309
+ ],
1310
+ "currentCount": 2,
1311
+ "description": "",
1312
+ "foremanParameters": Array [
1313
+ Object {
1314
+ "description": "",
1315
+ "id": 1,
1316
+ "locked": false,
1317
+ "name": "CP",
1318
+ "type": "computeprofile",
1319
+ "value": "1",
1320
+ },
1321
+ Object {
1322
+ "description": "",
1323
+ "id": 2,
1324
+ "locked": true,
1325
+ "name": "LE",
1326
+ "type": "lifecycleenv",
1327
+ "value": "1",
1328
+ },
1329
+ ],
1330
+ "hostgroup": "1",
1331
+ "id": 1,
1332
+ "maxCount": "",
1333
+ "minCount": "2",
1334
+ "name": "web",
1335
+ },
1336
+ Object {
1337
+ "ansibleGroup": "dbservers",
1338
+ "ansibleParameters": Array [
1339
+ Object {
1340
+ "id": 0,
1341
+ "name": "mysqlservice",
1342
+ "value": "mysqld",
1343
+ },
1344
+ Object {
1345
+ "id": 1,
1346
+ "locked": true,
1347
+ "name": "mysql_port",
1348
+ "value": "3306",
1349
+ },
1350
+ Object {
1351
+ "id": 2,
1352
+ "name": "dbuser",
1353
+ "value": "webapp",
1354
+ },
1355
+ Object {
1356
+ "id": 3,
1357
+ "name": "dbname",
1358
+ "value": "ANSAP01",
1359
+ },
1360
+ Object {
1361
+ "id": 4,
1362
+ "name": "upassword",
1363
+ "value": "Bond@007",
1364
+ },
1365
+ Object {
1366
+ "id": 5,
1367
+ "name": "masterpassword",
1368
+ "value": "MySQL@007",
1369
+ },
1370
+ ],
1371
+ "currentCount": 1,
1372
+ "description": "",
1373
+ "foremanParameters": Array [],
1374
+ "hostgroup": "1",
1375
+ "id": 2,
1376
+ "maxCount": "",
1377
+ "minCount": "1",
1378
+ "name": "db",
1379
+ },
1380
+ ],
1381
+ }
1382
+ `;
1383
+
1384
+ exports[`ApplicationInstanceReducer should delete a host 1`] = `
1385
+ Object {
1386
+ "ansibleVarsAll": Array [
1387
+ Object {
1388
+ "id": 0,
1389
+ "name": "repository",
1390
+ "value": "https://github.com/bennojoy/mywebapp.git",
1391
+ },
1392
+ ],
1393
+ "appDefinition": Object {
1394
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
1395
+ "created_at": "2021-03-11 12:51:34 +0100",
1396
+ "description": "",
1397
+ "id": 1,
1398
+ "location_ids": Array [
1399
+ 2,
1400
+ ],
1401
+ "name": "LAMP",
1402
+ "organization_ids": Array [
1403
+ 1,
1404
+ ],
1405
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
1406
+ "updated_at": "2021-03-13 00:06:12 +0100",
1407
+ },
1408
+ "columns": Array [
1409
+ Object {
1410
+ "cell": Object {
1411
+ "formatters": Array [
1412
+ null,
1413
+ ],
1414
+ },
1415
+ "header": Object {
1416
+ "formatters": Array [
1417
+ null,
1418
+ ],
1419
+ "label": "Hostname",
1420
+ "props": Object {
1421
+ "index": 0,
1422
+ "style": Object {
1423
+ "width": "30%",
1424
+ },
1425
+ },
1426
+ },
1427
+ "property": "hostname",
1428
+ },
1429
+ Object {
1430
+ "cell": Object {
1431
+ "formatters": Array [
1432
+ null,
1433
+ ],
1434
+ },
1435
+ "header": Object {
1436
+ "formatters": Array [
1437
+ null,
1438
+ ],
1439
+ "label": "Description",
1440
+ "props": Object {
1441
+ "index": 1,
1442
+ "style": Object {
1443
+ "width": "30%",
1444
+ },
1445
+ },
1446
+ },
1447
+ "property": "description",
1448
+ },
1449
+ Object {
1450
+ "cell": Object {
1451
+ "formatters": Array [
1452
+ null,
1453
+ ],
1454
+ },
1455
+ "header": Object {
1456
+ "formatters": Array [
1457
+ null,
1458
+ ],
1459
+ "label": "Service",
1460
+ "props": Object {
1461
+ "index": 2,
1462
+ "style": Object {
1463
+ "width": "20%",
1464
+ },
1465
+ },
1466
+ },
1467
+ "property": "service",
1468
+ },
1469
+ Object {
1470
+ "cell": Object {
1471
+ "formatters": Array [
1472
+ null,
1473
+ ],
1474
+ },
1475
+ "header": Object {
1476
+ "formatters": Array [
1477
+ null,
1478
+ ],
1479
+ "label": "Actions",
1480
+ "props": Object {
1481
+ "index": 4,
1482
+ "style": Object {
1483
+ "width": "20%",
1484
+ },
1485
+ },
1486
+ },
1487
+ "property": "actions",
1488
+ },
1489
+ ],
1490
+ "error": Object {
1491
+ "errorMsg": "",
1492
+ "status": "",
1493
+ "statusText": "",
1494
+ },
1495
+ "hosts": Array [
1496
+ Object {
1497
+ "ansibleParameters": Array [
1498
+ Object {
1499
+ "id": 0,
1500
+ "name": "mysqlservice",
1501
+ "value": "mysqld",
1502
+ },
1503
+ Object {
1504
+ "id": 1,
1505
+ "name": "mysql_port",
1506
+ "value": "3306",
1507
+ },
1508
+ Object {
1509
+ "id": 2,
1510
+ "name": "dbuser",
1511
+ "value": "webapp",
1512
+ },
1513
+ Object {
1514
+ "id": 3,
1515
+ "name": "dbname",
1516
+ "value": "ANSAP01",
1517
+ },
1518
+ Object {
1519
+ "id": 4,
1520
+ "name": "upassword",
1521
+ "value": "Bond@007",
1522
+ },
1523
+ Object {
1524
+ "id": 5,
1525
+ "name": "masterpassword",
1526
+ "value": "MySQL@007",
1527
+ },
1528
+ ],
1529
+ "description": "",
1530
+ "foremanParameters": Array [],
1531
+ "hostname": "great-web-app-db-1",
1532
+ "id": 4,
1533
+ "service": "2",
1534
+ },
1535
+ Object {
1536
+ "ansibleParameters": Array [
1537
+ Object {
1538
+ "id": 0,
1539
+ "name": "dummy_var",
1540
+ "value": "0",
1541
+ },
1542
+ ],
1543
+ "description": "",
1544
+ "foremanParameters": Array [],
1545
+ "hostname": "great-web-app-web-1",
1546
+ "id": 1,
1547
+ "service": "1",
1548
+ },
1549
+ ],
1550
+ "loading": false,
1551
+ "name": false,
1552
+ "services": Array [
1553
+ Object {
1554
+ "ansibleGroup": "webservers",
1555
+ "ansibleParameters": Array [
1556
+ Object {
1557
+ "id": 0,
1558
+ "name": "dummy_var",
1559
+ "value": "0",
1560
+ },
1561
+ ],
1562
+ "currentCount": 1,
1563
+ "description": "",
1564
+ "foremanParameters": Array [
1565
+ Object {
1566
+ "description": "",
1567
+ "id": 1,
1568
+ "locked": false,
1569
+ "name": "CP",
1570
+ "type": "computeprofile",
1571
+ "value": "1",
1572
+ },
1573
+ Object {
1574
+ "description": "",
1575
+ "id": 2,
1576
+ "locked": true,
1577
+ "name": "LE",
1578
+ "type": "lifecycleenv",
1579
+ "value": "1",
1580
+ },
1581
+ ],
1582
+ "hostgroup": "1",
1583
+ "id": 1,
1584
+ "maxCount": "",
1585
+ "minCount": "2",
1586
+ "name": "web",
1587
+ },
1588
+ Object {
1589
+ "ansibleGroup": "dbservers",
1590
+ "ansibleParameters": Array [
1591
+ Object {
1592
+ "id": 0,
1593
+ "name": "mysqlservice",
1594
+ "value": "mysqld",
1595
+ },
1596
+ Object {
1597
+ "id": 1,
1598
+ "locked": true,
1599
+ "name": "mysql_port",
1600
+ "value": "3306",
1601
+ },
1602
+ Object {
1603
+ "id": 2,
1604
+ "name": "dbuser",
1605
+ "value": "webapp",
1606
+ },
1607
+ Object {
1608
+ "id": 3,
1609
+ "name": "dbname",
1610
+ "value": "ANSAP01",
1611
+ },
1612
+ Object {
1613
+ "id": 4,
1614
+ "name": "upassword",
1615
+ "value": "Bond@007",
1616
+ },
1617
+ Object {
1618
+ "id": 5,
1619
+ "name": "masterpassword",
1620
+ "value": "MySQL@007",
1621
+ },
1622
+ ],
1623
+ "currentCount": 1,
1624
+ "description": "",
1625
+ "foremanParameters": Array [],
1626
+ "hostgroup": "1",
1627
+ "id": 2,
1628
+ "maxCount": "",
1629
+ "minCount": "1",
1630
+ "name": "db",
1631
+ },
1632
+ ],
1633
+ }
1634
+ `;
1635
+
1636
+ exports[`ApplicationInstanceReducer should initialize component 1`] = `
1637
+ Object {
1638
+ "ansibleVarsAll": Array [
1639
+ Object {
1640
+ "id": 0,
1641
+ "name": "repository",
1642
+ "value": "https://github.com/bennojoy/mywebapp.git",
1643
+ },
1644
+ ],
1645
+ "appDefinition": Object {
1646
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
1647
+ "created_at": "2021-03-11 12:51:34 +0100",
1648
+ "description": "",
1649
+ "id": 1,
1650
+ "location_ids": Array [
1651
+ 2,
1652
+ ],
1653
+ "name": "LAMP",
1654
+ "organization_ids": Array [
1655
+ 1,
1656
+ ],
1657
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
1658
+ "updated_at": "2021-03-13 00:06:12 +0100",
1659
+ },
1660
+ "columns": Array [
1661
+ Object {
1662
+ "cell": Object {
1663
+ "formatters": Array [
1664
+ null,
1665
+ ],
1666
+ },
1667
+ "header": Object {
1668
+ "formatters": Array [
1669
+ null,
1670
+ ],
1671
+ "label": "Hostname",
1672
+ "props": Object {
1673
+ "index": 0,
1674
+ "style": Object {
1675
+ "width": "30%",
1676
+ },
1677
+ },
1678
+ },
1679
+ "property": "hostname",
1680
+ },
1681
+ Object {
1682
+ "cell": Object {
1683
+ "formatters": Array [
1684
+ null,
1685
+ ],
1686
+ },
1687
+ "header": Object {
1688
+ "formatters": Array [
1689
+ null,
1690
+ ],
1691
+ "label": "Description",
1692
+ "props": Object {
1693
+ "index": 1,
1694
+ "style": Object {
1695
+ "width": "30%",
1696
+ },
1697
+ },
1698
+ },
1699
+ "property": "description",
1700
+ },
1701
+ Object {
1702
+ "cell": Object {
1703
+ "formatters": Array [
1704
+ null,
1705
+ ],
1706
+ },
1707
+ "header": Object {
1708
+ "formatters": Array [
1709
+ null,
1710
+ ],
1711
+ "label": "Service",
1712
+ "props": Object {
1713
+ "index": 2,
1714
+ "style": Object {
1715
+ "width": "20%",
1716
+ },
1717
+ },
1718
+ },
1719
+ "property": "service",
1720
+ },
1721
+ Object {
1722
+ "cell": Object {
1723
+ "formatters": Array [
1724
+ null,
1725
+ ],
1726
+ },
1727
+ "header": Object {
1728
+ "formatters": Array [
1729
+ null,
1730
+ ],
1731
+ "label": "Actions",
1732
+ "props": Object {
1733
+ "index": 4,
1734
+ "style": Object {
1735
+ "width": "20%",
1736
+ },
1737
+ },
1738
+ },
1739
+ "property": "actions",
1740
+ },
1741
+ ],
1742
+ "error": Object {
1743
+ "errorMsg": "",
1744
+ "status": "",
1745
+ "statusText": "",
1746
+ },
1747
+ "hosts": Array [
1748
+ Object {
1749
+ "ansibleParameters": Array [
1750
+ Object {
1751
+ "id": 0,
1752
+ "name": "mysqlservice",
1753
+ "value": "mysqld",
1754
+ },
1755
+ Object {
1756
+ "id": 1,
1757
+ "name": "mysql_port",
1758
+ "value": "3306",
1759
+ },
1760
+ Object {
1761
+ "id": 2,
1762
+ "name": "dbuser",
1763
+ "value": "webapp",
1764
+ },
1765
+ Object {
1766
+ "id": 3,
1767
+ "name": "dbname",
1768
+ "value": "ANSAP01",
1769
+ },
1770
+ Object {
1771
+ "id": 4,
1772
+ "name": "upassword",
1773
+ "value": "Bond@007",
1774
+ },
1775
+ Object {
1776
+ "id": 5,
1777
+ "name": "masterpassword",
1778
+ "value": "MySQL@007",
1779
+ },
1780
+ ],
1781
+ "description": "",
1782
+ "foremanParameters": Array [],
1783
+ "hostname": "great-web-app-db-1",
1784
+ "id": 4,
1785
+ "service": "2",
1786
+ },
1787
+ Object {
1788
+ "ansibleParameters": Array [
1789
+ Object {
1790
+ "id": 0,
1791
+ "name": "dummy_var",
1792
+ "value": "0",
1793
+ },
1794
+ ],
1795
+ "description": "",
1796
+ "foremanParameters": Array [],
1797
+ "hostname": "great-web-app-web-1",
1798
+ "id": 1,
1799
+ "service": "1",
1800
+ },
1801
+ Object {
1802
+ "ansibleParameters": Array [
1803
+ Object {
1804
+ "id": 0,
1805
+ "name": "dummy_var",
1806
+ "value": "0",
1807
+ },
1808
+ ],
1809
+ "backup": Object {
1810
+ "ansibleParameters": Array [
1811
+ Object {
1812
+ "id": 0,
1813
+ "name": "dummy_var",
1814
+ "value": "0",
1815
+ },
1816
+ ],
1817
+ "description": "",
1818
+ "foremanParameters": Array [],
1819
+ "hostname": "great-web-app-web-2",
1820
+ "id": 2,
1821
+ "service": "1",
1822
+ },
1823
+ "description": "",
1824
+ "foremanParameters": Array [],
1825
+ "hostname": "great-web-app-web-2",
1826
+ "id": 2,
1827
+ "service": "1",
1828
+ },
1829
+ ],
1830
+ "loading": false,
1831
+ "name": false,
1832
+ "services": Array [
1833
+ Object {
1834
+ "ansibleGroup": "webservers",
1835
+ "ansibleParameters": Array [
1836
+ Object {
1837
+ "id": 0,
1838
+ "name": "dummy_var",
1839
+ "value": "0",
1840
+ },
1841
+ ],
1842
+ "currentCount": 2,
1843
+ "description": "",
1844
+ "foremanParameters": Array [
1845
+ Object {
1846
+ "description": "",
1847
+ "id": 1,
1848
+ "locked": false,
1849
+ "name": "CP",
1850
+ "type": "computeprofile",
1851
+ "value": "1",
1852
+ },
1853
+ Object {
1854
+ "description": "",
1855
+ "id": 2,
1856
+ "locked": true,
1857
+ "name": "LE",
1858
+ "type": "lifecycleenv",
1859
+ "value": "1",
1860
+ },
1861
+ ],
1862
+ "hostgroup": "1",
1863
+ "id": 1,
1864
+ "maxCount": "",
1865
+ "minCount": "2",
1866
+ "name": "web",
1867
+ },
1868
+ Object {
1869
+ "ansibleGroup": "dbservers",
1870
+ "ansibleParameters": Array [
1871
+ Object {
1872
+ "id": 0,
1873
+ "name": "mysqlservice",
1874
+ "value": "mysqld",
1875
+ },
1876
+ Object {
1877
+ "id": 1,
1878
+ "locked": true,
1879
+ "name": "mysql_port",
1880
+ "value": "3306",
1881
+ },
1882
+ Object {
1883
+ "id": 2,
1884
+ "name": "dbuser",
1885
+ "value": "webapp",
1886
+ },
1887
+ Object {
1888
+ "id": 3,
1889
+ "name": "dbname",
1890
+ "value": "ANSAP01",
1891
+ },
1892
+ Object {
1893
+ "id": 4,
1894
+ "name": "upassword",
1895
+ "value": "Bond@007",
1896
+ },
1897
+ Object {
1898
+ "id": 5,
1899
+ "name": "masterpassword",
1900
+ "value": "MySQL@007",
1901
+ },
1902
+ ],
1903
+ "currentCount": 1,
1904
+ "description": "",
1905
+ "foremanParameters": Array [],
1906
+ "hostgroup": "1",
1907
+ "id": 2,
1908
+ "maxCount": "",
1909
+ "minCount": "1",
1910
+ "name": "db",
1911
+ },
1912
+ ],
1913
+ }
1914
+ `;
1915
+
1916
+ exports[`ApplicationInstanceReducer should load param data be erroneous 1`] = `
1917
+ Object {
1918
+ "ansibleVarsAll": Array [
1919
+ Object {
1920
+ "id": 0,
1921
+ "name": "repository",
1922
+ "value": "https://github.com/bennojoy/mywebapp.git",
1923
+ },
1924
+ ],
1925
+ "appDefinition": Object {
1926
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
1927
+ "created_at": "2021-03-11 12:51:34 +0100",
1928
+ "description": "",
1929
+ "id": 1,
1930
+ "location_ids": Array [
1931
+ 2,
1932
+ ],
1933
+ "name": "LAMP",
1934
+ "organization_ids": Array [
1935
+ 1,
1936
+ ],
1937
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
1938
+ "updated_at": "2021-03-13 00:06:12 +0100",
1939
+ },
1940
+ "columns": Array [
1941
+ Object {
1942
+ "cell": Object {
1943
+ "formatters": Array [
1944
+ null,
1945
+ ],
1946
+ },
1947
+ "header": Object {
1948
+ "formatters": Array [
1949
+ null,
1950
+ ],
1951
+ "label": "Hostname",
1952
+ "props": Object {
1953
+ "index": 0,
1954
+ "style": Object {
1955
+ "width": "30%",
1956
+ },
1957
+ },
1958
+ },
1959
+ "property": "hostname",
1960
+ },
1961
+ Object {
1962
+ "cell": Object {
1963
+ "formatters": Array [
1964
+ null,
1965
+ ],
1966
+ },
1967
+ "header": Object {
1968
+ "formatters": Array [
1969
+ null,
1970
+ ],
1971
+ "label": "Description",
1972
+ "props": Object {
1973
+ "index": 1,
1974
+ "style": Object {
1975
+ "width": "30%",
1976
+ },
1977
+ },
1978
+ },
1979
+ "property": "description",
1980
+ },
1981
+ Object {
1982
+ "cell": Object {
1983
+ "formatters": Array [
1984
+ null,
1985
+ ],
1986
+ },
1987
+ "header": Object {
1988
+ "formatters": Array [
1989
+ null,
1990
+ ],
1991
+ "label": "Service",
1992
+ "props": Object {
1993
+ "index": 2,
1994
+ "style": Object {
1995
+ "width": "20%",
1996
+ },
1997
+ },
1998
+ },
1999
+ "property": "service",
2000
+ },
2001
+ Object {
2002
+ "cell": Object {
2003
+ "formatters": Array [
2004
+ null,
2005
+ ],
2006
+ },
2007
+ "header": Object {
2008
+ "formatters": Array [
2009
+ null,
2010
+ ],
2011
+ "label": "Actions",
2012
+ "props": Object {
2013
+ "index": 4,
2014
+ "style": Object {
2015
+ "width": "20%",
2016
+ },
2017
+ },
2018
+ },
2019
+ "property": "actions",
2020
+ },
2021
+ ],
2022
+ "error": "Something really bad happend",
2023
+ "hosts": Array [
2024
+ Object {
2025
+ "ansibleParameters": Array [
2026
+ Object {
2027
+ "id": 0,
2028
+ "name": "mysqlservice",
2029
+ "value": "mysqld",
2030
+ },
2031
+ Object {
2032
+ "id": 1,
2033
+ "name": "mysql_port",
2034
+ "value": "3306",
2035
+ },
2036
+ Object {
2037
+ "id": 2,
2038
+ "name": "dbuser",
2039
+ "value": "webapp",
2040
+ },
2041
+ Object {
2042
+ "id": 3,
2043
+ "name": "dbname",
2044
+ "value": "ANSAP01",
2045
+ },
2046
+ Object {
2047
+ "id": 4,
2048
+ "name": "upassword",
2049
+ "value": "Bond@007",
2050
+ },
2051
+ Object {
2052
+ "id": 5,
2053
+ "name": "masterpassword",
2054
+ "value": "MySQL@007",
2055
+ },
2056
+ ],
2057
+ "description": "",
2058
+ "foremanParameters": Array [],
2059
+ "hostname": "great-web-app-db-1",
2060
+ "id": 4,
2061
+ "service": "2",
2062
+ },
2063
+ Object {
2064
+ "ansibleParameters": Array [
2065
+ Object {
2066
+ "id": 0,
2067
+ "name": "dummy_var",
2068
+ "value": "0",
2069
+ },
2070
+ ],
2071
+ "description": "",
2072
+ "foremanParameters": Array [],
2073
+ "hostname": "great-web-app-web-1",
2074
+ "id": 1,
2075
+ "service": "1",
2076
+ },
2077
+ Object {
2078
+ "ansibleParameters": Array [
2079
+ Object {
2080
+ "id": 0,
2081
+ "name": "dummy_var",
2082
+ "value": "0",
2083
+ },
2084
+ ],
2085
+ "description": "",
2086
+ "foremanParameters": Array [],
2087
+ "hostname": "great-web-app-web-2",
2088
+ "id": 2,
2089
+ "service": "1",
2090
+ },
2091
+ ],
2092
+ "loading": false,
2093
+ "name": false,
2094
+ "services": Array [
2095
+ Object {
2096
+ "ansibleGroup": "webservers",
2097
+ "ansibleParameters": Array [
2098
+ Object {
2099
+ "id": 0,
2100
+ "name": "dummy_var",
2101
+ "value": "0",
2102
+ },
2103
+ ],
2104
+ "currentCount": 2,
2105
+ "description": "",
2106
+ "foremanParameters": Array [
2107
+ Object {
2108
+ "description": "",
2109
+ "id": 1,
2110
+ "locked": false,
2111
+ "name": "CP",
2112
+ "type": "computeprofile",
2113
+ "value": "1",
2114
+ },
2115
+ Object {
2116
+ "description": "",
2117
+ "id": 2,
2118
+ "locked": true,
2119
+ "name": "LE",
2120
+ "type": "lifecycleenv",
2121
+ "value": "1",
2122
+ },
2123
+ ],
2124
+ "hostgroup": "1",
2125
+ "id": 1,
2126
+ "maxCount": "",
2127
+ "minCount": "2",
2128
+ "name": "web",
2129
+ },
2130
+ Object {
2131
+ "ansibleGroup": "dbservers",
2132
+ "ansibleParameters": Array [
2133
+ Object {
2134
+ "id": 0,
2135
+ "name": "mysqlservice",
2136
+ "value": "mysqld",
2137
+ },
2138
+ Object {
2139
+ "id": 1,
2140
+ "locked": true,
2141
+ "name": "mysql_port",
2142
+ "value": "3306",
2143
+ },
2144
+ Object {
2145
+ "id": 2,
2146
+ "name": "dbuser",
2147
+ "value": "webapp",
2148
+ },
2149
+ Object {
2150
+ "id": 3,
2151
+ "name": "dbname",
2152
+ "value": "ANSAP01",
2153
+ },
2154
+ Object {
2155
+ "id": 4,
2156
+ "name": "upassword",
2157
+ "value": "Bond@007",
2158
+ },
2159
+ Object {
2160
+ "id": 5,
2161
+ "name": "masterpassword",
2162
+ "value": "MySQL@007",
2163
+ },
2164
+ ],
2165
+ "currentCount": 1,
2166
+ "description": "",
2167
+ "foremanParameters": Array [],
2168
+ "hostgroup": "1",
2169
+ "id": 2,
2170
+ "maxCount": "",
2171
+ "minCount": "1",
2172
+ "name": "db",
2173
+ },
2174
+ ],
2175
+ }
2176
+ `;
2177
+
2178
+ exports[`ApplicationInstanceReducer should load param data be successful 1`] = `
2179
+ Object {
2180
+ "ansibleVarsAll": Array [
2181
+ Object {
2182
+ "id": 0,
2183
+ "name": "repository",
2184
+ "value": "https://github.com/bennojoy/mywebapp.git",
2185
+ },
2186
+ ],
2187
+ "appDefinition": Object {
2188
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
2189
+ "created_at": "2021-03-11 12:51:34 +0100",
2190
+ "description": "",
2191
+ "id": 1,
2192
+ "location_ids": Array [
2193
+ 2,
2194
+ ],
2195
+ "name": "LAMP",
2196
+ "organization_ids": Array [
2197
+ 1,
2198
+ ],
2199
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
2200
+ "updated_at": "2021-03-13 00:06:12 +0100",
2201
+ },
2202
+ "columns": Array [
2203
+ Object {
2204
+ "cell": Object {
2205
+ "formatters": Array [
2206
+ null,
2207
+ ],
2208
+ },
2209
+ "header": Object {
2210
+ "formatters": Array [
2211
+ null,
2212
+ ],
2213
+ "label": "Hostname",
2214
+ "props": Object {
2215
+ "index": 0,
2216
+ "style": Object {
2217
+ "width": "30%",
2218
+ },
2219
+ },
2220
+ },
2221
+ "property": "hostname",
2222
+ },
2223
+ Object {
2224
+ "cell": Object {
2225
+ "formatters": Array [
2226
+ null,
2227
+ ],
2228
+ },
2229
+ "header": Object {
2230
+ "formatters": Array [
2231
+ null,
2232
+ ],
2233
+ "label": "Description",
2234
+ "props": Object {
2235
+ "index": 1,
2236
+ "style": Object {
2237
+ "width": "30%",
2238
+ },
2239
+ },
2240
+ },
2241
+ "property": "description",
2242
+ },
2243
+ Object {
2244
+ "cell": Object {
2245
+ "formatters": Array [
2246
+ null,
2247
+ ],
2248
+ },
2249
+ "header": Object {
2250
+ "formatters": Array [
2251
+ null,
2252
+ ],
2253
+ "label": "Service",
2254
+ "props": Object {
2255
+ "index": 2,
2256
+ "style": Object {
2257
+ "width": "20%",
2258
+ },
2259
+ },
2260
+ },
2261
+ "property": "service",
2262
+ },
2263
+ Object {
2264
+ "cell": Object {
2265
+ "formatters": Array [
2266
+ null,
2267
+ ],
2268
+ },
2269
+ "header": Object {
2270
+ "formatters": Array [
2271
+ null,
2272
+ ],
2273
+ "label": "Actions",
2274
+ "props": Object {
2275
+ "index": 4,
2276
+ "style": Object {
2277
+ "width": "20%",
2278
+ },
2279
+ },
2280
+ },
2281
+ "property": "actions",
2282
+ },
2283
+ ],
2284
+ "error": Object {
2285
+ "errorMsg": "",
2286
+ "status": "",
2287
+ "statusText": "",
2288
+ },
2289
+ "hosts": Array [
2290
+ Object {
2291
+ "ansibleParameters": Array [
2292
+ Object {
2293
+ "id": 0,
2294
+ "name": "mysqlservice",
2295
+ "value": "mysqld",
2296
+ },
2297
+ Object {
2298
+ "id": 1,
2299
+ "name": "mysql_port",
2300
+ "value": "3306",
2301
+ },
2302
+ Object {
2303
+ "id": 2,
2304
+ "name": "dbuser",
2305
+ "value": "webapp",
2306
+ },
2307
+ Object {
2308
+ "id": 3,
2309
+ "name": "dbname",
2310
+ "value": "ANSAP01",
2311
+ },
2312
+ Object {
2313
+ "id": 4,
2314
+ "name": "upassword",
2315
+ "value": "Bond@007",
2316
+ },
2317
+ Object {
2318
+ "id": 5,
2319
+ "name": "masterpassword",
2320
+ "value": "MySQL@007",
2321
+ },
2322
+ ],
2323
+ "description": "",
2324
+ "foremanParameters": Array [],
2325
+ "hostname": "great-web-app-db-1",
2326
+ "id": 4,
2327
+ "service": "2",
2328
+ },
2329
+ Object {
2330
+ "ansibleParameters": Array [
2331
+ Object {
2332
+ "id": 0,
2333
+ "name": "dummy_var",
2334
+ "value": "0",
2335
+ },
2336
+ ],
2337
+ "description": "",
2338
+ "foremanParameters": Array [],
2339
+ "hostname": "great-web-app-web-1",
2340
+ "id": 1,
2341
+ "service": "1",
2342
+ },
2343
+ Object {
2344
+ "ansibleParameters": Array [
2345
+ Object {
2346
+ "id": 0,
2347
+ "name": "dummy_var",
2348
+ "value": "0",
2349
+ },
2350
+ ],
2351
+ "description": "",
2352
+ "foremanParameters": Array [],
2353
+ "hostname": "great-web-app-web-2",
2354
+ "id": 2,
2355
+ "service": "1",
2356
+ },
2357
+ ],
2358
+ "loading": false,
2359
+ "name": false,
2360
+ "services": Array [
2361
+ Object {
2362
+ "ansibleGroup": "webservers",
2363
+ "ansibleParameters": Array [
2364
+ Object {
2365
+ "id": 0,
2366
+ "name": "dummy_var",
2367
+ "value": "0",
2368
+ },
2369
+ ],
2370
+ "currentCount": 2,
2371
+ "description": "",
2372
+ "foremanParameters": Array [
2373
+ Object {
2374
+ "description": "",
2375
+ "id": 1,
2376
+ "locked": false,
2377
+ "name": "CP",
2378
+ "type": "computeprofile",
2379
+ "value": "1",
2380
+ },
2381
+ Object {
2382
+ "description": "",
2383
+ "id": 2,
2384
+ "locked": true,
2385
+ "name": "LE",
2386
+ "type": "lifecycleenv",
2387
+ "value": "1",
2388
+ },
2389
+ ],
2390
+ "hostgroup": "1",
2391
+ "id": 1,
2392
+ "maxCount": "",
2393
+ "minCount": "2",
2394
+ "name": "web",
2395
+ },
2396
+ Object {
2397
+ "ansibleGroup": "dbservers",
2398
+ "ansibleParameters": Array [
2399
+ Object {
2400
+ "id": 0,
2401
+ "name": "mysqlservice",
2402
+ "value": "mysqld",
2403
+ },
2404
+ Object {
2405
+ "id": 1,
2406
+ "locked": true,
2407
+ "name": "mysql_port",
2408
+ "value": "3306",
2409
+ },
2410
+ Object {
2411
+ "id": 2,
2412
+ "name": "dbuser",
2413
+ "value": "webapp",
2414
+ },
2415
+ Object {
2416
+ "id": 3,
2417
+ "name": "dbname",
2418
+ "value": "ANSAP01",
2419
+ },
2420
+ Object {
2421
+ "id": 4,
2422
+ "name": "upassword",
2423
+ "value": "Bond@007",
2424
+ },
2425
+ Object {
2426
+ "id": 5,
2427
+ "name": "masterpassword",
2428
+ "value": "MySQL@007",
2429
+ },
2430
+ ],
2431
+ "currentCount": 1,
2432
+ "description": "",
2433
+ "foremanParameters": Array [],
2434
+ "hostgroup": "1",
2435
+ "id": 2,
2436
+ "maxCount": "",
2437
+ "minCount": "1",
2438
+ "name": "db",
2439
+ },
2440
+ ],
2441
+ }
2442
+ `;
2443
+
2444
+ exports[`ApplicationInstanceReducer should request load param data 1`] = `
2445
+ Object {
2446
+ "ansibleVarsAll": Array [
2447
+ Object {
2448
+ "id": 0,
2449
+ "name": "repository",
2450
+ "value": "https://github.com/bennojoy/mywebapp.git",
2451
+ },
2452
+ ],
2453
+ "appDefinition": Object {
2454
+ "ansible_vars_all": "[{\\"id\\":0,\\"name\\":\\"repository\\",\\"value\\":\\"https://github.com/bennojoy/mywebapp.git\\"}]",
2455
+ "created_at": "2021-03-11 12:51:34 +0100",
2456
+ "description": "",
2457
+ "id": 1,
2458
+ "location_ids": Array [
2459
+ 2,
2460
+ ],
2461
+ "name": "LAMP",
2462
+ "organization_ids": Array [
2463
+ 1,
2464
+ ],
2465
+ "services": "[{\\"id\\":1,\\"name\\":\\"web\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"webservers\\",\\"minCount\\":\\"2\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[{\\"id\\":1,\\"locked\\":false,\\"name\\":\\"CP\\",\\"description\\":\\"\\",\\"type\\":\\"computeprofile\\",\\"value\\":\\"1\\"},{\\"id\\":2,\\"locked\\":true,\\"name\\":\\"LE\\",\\"description\\":\\"\\",\\"type\\":\\"lifecycleenv\\",\\"value\\":\\"1\\"}],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"dummy_var\\",\\"value\\":\\"0\\"}]},{\\"id\\":2,\\"name\\":\\"db\\",\\"description\\":\\"\\",\\"hostgroup\\":\\"1\\",\\"ansibleGroup\\":\\"dbservers\\",\\"minCount\\":\\"1\\",\\"maxCount\\":\\"\\",\\"foremanParameters\\":[],\\"ansibleParameters\\":[{\\"id\\":0,\\"name\\":\\"mysqlservice\\",\\"value\\":\\"mysqld\\"},{\\"id\\":1,\\"name\\":\\"mysql_port\\",\\"value\\":\\"3306\\",\\"locked\\":true},{\\"id\\":2,\\"name\\":\\"dbuser\\",\\"value\\":\\"webapp\\"},{\\"id\\":3,\\"name\\":\\"dbname\\",\\"value\\":\\"ANSAP01\\"},{\\"id\\":4,\\"name\\":\\"upassword\\",\\"value\\":\\"Bond@007\\"},{\\"id\\":5,\\"name\\":\\"masterpassword\\",\\"value\\":\\"MySQL@007\\"}]}]",
2466
+ "updated_at": "2021-03-13 00:06:12 +0100",
2467
+ },
2468
+ "columns": Array [
2469
+ Object {
2470
+ "cell": Object {
2471
+ "formatters": Array [
2472
+ null,
2473
+ ],
2474
+ },
2475
+ "header": Object {
2476
+ "formatters": Array [
2477
+ null,
2478
+ ],
2479
+ "label": "Hostname",
2480
+ "props": Object {
2481
+ "index": 0,
2482
+ "style": Object {
2483
+ "width": "30%",
2484
+ },
2485
+ },
2486
+ },
2487
+ "property": "hostname",
2488
+ },
2489
+ Object {
2490
+ "cell": Object {
2491
+ "formatters": Array [
2492
+ null,
2493
+ ],
2494
+ },
2495
+ "header": Object {
2496
+ "formatters": Array [
2497
+ null,
2498
+ ],
2499
+ "label": "Description",
2500
+ "props": Object {
2501
+ "index": 1,
2502
+ "style": Object {
2503
+ "width": "30%",
2504
+ },
2505
+ },
2506
+ },
2507
+ "property": "description",
2508
+ },
2509
+ Object {
2510
+ "cell": Object {
2511
+ "formatters": Array [
2512
+ null,
2513
+ ],
2514
+ },
2515
+ "header": Object {
2516
+ "formatters": Array [
2517
+ null,
2518
+ ],
2519
+ "label": "Service",
2520
+ "props": Object {
2521
+ "index": 2,
2522
+ "style": Object {
2523
+ "width": "20%",
2524
+ },
2525
+ },
2526
+ },
2527
+ "property": "service",
2528
+ },
2529
+ Object {
2530
+ "cell": Object {
2531
+ "formatters": Array [
2532
+ null,
2533
+ ],
2534
+ },
2535
+ "header": Object {
2536
+ "formatters": Array [
2537
+ null,
2538
+ ],
2539
+ "label": "Actions",
2540
+ "props": Object {
2541
+ "index": 4,
2542
+ "style": Object {
2543
+ "width": "20%",
2544
+ },
2545
+ },
2546
+ },
2547
+ "property": "actions",
2548
+ },
2549
+ ],
2550
+ "error": Object {
2551
+ "errorMsg": "",
2552
+ "status": "",
2553
+ "statusText": "",
2554
+ },
2555
+ "hosts": Array [
2556
+ Object {
2557
+ "ansibleParameters": Array [
2558
+ Object {
2559
+ "id": 0,
2560
+ "name": "mysqlservice",
2561
+ "value": "mysqld",
2562
+ },
2563
+ Object {
2564
+ "id": 1,
2565
+ "name": "mysql_port",
2566
+ "value": "3306",
2567
+ },
2568
+ Object {
2569
+ "id": 2,
2570
+ "name": "dbuser",
2571
+ "value": "webapp",
2572
+ },
2573
+ Object {
2574
+ "id": 3,
2575
+ "name": "dbname",
2576
+ "value": "ANSAP01",
2577
+ },
2578
+ Object {
2579
+ "id": 4,
2580
+ "name": "upassword",
2581
+ "value": "Bond@007",
2582
+ },
2583
+ Object {
2584
+ "id": 5,
2585
+ "name": "masterpassword",
2586
+ "value": "MySQL@007",
2587
+ },
2588
+ ],
2589
+ "description": "",
2590
+ "foremanParameters": Array [],
2591
+ "hostname": "great-web-app-db-1",
2592
+ "id": 4,
2593
+ "service": "2",
2594
+ },
2595
+ Object {
2596
+ "ansibleParameters": Array [
2597
+ Object {
2598
+ "id": 0,
2599
+ "name": "dummy_var",
2600
+ "value": "0",
2601
+ },
2602
+ ],
2603
+ "description": "",
2604
+ "foremanParameters": Array [],
2605
+ "hostname": "great-web-app-web-1",
2606
+ "id": 1,
2607
+ "service": "1",
2608
+ },
2609
+ Object {
2610
+ "ansibleParameters": Array [
2611
+ Object {
2612
+ "id": 0,
2613
+ "name": "dummy_var",
2614
+ "value": "0",
2615
+ },
2616
+ ],
2617
+ "description": "",
2618
+ "foremanParameters": Array [],
2619
+ "hostname": "great-web-app-web-2",
2620
+ "id": 2,
2621
+ "service": "1",
2622
+ },
2623
+ ],
2624
+ "loading": true,
2625
+ "name": false,
2626
+ "services": Array [
2627
+ Object {
2628
+ "ansibleGroup": "webservers",
2629
+ "ansibleParameters": Array [
2630
+ Object {
2631
+ "id": 0,
2632
+ "name": "dummy_var",
2633
+ "value": "0",
2634
+ },
2635
+ ],
2636
+ "currentCount": 2,
2637
+ "description": "",
2638
+ "foremanParameters": Array [
2639
+ Object {
2640
+ "description": "",
2641
+ "id": 1,
2642
+ "locked": false,
2643
+ "name": "CP",
2644
+ "type": "computeprofile",
2645
+ "value": "1",
2646
+ },
2647
+ Object {
2648
+ "description": "",
2649
+ "id": 2,
2650
+ "locked": true,
2651
+ "name": "LE",
2652
+ "type": "lifecycleenv",
2653
+ "value": "1",
2654
+ },
2655
+ ],
2656
+ "hostgroup": "1",
2657
+ "id": 1,
2658
+ "maxCount": "",
2659
+ "minCount": "2",
2660
+ "name": "web",
2661
+ },
2662
+ Object {
2663
+ "ansibleGroup": "dbservers",
2664
+ "ansibleParameters": Array [
2665
+ Object {
2666
+ "id": 0,
2667
+ "name": "mysqlservice",
2668
+ "value": "mysqld",
2669
+ },
2670
+ Object {
2671
+ "id": 1,
2672
+ "locked": true,
2673
+ "name": "mysql_port",
2674
+ "value": "3306",
2675
+ },
2676
+ Object {
2677
+ "id": 2,
2678
+ "name": "dbuser",
2679
+ "value": "webapp",
2680
+ },
2681
+ Object {
2682
+ "id": 3,
2683
+ "name": "dbname",
2684
+ "value": "ANSAP01",
2685
+ },
2686
+ Object {
2687
+ "id": 4,
2688
+ "name": "upassword",
2689
+ "value": "Bond@007",
2690
+ },
2691
+ Object {
2692
+ "id": 5,
2693
+ "name": "masterpassword",
2694
+ "value": "MySQL@007",
2695
+ },
2696
+ ],
2697
+ "currentCount": 1,
2698
+ "description": "",
2699
+ "foremanParameters": Array [],
2700
+ "hostgroup": "1",
2701
+ "id": 2,
2702
+ "maxCount": "",
2703
+ "minCount": "1",
2704
+ "name": "db",
2705
+ },
2706
+ ],
2707
+ }
2708
+ `;
2709
+
2710
+ exports[`ApplicationInstanceReducer should return initial state 1`] = `
2711
+ Object {
2712
+ "error": Object {
2713
+ "errorMsg": "",
2714
+ "status": "",
2715
+ "statusText": "",
2716
+ },
2717
+ "name": false,
2718
+ }
2719
+ `;