foreman_ansible 6.3.3 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/api/v2/ansible_inventories_controller.rb +1 -1
  3. data/app/graphql/mutations/ansible_variable_overrides/create.rb +26 -0
  4. data/app/graphql/mutations/ansible_variable_overrides/delete.rb +38 -0
  5. data/app/graphql/mutations/ansible_variable_overrides/update.rb +26 -0
  6. data/app/graphql/mutations/hosts/assign_ansible_roles.rb +37 -0
  7. data/app/graphql/presenters/ansible_role_presenter.rb +12 -0
  8. data/app/graphql/presenters/overriden_ansible_variable_presenter.rb +19 -0
  9. data/app/graphql/types/ansible_role.rb +9 -0
  10. data/app/graphql/types/ansible_variable.rb +23 -0
  11. data/app/graphql/types/ansible_variable_override.rb +9 -0
  12. data/app/graphql/types/inherited_ansible_role.rb +13 -0
  13. data/app/graphql/types/overriden_ansible_variable.rb +27 -0
  14. data/app/helpers/foreman_ansible/ansible_reports_helper.rb +35 -54
  15. data/app/models/concerns/foreman_ansible/host_managed_extensions.rb +23 -4
  16. data/app/models/concerns/foreman_ansible/hostgroup_extensions.rb +1 -0
  17. data/app/models/foreman_ansible/ansible_provider.rb +56 -6
  18. data/app/services/foreman_ansible/ansible_report_importer.rb +2 -2
  19. data/app/services/foreman_ansible/inventory_creator.rb +1 -1
  20. data/app/services/foreman_ansible/override_resolver.rb +22 -0
  21. data/app/views/api/v2/ansible_override_values/index.json.rabl +3 -0
  22. data/app/views/api/v2/ansible_variables/show.json.rabl +1 -1
  23. data/app/views/foreman_ansible/ansible_roles/_hostgroup_ansible_roles_button.erb +3 -0
  24. data/app/views/foreman_ansible/config_reports/_ansible.html.erb +14 -5
  25. data/app/views/foreman_ansible/job_templates/ansible_roles_-_ansible_default.erb +4 -0
  26. data/app/views/foreman_ansible/job_templates/convert_to_rhel.erb +6 -2
  27. data/app/views/foreman_ansible/job_templates/run_openscap_scans_-_ansible_default.erb +20 -0
  28. data/config/routes.rb +3 -0
  29. data/db/migrate/20210818083407_fix_ansible_setting_category_to_dsl.rb +5 -0
  30. data/lib/foreman_ansible/engine.rb +0 -18
  31. data/lib/foreman_ansible/register.rb +114 -2
  32. data/lib/foreman_ansible/version.rb +1 -1
  33. data/package.json +10 -6
  34. data/test/functional/api/v2/ansible_inventories_controller_test.rb +1 -2
  35. data/test/graphql/mutations/hosts/assign_ansible_roles_mutation_test.rb +96 -0
  36. data/test/graphql/queries/ansible_roles_query_test.rb +35 -0
  37. data/test/unit/ansible_provider_test.rb +3 -6
  38. data/test/unit/concerns/host_managed_extensions_test.rb +8 -0
  39. data/test/unit/concerns/hostgroup_extensions_test.rb +6 -0
  40. data/test/unit/helpers/ansible_reports_helper_test.rb +4 -30
  41. data/test/unit/services/override_resolver_test.rb +34 -0
  42. data/webpack/components/AnsibleHostDetail/AnsibleHostDetail.js +59 -0
  43. data/webpack/components/AnsibleHostDetail/AnsibleHostDetail.scss +6 -0
  44. data/webpack/components/AnsibleHostDetail/AnsibleHostDetail.test.js +20 -0
  45. data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.js +22 -0
  46. data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.scss +4 -0
  47. data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.test.js +104 -0
  48. data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/index.js +38 -0
  49. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverrides.scss +3 -0
  50. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTable.js +238 -0
  51. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTableHelper.js +111 -0
  52. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.js +161 -0
  53. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.scss +7 -0
  54. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableActionHelper.js +49 -0
  55. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValue.js +70 -0
  56. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js +35 -0
  57. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.fixtures.js +429 -0
  58. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.test.js +71 -0
  59. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesDelete.test.js +74 -0
  60. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesUpdate.test.js +188 -0
  61. data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/index.js +58 -0
  62. data/webpack/components/AnsibleHostDetail/components/JobsTab/JobsTabHelper.js +79 -0
  63. data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobHelper.js +106 -0
  64. data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.js +129 -0
  65. data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.scss +7 -0
  66. data/webpack/components/AnsibleHostDetail/components/JobsTab/PreviousJobsTable.js +103 -0
  67. data/webpack/components/AnsibleHostDetail/components/JobsTab/RecurringJobsTable.js +96 -0
  68. data/webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.fixtures.js +184 -0
  69. data/webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.test.js +195 -0
  70. data/webpack/components/AnsibleHostDetail/components/JobsTab/index.js +88 -0
  71. data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/AllRolesTable.js +89 -0
  72. data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/index.js +80 -0
  73. data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js +90 -0
  74. data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModal.scss +3 -0
  75. data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModalHelper.js +40 -0
  76. data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/index.js +82 -0
  77. data/webpack/components/AnsibleHostDetail/components/RolesTab/RolesTable.js +129 -0
  78. data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/EditRoles.test.js +85 -0
  79. data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.fixtures.js +180 -0
  80. data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.test.js +75 -0
  81. data/webpack/components/AnsibleHostDetail/components/RolesTab/index.js +51 -0
  82. data/webpack/components/AnsibleHostDetail/components/SecondaryTabRoutes.js +60 -0
  83. data/webpack/components/AnsibleHostDetail/components/TabLayout.js +12 -0
  84. data/webpack/components/AnsibleHostDetail/constants.js +9 -0
  85. data/webpack/components/AnsibleHostDetail/helpers.js +4 -0
  86. data/webpack/components/AnsibleHostDetail/index.js +6 -0
  87. data/webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesImport.test.js +15 -10
  88. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +29 -0
  89. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js +3 -0
  90. data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js +2 -1
  91. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsiblePermissionDenied.test.js.snap +2 -0
  92. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap +3 -3
  93. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap +4 -4
  94. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap +9 -0
  95. data/webpack/components/DualList/DualList.scss +3 -0
  96. data/webpack/components/DualList/ListControls.js +65 -0
  97. data/webpack/components/DualList/ListHeader.js +16 -0
  98. data/webpack/components/DualList/ListItem.js +69 -0
  99. data/webpack/components/DualList/ListPane.js +95 -0
  100. data/webpack/components/DualList/SelectedStatus.js +21 -0
  101. data/webpack/components/DualList/index.js +103 -0
  102. data/webpack/components/ErrorState.js +16 -0
  103. data/webpack/components/withLoading.js +135 -0
  104. data/webpack/components/withPagination.js +0 -0
  105. data/webpack/formHelper.js +131 -0
  106. data/webpack/globalIdHelper.js +13 -0
  107. data/webpack/global_index.js +18 -0
  108. data/webpack/graphql/mutations/assignAnsibleRoles.gql +17 -0
  109. data/webpack/graphql/mutations/cancelRecurringLogic.gql +12 -0
  110. data/webpack/graphql/mutations/createAnsibleVariableOverride.gql +28 -0
  111. data/webpack/graphql/mutations/createJobInvocation.gql +11 -0
  112. data/webpack/graphql/mutations/deleteAnsibleVariableOverride.gql +17 -0
  113. data/webpack/graphql/mutations/updateAnsibleVariableOverride.gql +29 -0
  114. data/webpack/graphql/queries/allAnsibleRoles.gql +13 -0
  115. data/webpack/graphql/queries/ansibleRoles.gql +13 -0
  116. data/webpack/graphql/queries/currentUserAttributes.gql +11 -0
  117. data/webpack/graphql/queries/hostAnsibleRoles.gql +17 -0
  118. data/webpack/graphql/queries/hostAvailableAnsibleRoles.gql +11 -0
  119. data/webpack/graphql/queries/hostVariableOverrides.gql +39 -0
  120. data/webpack/graphql/queries/recurringJobs.gql +28 -0
  121. data/webpack/helpers/pageParamsHelper.js +40 -0
  122. data/webpack/helpers/paginationHelper.js +9 -0
  123. data/webpack/permissionsHelper.js +58 -0
  124. data/webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js +63 -0
  125. data/webpack/routes/HostgroupJobs/__test__/HostgroupJobs.test.js +112 -0
  126. data/webpack/routes/HostgroupJobs/index.js +26 -0
  127. data/webpack/routes/routes.js +10 -0
  128. data/webpack/testHelper.js +165 -0
  129. data/webpack/toastHelper.js +4 -0
  130. metadata +130 -78
  131. data/app/assets/images/foreman_ansible/Ansible.png +0 -0
  132. data/app/models/foreman_ansible/fact_name.rb +0 -16
  133. data/app/models/setting/ansible.rb +0 -106
  134. data/app/services/foreman_ansible/fact_importer.rb +0 -99
  135. data/app/services/foreman_ansible/fact_parser.rb +0 -126
  136. data/app/services/foreman_ansible/fact_sparser.rb +0 -37
  137. data/app/services/foreman_ansible/operating_system_parser.rb +0 -102
  138. data/app/services/foreman_ansible/structured_fact_importer.rb +0 -25
  139. data/test/unit/lib/foreman_ansible_core/ansible_runner_test.rb +0 -51
  140. data/test/unit/lib/foreman_ansible_core/command_creator_test.rb +0 -64
  141. data/test/unit/lib/foreman_ansible_core/playbook_runner_test.rb +0 -110
  142. data/test/unit/services/fact_importer_test.rb +0 -52
  143. data/test/unit/services/fact_parser_test.rb +0 -281
  144. data/test/unit/services/fact_sparser_test.rb +0 -24
  145. data/test/unit/services/structured_fact_importer_test.rb +0 -30
  146. data/webpack/__mocks__/foremanReact/common/I18n.js +0 -1
  147. data/webpack/__mocks__/foremanReact/common/helpers.js +0 -13
  148. data/webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js +0 -2
  149. data/webpack/__mocks__/foremanReact/components/common/EmptyState.js +0 -5
  150. data/webpack/__mocks__/foremanReact/components/common/forms/OrderableSelect/helpers.js +0 -5
  151. data/webpack/__mocks__/foremanReact/redux/API.js +0 -7
  152. data/webpack/components/AnsibleRolesAndVariables/__test__/__snapshots__/AnsibleRolesAndVariablesImport.test.js.snap +0 -177
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.3
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-17 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: foreman_ansible_core
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '3.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: acts_as_list
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -67,25 +53,19 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: 4.4.0
69
55
  - !ruby/object:Gem::Dependency
