foreman_ansible 6.2.0 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/ansible_roles_controller.rb +12 -8
  3. data/app/controllers/ansible_variables_controller.rb +4 -0
  4. data/app/controllers/api/v2/ansible_roles_controller.rb +32 -11
  5. data/app/controllers/api/v2/ansible_variables_controller.rb +6 -4
  6. data/app/controllers/foreman_ansible/concerns/import_controller_helper.rb +3 -3
  7. data/app/helpers/foreman_ansible/ansible_reports_helper.rb +8 -0
  8. data/app/helpers/foreman_ansible/ansible_roles_data_preparations.rb +95 -0
  9. data/app/helpers/foreman_ansible/ansible_roles_helper.rb +20 -1
  10. data/app/jobs/sync_roles_and_variables.rb +20 -0
  11. data/app/models/concerns/foreman_ansible/host_managed_extensions.rb +7 -4
  12. data/app/models/concerns/foreman_ansible/hostgroup_extensions.rb +7 -4
  13. data/app/models/foreman_ansible/ansible_provider.rb +2 -1
  14. data/app/models/host_ansible_role.rb +1 -0
  15. data/app/models/hostgroup_ansible_role.rb +1 -0
  16. data/app/models/setting/ansible.rb +9 -0
  17. data/app/services/foreman_ansible/ansible_report_importer.rb +4 -0
  18. data/app/services/foreman_ansible/ansible_report_scanner.rb +15 -1
  19. data/app/services/foreman_ansible/api_roles_importer.rb +23 -11
  20. data/app/services/foreman_ansible/fact_parser.rb +21 -1
  21. data/app/services/foreman_ansible/import_roles_and_variables_error_notification.rb +31 -0
  22. data/app/services/foreman_ansible/import_roles_and_variables_success_notification.rb +26 -0
  23. data/app/services/foreman_ansible/inventory_creator.rb +3 -7
  24. data/app/services/foreman_ansible/roles_importer.rb +3 -2
  25. data/app/services/foreman_ansible/ui_roles_importer.rb +2 -2
  26. data/app/services/foreman_ansible/variables_importer.rb +32 -2
  27. data/app/views/ansible_roles/import.html.erb +10 -50
  28. data/app/views/ansible_variables/index.html.erb +1 -2
  29. data/app/views/api/v2/ansible_roles/sync.json.rabl +5 -0
  30. data/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb +1 -2
  31. data/app/views/foreman_ansible/config_reports/_ansible.html.erb +13 -6
  32. data/app/views/foreman_ansible/job_templates/ansible_collections_-_install_from_galaxy.erb +28 -0
  33. data/app/views/foreman_ansible/job_templates/convert_to_rhel.erb +44 -0
  34. data/config/routes.rb +5 -4
  35. data/db/migrate/20210120150019_add_position_to_ansible_role.rb +27 -0
  36. data/db/seeds.d/100_common_parameters.rb +7 -0
  37. data/db/seeds.d/90_notification_blueprints.rb +19 -1
  38. data/lib/foreman_ansible/engine.rb +1 -0
  39. data/lib/foreman_ansible/register.rb +5 -5
  40. data/lib/foreman_ansible/version.rb +1 -1
  41. data/locale/ca/LC_MESSAGES/foreman_ansible.mo +0 -0
  42. data/locale/ca/foreman_ansible.po +1 -1
  43. data/locale/cs_CZ/LC_MESSAGES/foreman_ansible.mo +0 -0
  44. data/locale/cs_CZ/foreman_ansible.po +1 -1
  45. data/locale/de/LC_MESSAGES/foreman_ansible.mo +0 -0
  46. data/locale/de/foreman_ansible.po +1 -1
  47. data/locale/en/LC_MESSAGES/foreman_ansible.mo +0 -0
  48. data/locale/en/foreman_ansible.po +1 -1
  49. data/locale/en_GB/LC_MESSAGES/foreman_ansible.mo +0 -0
  50. data/locale/en_GB/foreman_ansible.po +1 -1
  51. data/locale/es/LC_MESSAGES/foreman_ansible.mo +0 -0
  52. data/locale/es/foreman_ansible.po +1 -1
  53. data/locale/fr/LC_MESSAGES/foreman_ansible.mo +0 -0
  54. data/locale/fr/foreman_ansible.po +1 -1
  55. data/locale/gl/LC_MESSAGES/foreman_ansible.mo +0 -0
  56. data/locale/gl/foreman_ansible.po +1 -1
  57. data/locale/it/LC_MESSAGES/foreman_ansible.mo +0 -0
  58. data/locale/it/foreman_ansible.po +1 -1
  59. data/locale/ja/LC_MESSAGES/foreman_ansible.mo +0 -0
  60. data/locale/ja/foreman_ansible.po +1 -1
  61. data/locale/ko/LC_MESSAGES/foreman_ansible.mo +0 -0
  62. data/locale/ko/foreman_ansible.po +1 -1
  63. data/locale/nl_NL/LC_MESSAGES/foreman_ansible.mo +0 -0
  64. data/locale/nl_NL/foreman_ansible.po +1 -1
  65. data/locale/pl/LC_MESSAGES/foreman_ansible.mo +0 -0
  66. data/locale/pl/foreman_ansible.po +1 -1
  67. data/locale/pt_BR/LC_MESSAGES/foreman_ansible.mo +0 -0
  68. data/locale/pt_BR/foreman_ansible.po +1 -1
  69. data/locale/ru/LC_MESSAGES/foreman_ansible.mo +0 -0
  70. data/locale/ru/foreman_ansible.po +1 -1
  71. data/locale/sv_SE/LC_MESSAGES/foreman_ansible.mo +0 -0
  72. data/locale/sv_SE/foreman_ansible.po +1 -1
  73. data/locale/zh_CN/LC_MESSAGES/foreman_ansible.mo +0 -0
  74. data/locale/zh_CN/foreman_ansible.po +1 -1
  75. data/locale/zh_TW/LC_MESSAGES/foreman_ansible.mo +0 -0
  76. data/locale/zh_TW/foreman_ansible.po +1 -1
  77. data/test/factories/ansible_roles.rb +12 -0
  78. data/test/factories/host_ansible_enhancements.rb +23 -0
  79. data/test/foreman_ansible/helpers/ansible_roles_helper_test.rb +45 -0
  80. data/test/functional/ansible_variables_controller_test.rb +0 -15
  81. data/test/functional/api/v2/ansible_roles_controller_test.rb +23 -0
  82. data/test/functional/api/v2/hostgroups_controller_test.rb +5 -4
  83. data/test/functional/api/v2/hosts_controller_test.rb +9 -8
  84. data/test/functional/hosts_controller_test.rb +10 -6
  85. data/test/unit/concerns/host_managed_extensions_test.rb +17 -3
  86. data/test/unit/concerns/hostgroup_extensions_test.rb +13 -7
  87. data/test/unit/host_ansible_role_test.rb +2 -1
  88. data/test/unit/hostgroup_ansible_role_test.rb +2 -1
  89. data/test/unit/ignore_roles_test.rb +43 -0
  90. data/test/unit/import_roles_and_variables.rb +60 -0
  91. data/test/unit/services/api_roles_importer_test.rb +22 -5
  92. data/test/unit/services/fact_parser_test.rb +16 -0
  93. data/test/unit/services/inventory_creator_test.rb +15 -7
  94. data/test/unit/services/ui_roles_importer_test.rb +2 -2
  95. data/webpack/__mocks__/foremanReact/common/helpers.js +13 -0
  96. data/webpack/__mocks__/foremanReact/components/common/forms/OrderableSelect/helpers.js +5 -0
  97. data/webpack/__mocks__/foremanReact/redux/API.js +7 -0
  98. data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.js +178 -0
  99. data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.scss +9 -0
  100. data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesActions.js +39 -0
  101. data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesConstants.js +4 -0
  102. data/webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesHelpers.js +11 -0
  103. data/webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesHelpers.test.js +50 -0
  104. data/webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesImport.test.js +39 -0
  105. data/webpack/components/AnsibleRolesAndVariables/__test__/__snapshots__/AnsibleRolesAndVariablesImport.test.js.snap +177 -0
  106. data/webpack/components/AnsibleRolesAndVariables/index.js +31 -0
  107. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js +14 -18
  108. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss +1 -1
  109. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherActions.js +6 -0
  110. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherConstants.js +1 -2
  111. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherReducer.js +13 -8
  112. data/webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherSelectors.js +8 -28
  113. data/webpack/components/AnsibleRolesSwitcher/__fixtures__/ansibleRolesSwitcherReducer.fixtures.js +1 -0
  114. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcher.test.js +2 -0
  115. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherReducer.test.js +0 -8
  116. data/webpack/components/AnsibleRolesSwitcher/__tests__/AnsibleRolesSwitcherSelectors.test.js +2 -15
  117. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcher.test.js.snap +4 -9
  118. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherReducer.test.js.snap +8 -97
  119. data/webpack/components/AnsibleRolesSwitcher/__tests__/__snapshots__/AnsibleRolesSwitcherSelectors.test.js.snap +5 -30
  120. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +5 -2
  121. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleInputs.js +43 -0
  122. data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleInputs.test.js +19 -0
  123. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.js +63 -51
  124. data/webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.test.js +3 -0
  125. data/webpack/components/AnsibleRolesSwitcher/components/OrderedRolesTooltip.js +23 -0
  126. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRoleInputs.test.js.snap +51 -0
  127. data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap +28 -28
  128. data/webpack/components/AnsibleRolesSwitcher/index.js +3 -7
  129. data/webpack/index.js +6 -0
  130. metadata +55 -9
  131. data/app/views/ansible_variables/import.html.erb +0 -56
