foreman_ansible 6.4.1 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v2/ansible_inventories_controller.rb +1 -1
- data/app/graphql/mutations/ansible_variable_overrides/create.rb +26 -0
- data/app/graphql/mutations/ansible_variable_overrides/delete.rb +38 -0
- data/app/graphql/mutations/ansible_variable_overrides/update.rb +26 -0
- data/app/graphql/mutations/hosts/assign_ansible_roles.rb +37 -0
- data/app/graphql/presenters/ansible_role_presenter.rb +12 -0
- data/app/graphql/presenters/overriden_ansible_variable_presenter.rb +19 -0
- data/app/graphql/types/ansible_role.rb +9 -0
- data/app/graphql/types/ansible_variable.rb +23 -0
- data/app/graphql/types/ansible_variable_override.rb +9 -0
- data/app/graphql/types/inherited_ansible_role.rb +13 -0
- data/app/graphql/types/overriden_ansible_variable.rb +27 -0
- data/app/helpers/foreman_ansible/ansible_roles_data_preparations.rb +22 -22
- data/app/models/concerns/foreman_ansible/host_managed_extensions.rb +23 -4
- data/app/models/concerns/foreman_ansible/hostgroup_extensions.rb +2 -1
- data/app/models/foreman_ansible/ansible_provider.rb +7 -5
- data/app/services/foreman_ansible/ansible_report_importer.rb +2 -2
- data/app/services/foreman_ansible/inventory_creator.rb +1 -1
- data/app/services/foreman_ansible/override_resolver.rb +22 -0
- data/app/views/api/v2/ansible_override_values/index.json.rabl +3 -0
- data/app/views/api/v2/ansible_variables/show.json.rabl +1 -1
- data/app/views/foreman_ansible/ansible_roles/_hostgroup_ansible_roles_button.erb +3 -0
- data/app/views/foreman_ansible/job_templates/convert_to_rhel.erb +6 -2
- data/app/views/foreman_ansible/job_templates/run_openscap_scans_-_ansible_default.erb +20 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20210818083407_fix_ansible_setting_category_to_dsl.rb +5 -0
- data/lib/foreman_ansible/engine.rb +0 -17
- data/lib/foreman_ansible/register.rb +115 -4
- data/lib/foreman_ansible/version.rb +1 -1
- data/package.json +4 -2
- data/test/functional/api/v2/ansible_inventories_controller_test.rb +1 -2
- data/test/graphql/mutations/hosts/assign_ansible_roles_mutation_test.rb +96 -0
- data/test/graphql/queries/ansible_roles_query_test.rb +35 -0
- data/test/unit/ansible_provider_test.rb +3 -6
- data/test/unit/concerns/host_managed_extensions_test.rb +8 -0
- data/test/unit/concerns/hostgroup_extensions_test.rb +6 -0
- data/test/unit/hostgroup_ansible_role_test.rb +13 -0
- data/test/unit/services/override_resolver_test.rb +34 -0
- data/webpack/components/AnsibleHostDetail/AnsibleHostDetail.js +51 -27
- data/webpack/components/AnsibleHostDetail/AnsibleHostDetail.test.js +12 -6
- data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.js +22 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.scss +4 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/AnsibleHostInventory.test.js +104 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleHostInventory/index.js +38 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverrides.scss +3 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTable.js +238 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/AnsibleVariableOverridesTableHelper.js +111 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.js +161 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableAction.scss +7 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableActionHelper.js +49 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValue.js +70 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/EditableValueHelper.js +35 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.fixtures.js +429 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverrides.test.js +71 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesDelete.test.js +74 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/__test__/AnsibleVariableOverridesUpdate.test.js +188 -0
- data/webpack/components/AnsibleHostDetail/components/AnsibleVariableOverrides/index.js +58 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/JobsTabHelper.js +79 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobHelper.js +106 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.js +129 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/NewRecurringJobModal.scss +7 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/PreviousJobsTable.js +103 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/RecurringJobsTable.js +96 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.fixtures.js +184 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/__test__/JobsTab.test.js +195 -0
- data/webpack/components/AnsibleHostDetail/components/JobsTab/index.js +88 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/AllRolesTable.js +89 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/AllRolesModal/index.js +80 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesForm.js +90 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModal.scss +3 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/EditRolesModalHelper.js +40 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/EditRolesModal/index.js +82 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/RolesTable.js +129 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/EditRoles.test.js +85 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.fixtures.js +180 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/__test__/RolesTab.test.js +75 -0
- data/webpack/components/AnsibleHostDetail/components/RolesTab/index.js +51 -0
- data/webpack/components/AnsibleHostDetail/components/SecondaryTabRoutes.js +60 -0
- data/webpack/components/AnsibleHostDetail/components/TabLayout.js +12 -0
- data/webpack/components/AnsibleHostDetail/constants.js +9 -0
- data/webpack/components/AnsibleHostDetail/helpers.js +4 -0
- data/webpack/components/AnsibleRolesAndVariables/__test__/AnsibleRolesAndVariablesImport.test.js +15 -10
- data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.js +29 -0
- data/webpack/components/AnsibleRolesSwitcher/components/AnsibleRole.test.js +3 -0
- data/webpack/components/AnsibleRolesSwitcher/components/AvailableRolesList.js +2 -1
- data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AnsibleRole.test.js.snap +3 -3
- data/webpack/components/AnsibleRolesSwitcher/components/__snapshots__/AvailableRolesList.test.js.snap +4 -0
- data/webpack/components/DualList/DualList.scss +3 -0
- data/webpack/components/DualList/ListControls.js +65 -0
- data/webpack/components/DualList/ListHeader.js +16 -0
- data/webpack/components/DualList/ListItem.js +69 -0
- data/webpack/components/DualList/ListPane.js +95 -0
- data/webpack/components/DualList/SelectedStatus.js +21 -0
- data/webpack/components/DualList/index.js +103 -0
- data/webpack/components/ErrorState.js +16 -0
- data/webpack/components/withLoading.js +135 -0
- data/webpack/components/withPagination.js +0 -0
- data/webpack/formHelper.js +131 -0
- data/webpack/globalIdHelper.js +13 -0
- data/webpack/global_index.js +7 -1
- data/webpack/graphql/mutations/assignAnsibleRoles.gql +17 -0
- data/webpack/graphql/mutations/cancelRecurringLogic.gql +12 -0
- data/webpack/graphql/mutations/createAnsibleVariableOverride.gql +28 -0
- data/webpack/graphql/mutations/createJobInvocation.gql +11 -0
- data/webpack/graphql/mutations/deleteAnsibleVariableOverride.gql +17 -0
- data/webpack/graphql/mutations/updateAnsibleVariableOverride.gql +29 -0
- data/webpack/graphql/queries/allAnsibleRoles.gql +13 -0
- data/webpack/graphql/queries/ansibleRoles.gql +13 -0
- data/webpack/graphql/queries/currentUserAttributes.gql +11 -0
- data/webpack/graphql/queries/hostAnsibleRoles.gql +17 -0
- data/webpack/graphql/queries/hostAvailableAnsibleRoles.gql +11 -0
- data/webpack/graphql/queries/hostVariableOverrides.gql +39 -0
- data/webpack/graphql/queries/recurringJobs.gql +28 -0
- data/webpack/helpers/pageParamsHelper.js +40 -0
- data/webpack/helpers/paginationHelper.js +9 -0
- data/webpack/permissionsHelper.js +58 -0
- data/webpack/routes/HostgroupJobs/__test__/HostgroupJobs.fixtures.js +63 -0
- data/webpack/routes/HostgroupJobs/__test__/HostgroupJobs.test.js +112 -0
- data/webpack/routes/HostgroupJobs/index.js +26 -0
- data/webpack/routes/routes.js +10 -0
- data/webpack/testHelper.js +165 -0
- data/webpack/toastHelper.js +4 -0
- metadata +127 -54
- data/app/assets/images/foreman_ansible/Ansible.png +0 -0
- data/app/models/foreman_ansible/fact_name.rb +0 -16
- data/app/models/setting/ansible.rb +0 -106
- data/app/services/foreman_ansible/fact_importer.rb +0 -99
- data/app/services/foreman_ansible/fact_parser.rb +0 -126
- data/app/services/foreman_ansible/fact_sparser.rb +0 -37
- data/app/services/foreman_ansible/operating_system_parser.rb +0 -102
- data/app/services/foreman_ansible/structured_fact_importer.rb +0 -25
- data/test/unit/services/fact_importer_test.rb +0 -52
- data/test/unit/services/fact_parser_test.rb +0 -281
- data/test/unit/services/fact_sparser_test.rb +0 -24
- data/test/unit/services/structured_fact_importer_test.rb +0 -30
- data/webpack/components/AnsibleRolesAndVariables/__test__/__snapshots__/AnsibleRolesAndVariablesImport.test.js.snap +0 -177
@@ -1,177 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`ImportRolesAndVariablesTable should render 1`] = `
|
4
|
-
<div
|
5
|
-
id="import-ansible-roles-variables"
|
6
|
-
>
|
7
|
-
<Toolbar>
|
8
|
-
<ToolbarContent
|
9
|
-
isExpanded={false}
|
10
|
-
showClearFiltersButton={false}
|
11
|
-
>
|
12
|
-
<ForwardRef
|
13
|
-
variant="icon-button-group"
|
14
|
-
>
|
15
|
-
<ToolbarItem>
|
16
|
-
<Checkbox
|
17
|
-
aria-label="select all checkbox"
|
18
|
-
className=""
|
19
|
-
id="select-all"
|
20
|
-
isChecked={false}
|
21
|
-
isDisabled={false}
|
22
|
-
isValid={true}
|
23
|
-
label="Select all"
|
24
|
-
name="select-all"
|
25
|
-
onChange={[Function]}
|
26
|
-
/>
|
27
|
-
</ToolbarItem>
|
28
|
-
</ForwardRef>
|
29
|
-
</ToolbarContent>
|
30
|
-
</Toolbar>
|
31
|
-
<Table
|
32
|
-
aria-label="import roles and variables"
|
33
|
-
borders={true}
|
34
|
-
canSelectAll={false}
|
35
|
-
canSortFavorites={true}
|
36
|
-
cells={
|
37
|
-
Array [
|
38
|
-
Object {
|
39
|
-
"title": "Name",
|
40
|
-
"transforms": Array [
|
41
|
-
[Function],
|
42
|
-
],
|
43
|
-
},
|
44
|
-
Object {
|
45
|
-
"title": "Operation",
|
46
|
-
"transforms": Array [
|
47
|
-
[Function],
|
48
|
-
],
|
49
|
-
},
|
50
|
-
Object {
|
51
|
-
"title": "Variables",
|
52
|
-
"transforms": Array [
|
53
|
-
[Function],
|
54
|
-
],
|
55
|
-
},
|
56
|
-
Object {
|
57
|
-
"title": "Hosts Count",
|
58
|
-
"transforms": Array [
|
59
|
-
[Function],
|
60
|
-
],
|
61
|
-
},
|
62
|
-
Object {
|
63
|
-
"title": "Hostgroups count",
|
64
|
-
"transforms": Array [
|
65
|
-
[Function],
|
66
|
-
],
|
67
|
-
},
|
68
|
-
]
|
69
|
-
}
|
70
|
-
className=""
|
71
|
-
contentId="expanded-content"
|
72
|
-
dropdownDirection="down"
|
73
|
-
dropdownPosition="right"
|
74
|
-
expandId="expandable-toggle"
|
75
|
-
gridBreakPoint="grid-md"
|
76
|
-
isStickyHeader={false}
|
77
|
-
onSelect={[Function]}
|
78
|
-
ouiaSafe={true}
|
79
|
-
role="grid"
|
80
|
-
rowLabeledBy="simple-node"
|
81
|
-
rows={
|
82
|
-
Array [
|
83
|
-
Object {
|
84
|
-
"cells": Array [
|
85
|
-
"bennojoy.ntp",
|
86
|
-
"Update Role Variables",
|
87
|
-
"Add: 1 Remove: 2 ",
|
88
|
-
"",
|
89
|
-
"",
|
90
|
-
],
|
91
|
-
"id": "bennojoy.ntp",
|
92
|
-
"kind": "old",
|
93
|
-
},
|
94
|
-
Object {
|
95
|
-
"cells": Array [
|
96
|
-
"0ta2.git_role",
|
97
|
-
"Import Role ",
|
98
|
-
"Add: 5 ",
|
99
|
-
"",
|
100
|
-
"",
|
101
|
-
],
|
102
|
-
"id": "0ta2.git_role",
|
103
|
-
"kind": "new",
|
104
|
-
},
|
105
|
-
]
|
106
|
-
}
|
107
|
-
selectVariant="checkbox"
|
108
|
-
variant={null}
|
109
|
-
>
|
110
|
-
<TableHeader />
|
111
|
-
<Component />
|
112
|
-
</Table>
|
113
|
-
<Pagination
|
114
|
-
className=""
|
115
|
-
defaultToFullPage={true}
|
116
|
-
firstPage={1}
|
117
|
-
isCompact={true}
|
118
|
-
isDisabled={false}
|
119
|
-
isSticky={false}
|
120
|
-
itemCount={2}
|
121
|
-
itemsEnd={null}
|
122
|
-
itemsStart={null}
|
123
|
-
offset={0}
|
124
|
-
onFirstClick={[Function]}
|
125
|
-
onLastClick={[Function]}
|
126
|
-
onNextClick={[Function]}
|
127
|
-
onPageInput={[Function]}
|
128
|
-
onPerPageSelect={[Function]}
|
129
|
-
onPreviousClick={[Function]}
|
130
|
-
onSetPage={[Function]}
|
131
|
-
ouiaSafe={true}
|
132
|
-
page={0}
|
133
|
-
perPage={5}
|
134
|
-
perPageOptions={
|
135
|
-
Array [
|
136
|
-
Object {
|
137
|
-
"title": "3",
|
138
|
-
"value": 3,
|
139
|
-
},
|
140
|
-
Object {
|
141
|
-
"title": "5",
|
142
|
-
"value": 5,
|
143
|
-
},
|
144
|
-
Object {
|
145
|
-
"title": "10",
|
146
|
-
"value": 10,
|
147
|
-
},
|
148
|
-
]
|
149
|
-
}
|
150
|
-
titles={
|
151
|
-
Object {
|
152
|
-
"paginationTitle": "top pagination",
|
153
|
-
}
|
154
|
-
}
|
155
|
-
toggleTemplate={[Function]}
|
156
|
-
variant="top"
|
157
|
-
widgetId="pagination-options-menu"
|
158
|
-
/>
|
159
|
-
<div
|
160
|
-
className="submit-cancel-btns"
|
161
|
-
>
|
162
|
-
<br />
|
163
|
-
<br />
|
164
|
-
<Button
|
165
|
-
onClick={[Function]}
|
166
|
-
variant="primary"
|
167
|
-
>
|
168
|
-
Submit
|
169
|
-
</Button>
|
170
|
-
<Button
|
171
|
-
variant="secondary"
|
172
|
-
>
|
173
|
-
Cancel
|
174
|
-
</Button>
|
175
|
-
</div>
|
176
|
-
</div>
|
177
|
-
`;
|