70
- name: ipaddress
56
+ name: foreman-tasks
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: 0.8.0
76
- - - "<"
77
- - !ruby/object:Gem::Version
78
- version: '1.0'
61
+ version: 5.2.0
79
62
  type: :runtime
80
63
  prerelease: false
81
64
  version_requirements: !ruby/object:Gem::Requirement
82
65
  requirements:
83
66
  - - ">="
84
67
  - !ruby/object:Gem::Version
85
- version: 0.8.0
86
- - - "<"
87
- - !ruby/object:Gem::Version
88
- version: '1.0'
68
+ version: 5.2.0
89
69
  description: Ansible integration with Foreman
90
70
  email:
91
71
  - elobatocs@gmail.com
@@ -96,7 +76,6 @@ files:
96
76
  - LICENSE
97
77
  - README.md
98
78
  - Rakefile
99
- - app/assets/images/foreman_ansible/Ansible.png
100
79
  - app/assets/stylesheets/foreman_ansible/foreman-ansible.css
101
80
  - app/controllers/ansible_roles_controller.rb
102
81
  - app/controllers/ansible_variables_controller.rb
@@ -116,6 +95,17 @@ files:
116
95
  - app/controllers/foreman_ansible/concerns/import_controller_helper.rb
117
96
  - app/controllers/foreman_ansible/concerns/job_invocation_helper.rb