@@ -18,7 +18,10 @@ const fixtures = {
18
18
  itemCount: 2,
19
19
  onPaginationChange: noop,
20
20
  onRemoveRole: noop,
21
+ onMoveRole: noop,
21
22
  resourceName: 'host',
23
+ toDestroyRoles: [],
24
+ unassignedRoles: [],
22
25
  },
23
26
  };
24
27
 
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { translate as __ } from 'foremanReact/common/I18n';
3
+ import { Tooltip, Icon, OverlayTrigger } from 'patternfly-react';
4
+
5
+ const OrderedRolesTooltip = props => {
6
+ const tooltip = (
7
+ <Tooltip id="assigned-ansible-roles-tooltip">
8
+ <span>
9
+ {__(
10
+ 'Use drag and drop to change order of the roles. Ordering of roles is respected for Ansible runs, inherited roles are always before those assigned directly'
11
+ )}
12
+ </span>
13
+ </Tooltip>
14
+ );
15
+
16
+ return (
17
+ <OverlayTrigger overlay={tooltip} trigger={['hover', 'focus']}>
18
+ <Icon type="pf" name="info" style={{ 'margin-right': '10px' }} />
19
+ </OverlayTrigger>
20
+ );
21
+ };
22
+
23
+ export default OrderedRolesTooltip;
@@ -0,0 +1,51 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`AnsibleRoleInputs should render role to add 1`] = `
4
+ <Fragment>
5
+ <input
6
+ name="host[host_ansible_roles_attributes][14][id]"
7
+ type="hidden"
8
+ value={5}
9
+ />
10
+ <input
11
+ name="host[host_ansible_roles_attributes][14][ansible_role_id]"
12
+ type="hidden"
13
+ value={2}
14
+ />
15
+ <input
16
+ name="host[host_ansible_roles_attributes][14][position]"
17
+ type="hidden"
18
+ value={15}
19
+ />
20
+ <input
21
+ name="host[host_ansible_roles_attributes][14][_destroy]"
22
+ type="hidden"
23
+ value={false}
24
+ />
25
+ </Fragment>
26
+ `;
27
+
28
+ exports[`AnsibleRoleInputs should render role to remove 1`] = `
29
+ <Fragment>
30
+ <input
31
+ name="host[host_ansible_roles_attributes][14][id]"
32
+ type="hidden"
33
+ value={5}
34
+ />
35
+ <input
36
+ name="host[host_ansible_roles_attributes][14][ansible_role_id]"
37
+ type="hidden"
38
+ value={2}
39
+ />
40
+ <input
41
+ name="host[host_ansible_roles_attributes][14][position]"
42
+ type="hidden"
43
+ value={15}
44
+ />
45
+ <input
46
+ name="host[host_ansible_roles_attributes][14][_destroy]"
47
+ type="hidden"
48
+ value={true}
49
+ />
50
+ </Fragment>
51
+ `;
@@ -1,29 +1,17 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`AssignedRolesList should render 1`] = `
4
- <div>
4
+ <DndProvider
5
+ backend={[Function]}
6
+ >
5
7
  <ListView
6
8
  className=""
7
9
  >
8
- <div
9
- className="sticky-pagination sticky-pagination-grey"
10
- >
11
- <PaginationWrapper
12
- dropdownButtonId="assigned-ansible-roles-pagination-row-dropdown"
13
- itemCount={2}
14
- onChange={[Function]}
15
- pagination={
16
- Object {
17
- "page": 1,
18
- "perPage": 25,
19
- }
20
- }
21
- viewType="list"
22
- />
23
- </div>
24
- <AnsibleRole
10
+ <Component
25
11
  icon="fa fa-minus-circle"
12
+ index={0}
26
13
  key="1"
14
+ moveValue={[Function]}
27
15
  onClick={[Function]}
28
16
  resourceName="host"
29
17
  role={
@@ -33,9 +21,11 @@ exports[`AssignedRolesList should render 1`] = `
33
21
  }