118
97
  - app/controllers/ui_ansible_roles_controller.rb
98
+ - app/graphql/mutations/ansible_variable_overrides/create.rb
99
+ - app/graphql/mutations/ansible_variable_overrides/delete.rb
100
+ - app/graphql/mutations/ansible_variable_overrides/update.rb
101
+ - app/graphql/mutations/hosts/assign_ansible_roles.rb
102
+ - app/graphql/presenters/ansible_role_presenter.rb
103
+ - app/graphql/presenters/overriden_ansible_variable_presenter.rb
104
+ - app/graphql/types/ansible_role.rb
105
+ - app/graphql/types/ansible_variable.rb
106
+ - app/graphql/types/ansible_variable_override.rb
107
+ - app/graphql/types/inherited_ansible_role.rb
108
+ - app/graphql/types/overriden_ansible_variable.rb
119
109
  - app/helpers/foreman_ansible/ansible_plugin_helper.rb
120
110
  - app/helpers/foreman_ansible/ansible_reports_helper.rb
121
111
  - app/helpers/foreman_ansible/ansible_roles_data_preparations.rb
@@ -129,10 +119,8 @@ files:
129
119
  - app/models/concerns/foreman_ansible/host_managed_extensions.rb
130
120
  - app/models/concerns/foreman_ansible/hostgroup_extensions.rb
131
121
  - app/models/foreman_ansible/ansible_provider.rb
132
- - app/models/foreman_ansible/fact_name.rb
133
122
  - app/models/host_ansible_role.rb
134
123
  - app/models/hostgroup_ansible_role.rb
135
- - app/models/setting/ansible.rb
136
124
  - app/overrides/ansible_roles_tab.rb
137
125
  - app/overrides/hostgroup_ansible_roles_tab.rb
138
126
  - app/overrides/hostgroup_play_roles.rb
@@ -141,20 +129,16 @@ files:
141
129
  - app/services/foreman_ansible/ansible_report_importer.rb