34
22
  }
35
23
  />
36
- <AnsibleRole
24
+ <Component
37
25
  icon="fa fa-minus-circle"
26
+ index={1}
38
27
  key="2"
28
+ moveValue={[Function]}
39
29
  onClick={[Function]}
40
30
  resourceName="host"
41
31
  role={
@@ -47,18 +37,28 @@ exports[`AssignedRolesList should render 1`] = `
47
37
  />
48
38
  </ListView>
49
39
  <div>
50
- <input
40
+ <AnsibleRoleInputs
41
+ idx={0}
51
42
  key="1"
52
- name="host[ansible_role_ids][]"
53
- type="hidden"
54
- value={1}
43
+ resourceName="host"
44
+ role={
45
+ Object {
46
+ "id": 1,
47
+ "name": "fake.role",
48
+ }
49
+ }
55
50
  />
56
- <input
51
+ <AnsibleRoleInputs
52
+ idx={1}
57
53
  key="2"
58
- name="host[ansible_role_ids][]"
59
- type="hidden"
60
- value={2}
54
+ resourceName="host"
55
+ role={
56
+ Object {
57
+ "id": 2,
58
+ "name": "test.role",
59
+ }
60
+ }
61
61
  />
62
62
  </div>
63
- </div>
63
+ </DndProvider>
64
64
  `;
@@ -7,15 +7,13 @@ import AnsiblePermissionDenied from './components/AnsiblePermissionDenied';
7
7
  import withProtectedView from './components/withProtectedView';
8
8
  import {
9
9
  selectUnassignedRoles,
10
- selectAssignedRolesPage,
11
10
  selectAssignedRoles,
12
- selectAssignedRolesCount,
13
11
  selectResults,
14
12
  selectPaginationMemoized,
15
13
  selectItemCount,
16
14
  selectLoading,
17
- selectAssignedPagination,
18
15
  selectError,
16
+ selectToDestroyRoles,
19
17
  } from './AnsibleRolesSwitcherSelectors';
20
18
 
21
19
  const mapStateToProps = state => ({
@@ -24,11 +22,9 @@ const mapStateToProps = state => ({
24
22
  itemCount: selectItemCount(state),
25
23
  loading: selectLoading(state),
26
24
  error: selectError(state),
27
- assignedPagination: selectAssignedPagination(state),
28
- assignedRolesCount: selectAssignedRolesCount(state),
29
- assignedRoles: selectAssignedRolesPage(state),
30
- allAssignedRoles: selectAssignedRoles(state),
25
+ assignedRoles: selectAssignedRoles(state),
31
26
  unassignedRoles: selectUnassignedRoles(state),
27
+ toDestroyRoles: selectToDestroyRoles(state),
32
28
  });
33
29
 
34
30
  const mapDispatchToProps = dispatch =>
data/webpack/index.js CHANGED
@@ -2,6 +2,7 @@ import componentRegistry from 'foremanReact/components/componentRegistry';
2
2
  import injectReducer from 'foremanReact/redux/reducers/registerReducer';
3
3
  import ReportJsonViewer from './components/ReportJsonViewer';
4
4
  import AnsibleRolesSwitcher from './components/AnsibleRolesSwitcher';
5
+ import WrappedImportRolesAndVariables from './components/AnsibleRolesAndVariables';
5
6
  import reducer from './reducer';
6
7
 
7
8
  componentRegistry.register({
@@ -13,4 +14,9 @@ componentRegistry.register({
13
14
  type: AnsibleRolesSwitcher,
14
15
  });
15
16
 
17
+ componentRegistry.register({
18
+ name: 'WrappedImportRolesAndVariables',
19
+ type: WrappedImportRolesAndVariables,
20
+ });
21
+
16
22
  injectReducer('foremanAnsible', reducer);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.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-02-24 00:00:00.000000000 Z
11
+ date: 2021-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman_ansible_core
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: acts_as_list
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.3
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.3
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: deface
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,14 @@ dependencies:
44
58
  requirements:
45
59
  - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: 4.2.0
61
+ version: 4.4.0
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: 4.2.0
68
+ version: 4.4.0
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: ipaddress
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -104,8 +118,10 @@ files:
104
118
  - app/controllers/ui_ansible_roles_controller.rb
105
119
  - app/helpers/foreman_ansible/ansible_plugin_helper.rb
106
120
  - app/helpers/foreman_ansible/ansible_reports_helper.rb
121
+ - app/helpers/foreman_ansible/ansible_roles_data_preparations.rb
107
122
  - app/helpers/foreman_ansible/ansible_roles_helper.rb
108
123
  - app/helpers/foreman_ansible/hosts_helper_extensions.rb
124
+ - app/jobs/sync_roles_and_variables.rb
109
125
  - app/lib/actions/foreman_ansible/helpers/play_roles_description.rb
110
126
  - app/lib/proxy_api/ansible.rb
111
127
  - app/models/ansible_role.rb
@@ -128,6 +144,8 @@ files:
128
144
  - app/services/foreman_ansible/fact_importer.rb
129
145
  - app/services/foreman_ansible/fact_parser.rb
130
146
  - app/services/foreman_ansible/fact_sparser.rb
147
+ - app/services/foreman_ansible/import_roles_and_variables_error_notification.rb
148
+ - app/services/foreman_ansible/import_roles_and_variables_success_notification.rb
131
149
  - app/services/foreman_ansible/insights_notification_builder.rb
132
150
  - app/services/foreman_ansible/insights_plan_runner.rb
133
151
  - app/services/foreman_ansible/inventory_creator.rb
@@ -144,7 +162,6 @@ files:
144
162
  - app/views/ansible_roles/welcome.html.erb
145
163
  - app/views/ansible_variables/_fields.erb
146
164
  - app/views/ansible_variables/edit.html.erb
147
- - app/views/ansible_variables/import.html.erb
148
165
  - app/views/ansible_variables/index.html.erb
149
166
  - app/views/ansible_variables/new.html.erb
150
167
  - app/views/api/v2/ansible_override_values/show.json.rabl
@@ -152,6 +169,7 @@ files:
152
169
  - app/views/api/v2/ansible_roles/index.json.rabl
153
170
  - app/views/api/v2/ansible_roles/obsolete.json.rabl
154
171
  - app/views/api/v2/ansible_roles/show.json.rabl
172
+ - app/views/api/v2/ansible_roles/sync.json.rabl
155
173
  - app/views/api/v2/ansible_variables/create.json.rabl
156
174
  - app/views/api/v2/ansible_variables/destroy.json.rabl
157
175
  - app/views/api/v2/ansible_variables/import.json.rabl
@@ -169,11 +187,13 @@ files:
169
187
  - app/views/foreman_ansible/api/v2/ansible_roles/show.json.rabl
170
188
  - app/views/foreman_ansible/config_reports/_ansible.html.erb
171
189
  - app/views/foreman_ansible/config_reports/_output.html.erb
190
+ - app/views/foreman_ansible/job_templates/ansible_collections_-_install_from_galaxy.erb
172
191
  - app/views/foreman_ansible/job_templates/ansible_roles_-_ansible_default.erb
173
192
  - app/views/foreman_ansible/job_templates/ansible_roles_-_install_from_galaxy.erb
174
193
  - app/views/foreman_ansible/job_templates/ansible_roles_-_install_from_git.erb
175
194
  - app/views/foreman_ansible/job_templates/capsule_upgrade_-_ansible_default.erb
176
195
  - app/views/foreman_ansible/job_templates/configure_cloud_connector_-_ansible_default.erb
196
+ - app/views/foreman_ansible/job_templates/convert_to_rhel.erb
177
197
  - app/views/foreman_ansible/job_templates/maintenance_plan.erb
178
198
  - app/views/foreman_ansible/job_templates/module_action_-_ansible_default.erb
179
199
  - app/views/foreman_ansible/job_templates/package_action_-_ansible_default.erb
@@ -200,6 +220,8 @@ files:
200
220
  - db/migrate/20190328114657_remove_top_level_ansible_variables_setting.rb
201
221
  - db/migrate/20191010074208_remove_ansible_implementation_setting.rb
202
222
  - db/migrate/20200421201839_update_ansible_inv_template_name.rb
223
+ - db/migrate/20210120150019_add_position_to_ansible_role.rb
224
+ - db/seeds.d/100_common_parameters.rb
203
225
  - db/seeds.d/62_ansible_proxy_feature.rb
204
226
  - db/seeds.d/75_job_templates.rb
205
227
  - db/seeds.d/90_notification_blueprints.rb
@@ -252,9 +274,11 @@ files:
252
274
  - test/factories/ansible_proxy.rb
253
275
  - test/factories/ansible_roles.rb
254
276
  - test/factories/ansible_variables.rb
277
+ - test/factories/host_ansible_enhancements.rb
255
278
  - test/fixtures/insights_playbook.yaml
256
279
  - test/fixtures/report.json
257
280
  - test/fixtures/sample_facts.json
281
+ - test/foreman_ansible/helpers/ansible_roles_helper_test.rb
258
282
  - test/functional/ansible_roles_controller_test.rb
259
283
  - test/functional/ansible_variables_controller_test.rb
260
284
  - test/functional/api/v2/ansible_inventories_controller_test.rb
@@ -276,6 +300,8 @@ files:
276
300
  - test/unit/helpers/ansible_reports_helper_test.rb
277
301
  - test/unit/host_ansible_role_test.rb
278
302
  - test/unit/hostgroup_ansible_role_test.rb
303
+ - test/unit/ignore_roles_test.rb
304
+ - test/unit/import_roles_and_variables.rb
279
305
  - test/unit/lib/foreman_ansible_core/ansible_runner_test.rb
280
306
  - test/unit/lib/foreman_ansible_core/command_creator_test.rb
281
307
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
@@ -292,8 +318,20 @@ files:
292
318
  - test/unit/services/structured_fact_importer_test.rb
293
319
  - test/unit/services/ui_roles_importer_test.rb
294
320
  - webpack/__mocks__/foremanReact/common/I18n.js
321
+ - webpack/__mocks__/foremanReact/common/helpers.js
295
322
  - webpack/__mocks__/foremanReact/components/Pagination/PaginationWrapper.js
296
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
326
+ - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.js
327
+ - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariables.scss
328
+ - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesActions.js
329
+ - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesConstants.js
330
+ - webpack/components/AnsibleRolesAndVariables/AnsibleRolesAndVariablesHelpers.js
331
+ - webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesHelpers.test.js
332
+ - webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesImport.test.js
333
+ - webpack/components/AnsibleRolesAndVariables/__test__/__snapshots__/AnsibleRolesAndVariablesImport.test.js.snap
334
+ - webpack/components/AnsibleRolesAndVariables/index.js
297
335
  - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.js
298
336
  - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcher.scss
299
337
  - webpack/components/AnsibleRolesSwitcher/AnsibleRolesSwitcherActions.js
@@ -314,13 +352,17 @@ files:
314
352
  - webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js
315
353
  - webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js
316
354
  - webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleActionButton.js
355
+ - webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleInputs.js
356
+ - webpack/components/AnsibleRolesSwitcher/components/AnsibleRoleInputs.test.js
317
357
  - webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
318
358
  - webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.js
319
359
  - webpack/components/AnsibleRolesSwitcher/components/AssignedRolesList.test.js
320
360
  - webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js
321
361
  - webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.test.js
362
+ - webpack/components/AnsibleRolesSwitcher/components/OrderedRolesTooltip.js
322
363
  - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsiblePermissionDenied.test.js.snap
323
364
  - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap
365
+ - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRoleInputs.test.js.snap
324
366
  - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AssignedRolesList.test.js.snap
325
367
  - webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap
326
368
  - webpack/components/AnsibleRolesSwitcher/components/withProtectedView.js
@@ -355,15 +397,16 @@ test_files:
355
397
  - test/factories/ansible_proxy.rb
356
398
  - test/factories/ansible_variables.rb
357
399
  - test/factories/ansible_roles.rb
400
+ - test/factories/host_ansible_enhancements.rb
358
401
  - test/fixtures/insights_playbook.yaml
359
402
  - test/fixtures/report.json
360
403
  - test/fixtures/sample_facts.json
361
404
  - test/functional/ansible_roles_controller_test.rb
362
405
  - test/functional/api/v2/ansible_inventories_controller_test.rb
363
- - test/functional/api/v2/ansible_roles_controller_test.rb
364
406
  - test/functional/api/v2/ansible_variables_controller_test.rb
365
407
  - test/functional/api/v2/hostgroups_controller_test.rb
366
408
  - test/functional/api/v2/hosts_controller_test.rb
409
+ - test/functional/api/v2/ansible_roles_controller_test.rb
367
410
  - test/functional/ui_ansible_roles_controller_test.rb
368
411
  - test/functional/ansible_variables_controller_test.rb
369
412
  - test/functional/hosts_controller_test.rb
@@ -381,16 +424,19 @@ test_files:
381
424
  - test/unit/lib/foreman_ansible_core/playbook_runner_test.rb
382
425
  - test/unit/lib/proxy_api/ansible_test.rb
383
426
  - test/unit/services/ansible_report_importer_test.rb
384
- - test/unit/services/api_roles_importer_test.rb
385
427
  - test/unit/services/fact_importer_test.rb
386
- - test/unit/services/fact_parser_test.rb
387
428
  - test/unit/services/fact_sparser_test.rb
388
429
  - test/unit/services/insights_plan_runner_test.rb
389
430
  - test/unit/services/roles_importer_test.rb
390
431
  - test/unit/services/structured_fact_importer_test.rb
391
432
  - test/unit/services/ansible_variables_importer_test.rb
392
- - test/unit/services/inventory_creator_test.rb
393
433
  - test/unit/services/ui_roles_importer_test.rb
434
+ - test/unit/services/api_roles_importer_test.rb
435
+ - test/unit/services/fact_parser_test.rb
436
+ - test/unit/services/inventory_creator_test.rb
394
437
  - test/unit/ansible_provider_test.rb
395
438
  - test/unit/host_ansible_role_test.rb
396
439
  - test/unit/hostgroup_ansible_role_test.rb
440
+ - test/unit/import_roles_and_variables.rb
441
+ - test/unit/ignore_roles_test.rb
442
+ - test/foreman_ansible/helpers/ansible_roles_helper_test.rb
@@ -1,56 +0,0 @@
1
- <% title _("Changed Ansible variables") %>
2
- <%= form_tag confirm_import_ansible_variables_path do %>
3
- <h4><%= _("Select the changes you want to realize in Foreman") %></h4>
4
- <h6>
5
- <%= _("Toggle") %>:
6
- <%= link_to_function(icon_text("check", _("New")),
7
- "toggleCheckboxesBySelector('.variable_select_boxes_new')",
8
- :title => _("Check/Uncheck new")) %> |
9
- <%= link_to_function(icon_text("check", _("Obsolete")),
10
- "toggleCheckboxesBySelector('.variable_select_boxes_obsolete')",
11
- :title => _("Check/Uncheck obsolete")) %>
12
- <%= link_to_function(icon_text("check", _("Update")),
13
- "toggleCheckboxesBySelector('.variable_select_boxes_update')",
14
- :title => _("Check/Uncheck update")) %>
15
- </h6>
16
- <table class="<%= table_css_classes %>">
17
- <thead>
18
- <tr>
19
- <th class="ca">
20
- <%= link_to_function(icon_text("check"),
21
- "toggleCheckboxesBySelector('.variable_select_boxes')",
22
- :title => _("Check/Uncheck all")) %>
23
- </th>
24
- <th><%= _("Name") %></th>
25
- <th><%= _("Ansible role") %></th>
26
- <th class="col-md-2"><%= _("Hosts count") %></th>
27
- <th class="col-md-2"><%= _("Hostgroups count") %></th>
28
- <th><%= _("Operation") %></th>
29
- </tr>
30
- </thead>
31
- <tbody>
32
- <% changed.each do |kind, variables| %>
33
- <% variables.each do |variable| %>
34
- <tr>
35
- <td>
36
- <%= check_box_tag "changed[#{kind}][#{variable.ansible_role}][#{variable}]", variable.to_json, false, :class => "variable_select_boxes variable_select_boxes_#{kind} variable_select_boxes_variable_#{variable}" %>
37
- </td>
38
- <td>
39
- <%= link_to_function("#{variable}", "toggleCheckboxesBySelector('.variable_select_boxes_variable_#{variable}')", :title => _("Check/Uncheck all %s changes") % variable) %>
40
- </td>
41
- <td><%= variable.ansible_role %></td>
42
- <td><%= variable.ansible_role.hosts.count %></td>
43
- <td><%= variable.ansible_role.hostgroups.count %></td>
44
- <td>
45
- <%= { "new" => _("Add"), "obsolete" => _("Remove"), "update" => _("Update") }[kind] %>
46
- </td>
47
- </tr>
48
- <% end %>
49
- <% end %>
50
- </tbody>
51
- </table>
52
- <div>
53
- <%= link_to _("Cancel"), ansible_variables_path, :class => "btn btn-default" %>
54
- <%= submit_tag _("Update"), :class => "btn btn-primary" %>
55
- </div>
56
- <% end %>