142
130
  - app/services/foreman_ansible/ansible_report_scanner.rb
143
131
  - app/services/foreman_ansible/api_roles_importer.rb
144
- - app/services/foreman_ansible/fact_importer.rb
145
- - app/services/foreman_ansible/fact_parser.rb
146
- - app/services/foreman_ansible/fact_sparser.rb
147
132
  - app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
148
133
  - app/services/foreman_ansible/import_roles_and_variables_success_notification.rb
149
134
  - app/services/foreman_ansible/insights_notification_builder.rb
150
135
  - app/services/foreman_ansible/insights_plan_runner.rb
151
136
  - app/services/foreman_ansible/inventory_creator.rb
152
- - app/services/foreman_ansible/operating_system_parser.rb
137
+ - app/services/foreman_ansible/override_resolver.rb
153
138
  - app/services/foreman_ansible/playbook_creator.rb
154
139
  - app/services/foreman_ansible/proxy_api.rb
155
140
  - app/services/foreman_ansible/renderer_methods.rb
156
141
  - app/services/foreman_ansible/roles_importer.rb
157
- - app/services/foreman_ansible/structured_fact_importer.rb
158
142
  - app/services/foreman_ansible/ui_roles_importer.rb
159
143
  - app/services/foreman_ansible/variables_importer.rb
160
144
  - app/views/ansible_roles/import.html.erb
@@ -164,6 +148,7 @@ files:
164
148
  - app/views/ansible_variables/edit.html.erb
165
149
  - app/views/ansible_variables/index.html.erb
166
150
  - app/views/ansible_variables/new.html.erb
151
+ - app/views/api/v2/ansible_override_values/index.json.rabl
167
152
  - app/views/api/v2/ansible_override_values/show.json.rabl
168
153
  - app/views/api/v2/ansible_roles/import.json.rabl
169
154
  - app/views/api/v2/ansible_roles/index.json.rabl
@@ -200,6 +185,7 @@ files:
200
185
  - app/views/foreman_ansible/job_templates/power_action_-_ansible_default.erb
201
186
  - app/views/foreman_ansible/job_templates/puppet_run_once_-_ansible_default.erb
202
187
  - app/views/foreman_ansible/job_templates/run_command_-_ansible_default.erb
188
+ - app/views/foreman_ansible/job_templates/run_openscap_scans_-_ansible_default.erb
203
189
  - app/views/foreman_ansible/job_templates/run_playbook-ansible_default.erb
204
190
  - app/views/foreman_ansible/job_templates/service_action_-_ansible_default.erb
205
191
  - app/views/foreman_ansible/job_templates/service_action_-_enable_web_console.erb
@@ -221,6 +207,7 @@ files:
221
207
  - db/migrate/20191010074208_remove_ansible_implementation_setting.rb
222
208
  - db/migrate/20200421201839_update_ansible_inv_template_name.rb
223
209
  - db/migrate/20210120150019_add_position_to_ansible_role.rb
210
+ - db/migrate/20210818083407_fix_ansible_setting_category_to_dsl.rb
224
211
  - db/seeds.d/100_common_parameters.rb
225
212
  - db/seeds.d/62_ansible_proxy_feature.rb
226
213
  - db/seeds.d/75_job_templates.rb
@@ -288,6 +275,8 @@ files:
288
275
  - test/functional/api/v2/hosts_controller_test.rb
289
276
  - test/functional/hosts_controller_test.rb
290
277
  - test/functional/ui_ansible_roles_controller_test.rb
278
+ - test/graphql/mutations/hosts/assign_ansible_roles_mutation_test.rb
279
+ - test/graphql/queries/ansible_roles_query_test.rb
291
280
  - test/test_plugin_helper.rb
292
281
  - test/unit/actions/run_ansible_job_test.rb
293
282
  - test/unit/actions/run_proxy_ansible_command_test.rb
@@ -302,27 +291,60 @@ files:
302
291
  - test/unit/hostgroup_ansible_role_test.rb
303
292
  - test/unit/ignore_roles_test.rb
304
293
  - test/unit/import_roles_and_variables.rb
305
- - test/unit/lib/foreman_ansible_core/ansible_runner_test.rb
306
- - test/unit/lib/foreman_ansible_core/command_creator_test.rb
307
- - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
308
294
  - test/unit/lib/proxy_api/ansible_test.rb
309
295
  - test/unit/services/ansible_report_importer_test.rb
310
296
  - test/unit/services/ansible_variables_importer_test.rb
311
297
  - test/unit/services/api_roles_importer_test.rb
312
- - test/unit/services/fact_importer_test.rb
313
- - test/unit/services/fact_parser_test.rb
314
- - test/unit/services/fact_sparser_test.rb
315
298
  - test/unit/services/insights_plan_runner_test.rb
316
299
  - test/unit/services/inventory_creator_test.rb
300
+ - test/unit/services/override_resolver_test.rb
317
301
  - test/unit/services/roles_importer_test.rb
318
- - test/unit/services/structured_fact_importer_test.rb
319
302
  - test/unit/services/ui_roles_importer_test.rb
320
- - webpack/__mocks__/foremanReact/common/I18n.js
321
- - webpack/__mocks__/foremanReact/common/helpers.js
322
- - webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
323
- - webpack/__mocks__/foremanReact/components/common/EmptyState.js
324
- - webpack/__mocks__/foremanReact/components/common/forms/OrderableSelect/helpers.js
325
- - webpack/__mocks__/foremanReact/redux/API.js
303
+ - webpack/components/AnsibleHostDetail/AnsibleHostDetail.js
304
+ - webpack/components/AnsibleHostDetail/AnsibleHostDetail.scss
305
+ - webpack/components/AnsibleHostDetail/AnsibleHostDetail.test.js
306
+ - webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.js
307
+ - webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.scss
308
+ - webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.test.js
309
+ - webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/index.js
310
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverrides.scss
311
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTable.js
312
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTableHelper.js
313
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.js
314
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.scss
315
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableActionHelper.js
316
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValue.js
317
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js
318
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.fixtures.js
319
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.test.js
320
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesDelete.test.js
321
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesUpdate.test.js
322
+ - webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/index.js
323
+ - webpack/components/AnsibleHostDetail/components/JobsTab/JobsTabHelper.js
324
+ - webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobHelper.js
325
+ - webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.js
326
+ - webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.scss
327
+ - webpack/components/AnsibleHostDetail/components/JobsTab/PreviousJobsTable.js
328
+ - webpack/components/AnsibleHostDetail/components/JobsTab/RecurringJobsTable.js
329
+ - webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.fixtures.js
330
+ - webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.test.js
331
+ - webpack/components/AnsibleHostDetail/components/JobsTab/index.js
332
+ - webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/AllRolesTable.js
333
+ - webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/index.js
334
+ - webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js
335
+ - webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModal.scss
336
+ - webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModalHelper.js
337
+ - webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/index.js
338
+ - webpack/components/AnsibleHostDetail/components/RolesTab/RolesTable.js
339
+ - webpack/components/AnsibleHostDetail/components/RolesTab/__test__/EditRoles.test.js
340
+ - webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.fixtures.js
341
+ - webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.test.js
342
+ - webpack/components/AnsibleHostDetail/components/RolesTab/index.js
343
+ - webpack/components/AnsibleHostDetail/components/SecondaryTabRoutes.js
344
+ - webpack/components/AnsibleHostDetail/components/TabLayout.js
345
+ - webpack/components/AnsibleHostDetail/constants.js
346
+ - webpack/components/AnsibleHostDetail/helpers.js
347
+ - webpack/components/AnsibleHostDetail/index.js
326
348
  - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.js
327
349
  - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.scss
328
350
  - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesActions.js
@@ -330,7 +352,6 @@ files:
330
352
  - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesHelpers.js
331
353
  - webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesHelpers.test.js
332
354
  - webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesImport.test.js
333
- - webpack/components/AnsibleRolesAndVariables/__test__/__snapshots__/AnsibleRolesAndVariablesImport.test.js.snap
334
355
  - webpack/components/AnsibleRolesAndVariables/index.js
335
356
  - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js
336
357
  - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss
@@ -367,9 +388,44 @@ files:
367
388
  - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap
368
389
  - webpack/components/AnsibleRolesSwitcher/components/withProtectedView.js
369
390
  - webpack/components/AnsibleRolesSwitcher/index.js
391
+ - webpack/components/DualList/DualList.scss
392
+ - webpack/components/DualList/ListControls.js
393
+ - webpack/components/DualList/ListHeader.js
394
+ - webpack/components/DualList/ListItem.js
395
+ - webpack/components/DualList/ListPane.js
396
+ - webpack/components/DualList/SelectedStatus.js
397
+ - webpack/components/DualList/index.js
398
+ - webpack/components/ErrorState.js
370
399
  - webpack/components/ReportJsonViewer.js
400
+ - webpack/components/withLoading.js
401
+ - webpack/components/withPagination.js
402
+ - webpack/formHelper.js
403
+ - webpack/globalIdHelper.js
404
+ - webpack/global_index.js
405
+ - webpack/graphql/mutations/assignAnsibleRoles.gql
406
+ - webpack/graphql/mutations/cancelRecurringLogic.gql
407
+ - webpack/graphql/mutations/createAnsibleVariableOverride.gql
408
+ - webpack/graphql/mutations/createJobInvocation.gql
409
+ - webpack/graphql/mutations/deleteAnsibleVariableOverride.gql
410
+ - webpack/graphql/mutations/updateAnsibleVariableOverride.gql
411
+ - webpack/graphql/queries/allAnsibleRoles.gql
412
+ - webpack/graphql/queries/ansibleRoles.gql
413
+ - webpack/graphql/queries/currentUserAttributes.gql
414
+ - webpack/graphql/queries/hostAnsibleRoles.gql
415
+ - webpack/graphql/queries/hostAvailableAnsibleRoles.gql
416
+ - webpack/graphql/queries/hostVariableOverrides.gql
417
+ - webpack/graphql/queries/recurringJobs.gql
418
+ - webpack/helpers/pageParamsHelper.js
419
+ - webpack/helpers/paginationHelper.js
371
420
  - webpack/index.js
421
+ - webpack/permissionsHelper.js
372
422
  - webpack/reducer.js
423
+ - webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js
424
+ - webpack/routes/HostgroupJobs/__test__/HostgroupJobs.test.js
425
+ - webpack/routes/HostgroupJobs/index.js
426
+ - webpack/routes/routes.js
427
+ - webpack/testHelper.js
428
+ - webpack/toastHelper.js
373
429
  homepage: https://github.com/theforeman/foreman_ansible
374
430
  licenses:
375
431
  - GPL-3.0
@@ -389,54 +445,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
389
445
  - !ruby/object:Gem::Version
390
446
  version: '0'
391
447
  requirements: []
392
- rubygems_version: 3.1.2
448
+ rubygems_version: 3.1.6
393
449
  signing_key:
394
450
  specification_version: 4
395
451
  summary: Ansible integration with Foreman (theforeman.org)
396
452
  test_files:
397
- - test/factories/ansible_proxy.rb
398
- - test/factories/ansible_variables.rb
399
- - test/factories/ansible_roles.rb
400
- - test/factories/host_ansible_enhancements.rb
401
- - test/fixtures/insights_playbook.yaml
402
- - test/fixtures/sample_facts.json
403
- - test/fixtures/report.json
453
+ - test/functional/ansible_variables_controller_test.rb
404
454
  - test/functional/ansible_roles_controller_test.rb
405
455
  - test/functional/api/v2/ansible_variables_controller_test.rb
406
456
  - test/functional/api/v2/ansible_roles_controller_test.rb
407
457
  - test/functional/api/v2/hostgroups_controller_test.rb
408
- - test/functional/api/v2/hosts_controller_test.rb
409
458
  - test/functional/api/v2/ansible_inventories_controller_test.rb
459
+ - test/functional/api/v2/hosts_controller_test.rb
410
460
  - test/functional/ui_ansible_roles_controller_test.rb
411
- - test/functional/ansible_variables_controller_test.rb
412
461
  - test/functional/hosts_controller_test.rb
413
- - test/test_plugin_helper.rb
462
+ - test/graphql/mutations/hosts/assign_ansible_roles_mutation_test.rb
463
+ - test/graphql/queries/ansible_roles_query_test.rb
464
+ - test/foreman_ansible/helpers/ansible_roles_helper_test.rb
414
465
  - test/unit/actions/run_ansible_job_test.rb
415
466
  - test/unit/actions/run_proxy_ansible_command_test.rb
416
- - test/unit/ansible_role_test.rb
417
- - test/unit/ansible_variable_test.rb
418
- - test/unit/concerns/config_reports_extensions_test.rb
419
- - test/unit/concerns/host_managed_extensions_test.rb
420
- - test/unit/concerns/hostgroup_extensions_test.rb
421
- - test/unit/helpers/ansible_reports_helper_test.rb
422
- - test/unit/lib/proxy_api/ansible_test.rb
423
- - test/unit/lib/foreman_ansible_core/ansible_runner_test.rb
424
- - test/unit/lib/foreman_ansible_core/command_creator_test.rb
425
- - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
467
+ - test/unit/services/api_roles_importer_test.rb
468
+ - test/unit/services/ui_roles_importer_test.rb
426
469
  - test/unit/services/ansible_report_importer_test.rb
427
470
  - test/unit/services/insights_plan_runner_test.rb
471
+ - test/unit/services/override_resolver_test.rb
428
472
  - test/unit/services/roles_importer_test.rb
429
- - test/unit/services/fact_importer_test.rb
430
- - test/unit/services/fact_parser_test.rb
431
- - test/unit/services/fact_sparser_test.rb
432
- - test/unit/services/structured_fact_importer_test.rb
433
- - test/unit/services/ansible_variables_importer_test.rb
434
- - test/unit/services/api_roles_importer_test.rb
435
473
  - test/unit/services/inventory_creator_test.rb
436
- - test/unit/services/ui_roles_importer_test.rb
437
- - test/unit/ansible_provider_test.rb
474
+ - test/unit/services/ansible_variables_importer_test.rb
475
+ - test/unit/lib/proxy_api/ansible_test.rb
476
+ - test/unit/ansible_role_test.rb
477
+ - test/unit/hostgroup_ansible_role_test.rb
478
+ - test/unit/ansible_variable_test.rb
438
479
  - test/unit/host_ansible_role_test.rb
480
+ - test/unit/helpers/ansible_reports_helper_test.rb
481
+ - test/unit/ansible_provider_test.rb
439
482
  - test/unit/ignore_roles_test.rb
440
483
  - test/unit/import_roles_and_variables.rb
441
- - test/unit/hostgroup_ansible_role_test.rb
442
- - test/foreman_ansible/helpers/ansible_roles_helper_test.rb
484
+ - test/unit/concerns/config_reports_extensions_test.rb
485
+ - test/unit/concerns/host_managed_extensions_test.rb
486
+ - test/unit/concerns/hostgroup_extensions_test.rb
487
+ - test/factories/ansible_proxy.rb
488
+ - test/factories/host_ansible_enhancements.rb
489
+ - test/factories/ansible_variables.rb
490
+ - test/factories/ansible_roles.rb
491
+ - test/fixtures/report.json
492
+ - test/fixtures/sample_facts.json
493
+ - test/fixtures/insights_playbook.yaml
494
+ - test/test_plugin_helper.rb
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ForemanAnsible
4
- # Define the class that fact names that come from Ansible should have
5
- # It allows us to filter facts by origin, and also to display the origin
6
- # in the fact values table (/fact_values)
7
- class FactName < ::FactName
8
- def origin
9
- 'Ansible'
10
- end
11
-
12
- def icon_path
13
- 'foreman_ansible/Ansible.png'
14
- end
15
- end
16
- end
@@ -1,106 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Setting
4
- # Provide settings related with Ansible
5
- class Ansible < ::Setting
6
- ::Setting::BLANK_ATTRS.concat %w[ansible_roles_to_ignore]
7
- class << self
8
- # It would be more disadvantages than advantages to split up
9
- # default_settings into multiple methods, this way it's already very
10
- # manageable.
11
- def default_settings
12
- [
13
- set(
14
- 'ansible_ssh_private_key_file',
15
- N_('Use this to supply a path to an SSH Private Key '\
16
- 'that Ansible will use in lieu of a password '\
17
- 'Override with "ansible_ssh_private_key_file" '\
18
- 'host parameter'),
19
- '',
20
- N_('Private Key Path')
21
- ),
22
- set(
23
- 'ansible_connection',
24
- N_('Use this connection type by default when running '\
25
- 'Ansible playbooks. You can override this on hosts by '\
26
- 'adding a parameter "ansible_connection"'),
27
- 'ssh',
28
- N_('Connection type')
29
- ),
30
- set(
31
- 'ansible_winrm_server_cert_validation',
32
- N_('Enable/disable WinRM server certificate '\
33
- 'validation when running Ansible playbooks. You can override '\
34
- 'this on hosts by adding a parameter '\
35
- '"ansible_winrm_server_cert_validation"'),
36
- 'validate',
37
- N_('WinRM cert Validation')
38
- ),
39
- set(
40
- 'ansible_verbosity',
41
- N_('Foreman will add this level of verbosity for '\
42
- 'additional debugging output when running Ansible playbooks.'),
43
- '0',
44
- N_('Default verbosity level'),
45
- nil,
46
- :collection => lambda do
47
- { '0' => N_('Disabled'),
48
- '1' => N_('Level 1 (-v)'),
49
- '2' => N_('Level 2 (-vv)'),
50
- '3' => N_('Level 3 (-vvv)'),
51
- '4' => N_('Level 4 (-vvvv)') }
52
- end
53
- ),
54
- set(
55
- 'ansible_post_provision_timeout',
56
- N_('Timeout (in seconds) to set when Foreman will trigger a '\
57
- 'play Ansible roles task after a host is fully provisioned. '\
58
- 'Set this to the maximum time you expect a host to take '\
59
- 'until it is ready after a reboot.'),
60
- '360',
61
- N_('Post-provision timeout')
62
- ),
63
- set(
64
- 'ansible_interval',
65
- N_('Timeout (in minutes) when hosts should have reported.'),
66
- '30',
67
- N_('Ansible report timeout')
68
- ),
69
- set(
70
- 'ansible_out_of_sync_disabled',
71
- format(N_('Disable host configuration status turning to out of'\
72
- ' sync for %{cfgmgmt} after report does not arrive within'\
73
- ' configured interval'), :cfgmgmt => 'Ansible'),
74
- false,
75
- format(N_('%{cfgmgmt} out of sync disabled'),
76
- :cfgmgmt => 'Ansible')
77
- ),
78
- set(
79
- 'ansible_inventory_template',
80
- N_('Foreman will use this template to schedule the report '\
81
- 'with Ansible inventory'),
82
- 'Ansible - Ansible Inventory',
83
- N_('Default Ansible inventory report template')
84
- ),
85
- set(
86
- 'ansible_roles_to_ignore',
87
- N_('Those roles will be excluded when importing roles from smart proxy, '\
88
- 'The expected input is comma separated values and you can use * wildcard metacharacters'\
89
- 'For example: foo*, *b*,*bar'),
90
- [],
91
- N_('Ansible roles to ignore')
92
- )
93
- ]
94
- end
95
-
96
- def load_defaults
97
- Setting::BLANK_ATTRS.push('ansible_ssh_private_key_file')
98
- super
99
- end
100
-
101
- def humanized_category
102
- N_('Ansible')
103
- end
104
- end
105
- end
106
- end
@@ -1,99 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ForemanAnsible
4
- # Override methods from Foreman app/services/fact_importer so that Ansible
5
- # facts are recognized in Foreman as ForemanAnsible facts. It supports
6
- # nested facts.
7
- #
8
- # Only relevant for 1.12 and lower versions
9
- class FactImporter < ::FactImporter
10
- def fact_name_class
11
- ForemanAnsible::FactName
12
- end
13
-
14
- def initialize(host, facts = {})
15
- # Try to assign these facts to the correct host as per the facts say
16
- # If that host isn't created yet, the host parameter will contain it
17
- @host = Host.find_by(:name => facts[:ansible_facts][:ansible_fqdn] ||
18
- facts[:ansible_facts][:fqdn]) ||
19
- host
20
- @facts = normalize(facts[:ansible_facts])
21
- @original_facts = FactSparser.unsparse(facts[:ansible_facts])
22
- @counters = {}
23
- end
24
-
25
- private
26
-
27
- def add_new_facts
28
- @counters[:added] = 0
29
- add_missing_facts(FactSparser.unsparse(@original_facts))
30
- logger.debug(
31
- "Merging facts for '#{host}': added #{@counters[:added]} facts"
32
- )
33
- end
34
-
35
- def add_missing_facts(imported_facts, parent = nil, prefix = '')
36
- imported_facts.reject! { |_fact_name, fact_value| fact_value.nil? }
37
-
38
- imported_facts.each do |imported_name, imported_value|
39
- fact_fqn = fact_fqn(imported_name, prefix)
40
- fact_name = find_or_create_fact_name(fact_fqn, parent, imported_value)
41
- add_fact_value(imported_value, fact_name)
42
- add_compose_fact(imported_value, fact_name, fact_fqn)
43
- end
44
- end
45
-
46
- def add_compose_fact(imported_values, fact_name, fact_fqn)
47
- if imported_values.is_a?(Hash)
48
- add_missing_facts(imported_values, fact_name, fact_fqn)
49
- elsif imported_values.is_a?(Array)
50
- imported_values.each do |imported_value|
51
- next unless imported_value.is_a?(Hash)
52
- add_missing_facts(imported_value, fact_name, fact_fqn)
53
- end
54
- end
55
- end
56
-
57
- def missing_facts
58
- @missing_facts ||= facts.keys +
59
- FactSparser.sparse(@original_facts).keys -
60
- host_fact_names
61
- end
62
-
63
- def host_fact_names
64
- host.fact_names.where(:type => fact_name_class.to_s).pluck(:name)
65
- end
66
-
67
- # Returns pairs [id, fact_name]
68
- def fact_names
69
- fact_name_class.group('name').maximum(:id)
70
- end
71
-
72
- # Fact fully qualified name contains an unambiguous name for a fact
73
- # e.g: ansible_lo::ipv6, ansible_virbr0::active
74
- def fact_fqn(name, prefix)
75
- prefix.empty? ? name : prefix + FactName::SEPARATOR + name
76
- end
77
-
78
- def find_or_create_fact_name(name, parent, fact_value)
79
- return fact_name_class.find(fact_names[name]) if fact_names[name].present?
80
- fact_name_class.create!(:name => name,
81
- :parent => parent,
82
- :compose => compose?(fact_value))
83
- end
84
-
85
- def add_fact_value(value, fact_name)
86
- return unless missing_facts.include?(fact_name.name)
87
- method = host.new_record? ? :build : :create!
88
- host.fact_values.send(method,
89
- :value => value.to_s,
90
- :fact_name => fact_name)
91
- @counters[:added] += 1
92
- end
93
-
94
- def compose?(fact_value)
95
- fact_value.is_a?(Hash) ||
96
- fact_value.is_a?(Array) && fact_value.first.is_a?(Hash)
97
- end
98
- end
99
- end