foreman_acd 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/foreman_acd/ansible_playbooks_controller.rb +122 -0
- data/app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb +54 -0
- data/app/controllers/foreman_acd/api/v2/app_instances_controller.rb +54 -0
- data/app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb +0 -0
- data/app/controllers/foreman_acd/app_definitions_controller.rb +7 -4
- data/app/controllers/foreman_acd/app_instances_controller.rb +33 -126
- data/app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb +23 -0
- data/app/controllers/foreman_acd/concerns/app_definition_parameters.rb +1 -1
- data/app/controllers/foreman_acd/concerns/app_instance_parameters.rb +1 -1
- data/app/controllers/ui_acd_controller.rb +11 -3
- data/app/models/foreman_acd/ansible_playbook.rb +50 -0
- data/app/models/foreman_acd/app_definition.rb +2 -0
- data/app/models/foreman_acd/app_instance.rb +7 -0
- data/app/services/foreman_acd/app_configurator.rb +70 -0
- data/app/services/foreman_acd/app_deployer.rb +143 -0
- data/app/services/foreman_acd/inventory_creator.rb +67 -0
- data/app/views/foreman_acd/ansible_playbooks/_form.html.erb +21 -0
- data/app/views/foreman_acd/ansible_playbooks/edit.html.erb +3 -0
- data/app/views/foreman_acd/ansible_playbooks/index.html.erb +30 -0
- data/app/views/foreman_acd/ansible_playbooks/new.html.erb +3 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_definitions/base.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_definitions/index.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_definitions/show.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_instances/base.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_instances/index.json.rabl +3 -0
- data/app/views/foreman_acd/api/v2/app_instances/show.json.rabl +3 -0
- data/app/views/foreman_acd/app_definitions/_form.html.erb +24 -10
- data/app/views/foreman_acd/app_definitions/edit.html.erb +5 -0
- data/app/views/foreman_acd/app_instances/_form.html.erb +7 -5
- data/app/views/foreman_acd/app_instances/index.html.erb +5 -1
- data/app/views/templates/job/run_acd_ansible_playbook.erb +49 -0
- data/app/views/ui_acd/ansible_data.json.rabl +6 -0
- data/app/views/ui_acd/app.json.rabl +6 -2
- data/app/views/ui_acd/app_definition.json.rabl +1 -1
- data/app/views/ui_acd/{fdata.json.rabl → foreman_data.json.rabl} +1 -1
- data/config/routes.rb +24 -1
- data/db/migrate/20200916091018_create_ansible_playbooks.rb +20 -0
- data/db/migrate/20200917120220_add_ansible_playbook_id.rb +14 -0
- data/db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb +5 -0
- data/db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb +5 -0
- data/db/seeds.d/75-job_templates.rb +8 -0
- data/lib/foreman_acd/engine.rb +3 -0
- data/lib/foreman_acd/plugin.rb +53 -2
- data/lib/foreman_acd/version.rb +1 -1
- data/package.json +1 -1
- data/webpack/components/ApplicationDefinition/ApplicationDefinition.js +137 -22
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js +95 -11
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js +7 -2
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js +26 -0
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js +117 -21
- data/webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js +2 -0
- data/webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js +49 -0
- data/webpack/components/ApplicationDefinition/index.js +4 -0
- data/webpack/components/ApplicationInstance/ApplicationInstance.js +92 -22
- data/webpack/components/ApplicationInstance/ApplicationInstanceActions.js +37 -8
- data/webpack/components/ApplicationInstance/ApplicationInstanceConstants.js +4 -2
- data/webpack/components/ApplicationInstance/ApplicationInstanceReducer.js +98 -26
- data/webpack/components/ApplicationInstance/ApplicationInstanceSelectors.js +2 -1
- data/webpack/components/ApplicationInstance/index.js +2 -0
- data/webpack/components/ParameterSelection/ParameterSelection.js +46 -37
- data/webpack/components/ParameterSelection/ParameterSelectionActions.js +49 -52
- data/webpack/components/ParameterSelection/ParameterSelectionConstants.js +5 -3
- data/webpack/components/ParameterSelection/ParameterSelectionHelper.js +0 -32
- data/webpack/components/ParameterSelection/ParameterSelectionReducer.js +32 -16
- data/webpack/components/ParameterSelection/ParameterSelectionSelectors.js +2 -2
- data/webpack/components/ParameterSelection/index.js +4 -4
- data/webpack/components/common/DeleteTableEntry.js +1 -1
- data/webpack/reducer.js +14 -11
- metadata +48 -3
@@ -16,12 +16,6 @@ import {
|
|
16
16
|
} from 'foremanReact/common/helpers';
|
17
17
|
|
18
18
|
import {
|
19
|
-
isNewDefinition,
|
20
|
-
isEditDefinition,
|
21
|
-
isDefinition,
|
22
|
-
isNewInstance,
|
23
|
-
isEditInstance,
|
24
|
-
isInstance,
|
25
19
|
filterUsedParameterTypes,
|
26
20
|
} from './ParameterSelectionHelper';
|
27
21
|
|
@@ -35,15 +29,20 @@ import {
|
|
35
29
|
PARAMETER_SELECTION_EDIT_CHANGE,
|
36
30
|
PARAMETER_SELECTION_EDIT_CANCEL,
|
37
31
|
PARAMETER_SELECTION_SORT,
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
PARAMETER_SELECTION_PARAM_TYPE_FOREMAN,
|
33
|
+
PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
|
34
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST,
|
35
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS,
|
36
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE,
|
41
37
|
} from './ParameterSelectionConstants';
|
42
38
|
|
43
39
|
export const initParameterSelection = (
|
44
|
-
|
45
|
-
|
40
|
+
paramType,
|
41
|
+
paramDefinition,
|
46
42
|
parameters,
|
43
|
+
useDefaultValue,
|
44
|
+
allowNameAdjustment,
|
45
|
+
allowDescriptionAdjustment,
|
47
46
|
sortingFormatter,
|
48
47
|
sortableTransform,
|
49
48
|
inlineEditFormatter,
|
@@ -57,20 +56,25 @@ export const initParameterSelection = (
|
|
57
56
|
position: 0
|
58
57
|
}
|
59
58
|
};
|
60
|
-
initialState.
|
59
|
+
initialState.paramDefinition = paramDefinition;
|
61
60
|
|
62
61
|
let valueLabel = 'Value';
|
63
|
-
if (
|
62
|
+
if (useDefaultValue) {
|
64
63
|
valueLabel = 'Default value';
|
65
64
|
}
|
66
65
|
|
67
|
-
initialState.columns = [
|
68
|
-
|
66
|
+
initialState.columns = []
|
67
|
+
const addToColumns = (obj, idx) => {
|
68
|
+
obj.header.props.index = idx;
|
69
|
+
initialState.columns.push(obj);
|
70
|
+
}
|
71
|
+
|
72
|
+
let idx = 0;
|
73
|
+
addToColumns( {
|
69
74
|
property: 'name',
|
70
75
|
header: {
|
71
76
|
label: 'Name',
|
72
77
|
props: {
|
73
|
-
index: 0,
|
74
78
|
sort: true,
|
75
79
|
style: {
|
76
80
|
width: '20%'
|
@@ -81,15 +85,15 @@ export const initParameterSelection = (
|
|
81
85
|
customFormatters: [sortableHeaderCellFormatter]
|
82
86
|
},
|
83
87
|
cell: {
|
84
|
-
formatters: [
|
88
|
+
formatters: [allowNameAdjustment ? inlineEditFormatter : tableCellFormatter]
|
85
89
|
}
|
86
|
-
},
|
87
|
-
|
90
|
+
}, idx++);
|
91
|
+
|
92
|
+
addToColumns( {
|
88
93
|
property: 'description',
|
89
94
|
header: {
|
90
95
|
label: 'Description',
|
91
96
|
props: {
|
92
|
-
index: 1,
|
93
97
|
sort: true,
|
94
98
|
style: {
|
95
99
|
width: '20%'
|
@@ -103,15 +107,16 @@ export const initParameterSelection = (
|
|
103
107
|
props: {
|
104
108
|
index: 1
|
105
109
|
},
|
106
|
-
formatters: [
|
110
|
+
formatters: [allowDescriptionAdjustment ? inlineEditFormatter : tableCellFormatter]
|
107
111
|
}
|
108
|
-
},
|
109
|
-
|
112
|
+
}, idx++);
|
113
|
+
|
114
|
+
if (paramType == PARAMETER_SELECTION_PARAM_TYPE_FOREMAN) {
|
115
|
+
addToColumns( {
|
110
116
|
property: 'type',
|
111
117
|
header: {
|
112
118
|
label: 'Type',
|
113
119
|
props: {
|
114
|
-
index: 2,
|
115
120
|
sort: true,
|
116
121
|
style: {
|
117
122
|
width: '20%'
|
@@ -126,13 +131,14 @@ export const initParameterSelection = (
|
|
126
131
|
// the well formatted type name is shown
|
127
132
|
formatters: [inlineEditFormatter]
|
128
133
|
}
|
129
|
-
},
|
130
|
-
|
134
|
+
}, idx++);
|
135
|
+
}
|
136
|
+
|
137
|
+
addToColumns( {
|
131
138
|
property: 'value',
|
132
139
|
header: {
|
133
140
|
label: valueLabel,
|
134
141
|
props: {
|
135
|
-
index: 3,
|
136
142
|
sort: true,
|
137
143
|
style: {
|
138
144
|
width: '20%'
|
@@ -145,13 +151,13 @@ export const initParameterSelection = (
|
|
145
151
|
cell: {
|
146
152
|
formatters: [inlineEditFormatter]
|
147
153
|
}
|
148
|
-
},
|
149
|
-
|
154
|
+
}, idx++);
|
155
|
+
|
156
|
+
addToColumns( {
|
150
157
|
property: 'actions',
|
151
158
|
header: {
|
152
159
|
label: 'Actions',
|
153
160
|
props: {
|
154
|
-
index: 4,
|
155
161
|
style: {
|
156
162
|
width: '20%'
|
157
163
|
}
|
@@ -161,21 +167,11 @@ export const initParameterSelection = (
|
|
161
167
|
cell: {
|
162
168
|
formatters: [inlineEditButtonsFormatter]
|
163
169
|
}
|
164
|
-
}
|
165
|
-
];
|
170
|
+
}, idx++);
|
166
171
|
|
167
|
-
|
168
|
-
initialState.parameters = [];
|
169
|
-
} else if ((isEditDefinition(mode)) || (isInstance(mode))) {
|
170
|
-
initialState.parameters = parameters;
|
171
|
-
initialState.hostgroupId = serviceDefinition.hostgroup_id;
|
172
|
-
} else {
|
173
|
-
// FIXME: should never ever happen
|
174
|
-
}
|
172
|
+
initialState.parameters = parameters;
|
175
173
|
|
176
|
-
if (
|
177
|
-
initialState.parameterTypes = PARAMETER_SELECTION_TYPES;
|
178
|
-
} else {
|
174
|
+
if ((paramType == PARAMETER_SELECTION_PARAM_TYPE_FOREMAN) && (parameters)) {
|
179
175
|
initialState.parameterTypes = filterUsedParameterTypes(PARAMETER_SELECTION_TYPES, parameters);
|
180
176
|
}
|
181
177
|
|
@@ -244,22 +240,23 @@ export const sortParameter = (selectedColumn, defaultSortingOrder) => ({
|
|
244
240
|
},
|
245
241
|
});
|
246
242
|
|
247
|
-
export const
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
dispatch({ type: PARAMETER_SELECTION_LOAD_FOREMAN_DATA_REQUEST, payload: { clearParameters: additionalData.clearParameters } });
|
243
|
+
export const loadParamData = (attr) => dispatch => {
|
244
|
+
dispatch( { type: PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST, payload: { dataType: attr.dataType, clearParameters: attr.clearParameters } });
|
245
|
+
|
246
|
+
let realUrl = attr.url.replace("__id__", attr.paramDefinition.dataId);
|
252
247
|
|
253
|
-
|
248
|
+
if (attr.paramDefinition.hasOwnProperty('dataSubId')) {
|
249
|
+
realUrl = realUrl.replace("__subid__", attr.paramDefinition.dataSubId);
|
250
|
+
}
|
254
251
|
|
255
252
|
return api
|
256
253
|
.get(realUrl, {}, {})
|
257
254
|
.then(({ data }) =>
|
258
255
|
dispatch({
|
259
|
-
type:
|
260
|
-
payload: data,
|
256
|
+
type: PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS,
|
257
|
+
payload: { ...data, dataType: attr.dataType }
|
261
258
|
})
|
262
259
|
)
|
263
|
-
.catch(error => dispatch(errorHandler(
|
260
|
+
.catch(error => dispatch(errorHandler(PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE, error)));
|
264
261
|
};
|
265
262
|
|
@@ -6,9 +6,11 @@ export const PARAMETER_SELECTION_EDIT_CONFIRM = 'PARAMETER_SELECTION_EDIT_CONFIR
|
|
6
6
|
export const PARAMETER_SELECTION_EDIT_CHANGE = 'PARAMETER_SELECTION_EDIT_CHANGE';
|
7
7
|
export const PARAMETER_SELECTION_EDIT_CANCEL = 'PARAMETER_SELECTION_EDIT_CANCEL';
|
8
8
|
export const PARAMETER_SELECTION_SORT = 'PARAMETER_SELECTION_SORT';
|
9
|
-
export const
|
10
|
-
export const
|
11
|
-
export const
|
9
|
+
export const PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST = 'PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST';
|
10
|
+
export const PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS = 'PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS';
|
11
|
+
export const PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE = 'PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE';
|
12
|
+
export const PARAMETER_SELECTION_PARAM_TYPE_FOREMAN = 'PARAMETER_SELECTION_PARAM_TYPE_FOREMAN';
|
13
|
+
export const PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE = 'PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE';
|
12
14
|
|
13
15
|
// Make sure the object is sorted by value
|
14
16
|
// (Compute Profile -> Partition table -> Root password)
|
@@ -2,38 +2,6 @@ import {
|
|
2
2
|
cloneDeep,
|
3
3
|
} from 'lodash';
|
4
4
|
|
5
|
-
export const isNewDefinition = (mode) => {
|
6
|
-
if (mode == "newDefinition")
|
7
|
-
return true;
|
8
|
-
return false;
|
9
|
-
}
|
10
|
-
|
11
|
-
export const isEditDefinition = (mode) => {
|
12
|
-
if (mode == "editDefinition")
|
13
|
-
return true;
|
14
|
-
return false;
|
15
|
-
}
|
16
|
-
|
17
|
-
export const isDefinition = (mode) => {
|
18
|
-
return (isNewDefinition(mode) || isEditDefinition(mode))
|
19
|
-
}
|
20
|
-
|
21
|
-
export const isNewInstance = (mode) => {
|
22
|
-
if (mode == "newInstance")
|
23
|
-
return true;
|
24
|
-
return false;
|
25
|
-
}
|
26
|
-
|
27
|
-
export const isEditInstance = (mode) => {
|
28
|
-
if (mode == "editInstance")
|
29
|
-
return true;
|
30
|
-
return false;
|
31
|
-
}
|
32
|
-
|
33
|
-
export const isInstance = (mode) => {
|
34
|
-
return (isNewInstance(mode) || isEditInstance(mode))
|
35
|
-
}
|
36
|
-
|
37
5
|
export const transformForemanData = (fdata) => {
|
38
6
|
if (fdata === undefined) {
|
39
7
|
return "";
|
@@ -22,9 +22,11 @@ import {
|
|
22
22
|
PARAMETER_SELECTION_EDIT_CHANGE,
|
23
23
|
PARAMETER_SELECTION_EDIT_CANCEL,
|
24
24
|
PARAMETER_SELECTION_SORT,
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
PARAMETER_SELECTION_PARAM_TYPE_FOREMAN,
|
26
|
+
PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE,
|
27
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST,
|
28
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS,
|
29
|
+
PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE,
|
28
30
|
} from './ParameterSelectionConstants';
|
29
31
|
|
30
32
|
import {
|
@@ -127,18 +129,26 @@ const parameterSelectionParameters = (state = initialState, action) => {
|
|
127
129
|
})
|
128
130
|
);
|
129
131
|
}
|
130
|
-
case
|
132
|
+
case PARAMETER_SELECTION_LOAD_PARAM_DATA_FAILURE: {
|
131
133
|
return state.merge({
|
132
134
|
error: payload.error,
|
133
135
|
loading: false
|
134
136
|
});
|
135
137
|
}
|
136
|
-
case
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
138
|
+
case PARAMETER_SELECTION_LOAD_PARAM_DATA_REQUEST: {
|
139
|
+
let newState = {};
|
140
|
+
|
141
|
+
if (payload.dataType == PARAMETER_SELECTION_PARAM_TYPE_FOREMAN) {
|
142
|
+
newState = {
|
143
|
+
paramData: {},
|
144
|
+
hostgroupId: -1,
|
145
|
+
loading: true
|
146
|
+
};
|
147
|
+
} else if (payload.dataType == PARAMETER_SELECTION_PARAM_TYPE_ANSIBLE) {
|
148
|
+
newState = {
|
149
|
+
loading: true
|
150
|
+
};
|
151
|
+
}
|
142
152
|
|
143
153
|
if (payload.clearParameters === true) {
|
144
154
|
Object.assign(newState, { parameters: [] });
|
@@ -146,12 +156,18 @@ const parameterSelectionParameters = (state = initialState, action) => {
|
|
146
156
|
|
147
157
|
return state.merge(newState);
|
148
158
|
}
|
149
|
-
case
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
159
|
+
case PARAMETER_SELECTION_LOAD_PARAM_DATA_SUCCESS: {
|
160
|
+
let newState = {};
|
161
|
+
|
162
|
+
if (payload.dataType == PARAMETER_SELECTION_PARAM_TYPE_FOREMAN) {
|
163
|
+
newState = {
|
164
|
+
loading: false,
|
165
|
+
paramData: payload,
|
166
|
+
hostgroupId: payload.hostgroup_id,
|
167
|
+
};
|
168
|
+
}
|
169
|
+
|
170
|
+
return state.merge(newState);
|
155
171
|
}
|
156
172
|
case APPLICATION_DEFINITION_PARAMETER_SELECTION_MODAL_CLOSE: {
|
157
173
|
const parameters = cloneDeep(state.parameters);
|
@@ -2,10 +2,10 @@ const parameterState = state => state.foremanAcd.parameterSelectionParameters;
|
|
2
2
|
|
3
3
|
export const selectLoading = state => parameterState(state).loading;
|
4
4
|
export const selectEditMode = state => parameterState(state).editMode;
|
5
|
-
export const
|
5
|
+
export const selectParamData = state => parameterState(state).paramData;
|
6
6
|
export const selectParameterTypes = state => parameterState(state).parameterTypes;
|
7
7
|
export const selectParameters = state => parameterState(state).parameters;
|
8
8
|
export const selectSortingColumns = state => parameterState(state).sortingColumns;
|
9
9
|
export const selectColumns = state => parameterState(state).columns;
|
10
|
-
export const
|
10
|
+
export const selectParamDefinition = state => parameterState(state).paramDefinition;
|
11
11
|
export const selectHostgroupId = state => parameterState(state).hostgroupId;
|
@@ -8,23 +8,23 @@ import * as ParameterSelectionActions from './ParameterSelectionActions';
|
|
8
8
|
import {
|
9
9
|
selectLoading,
|
10
10
|
selectEditMode,
|
11
|
-
|
11
|
+
selectParamData,
|
12
12
|
selectParameterTypes,
|
13
13
|
selectParameters,
|
14
14
|
selectSortingColumns,
|
15
15
|
selectColumns,
|
16
|
-
|
16
|
+
selectParamDefinition,
|
17
17
|
} from './ParameterSelectionSelectors';
|
18
18
|
|
19
19
|
const mapStateToProps = state => ({
|
20
20
|
loading: selectLoading(state),
|
21
21
|
editMode: selectEditMode(state),
|
22
|
-
|
22
|
+
paramData: selectParamData(state),
|
23
23
|
parameterTypes: selectParameterTypes(state),
|
24
24
|
parameters: selectParameters(state),
|
25
25
|
sortingColumns: selectSortingColumns(state),
|
26
26
|
columns: selectColumns(state),
|
27
|
-
|
27
|
+
paramDefinition: selectParamDefinition(state),
|
28
28
|
});
|
29
29
|
|
30
30
|
const mapDispatchToProps = dispatch =>
|
@@ -23,7 +23,7 @@ const DeleteTableEntry = ({
|
|
23
23
|
disabled={disabled}
|
24
24
|
onClick={() => window.confirm("Are you sure you wish to delete this item?") && onDeleteTableEntry(additionalData) }
|
25
25
|
>
|
26
|
-
<Icon type="pf" name="delete" />
|
26
|
+
<Icon type="pf" name="delete" title="delete entry" />
|
27
27
|
</Button>
|
28
28
|
</span>
|
29
29
|
);
|
data/webpack/reducer.js
CHANGED
@@ -1,9 +1,4 @@
|
|
1
1
|
import { combineReducers } from 'redux';
|
2
|
-
import {
|
3
|
-
cloneDeep,
|
4
|
-
findIndex,
|
5
|
-
findLastIndex,
|
6
|
-
} from 'lodash';
|
7
2
|
|
8
3
|
import parameterSelectionParameters from './components/ParameterSelection/ParameterSelectionReducer';
|
9
4
|
import applicationDefinitionConf from './components/ApplicationDefinition/ApplicationDefinitionReducer';
|
@@ -11,11 +6,13 @@ import applicationInstanceConf from './components/ApplicationInstance/Applicatio
|
|
11
6
|
import applicationInstanceReport from './components/ApplicationInstanceReport/ApplicationInstanceReportReducer';
|
12
7
|
|
13
8
|
import {
|
14
|
-
|
9
|
+
APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
|
10
|
+
APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
|
15
11
|
} from './components/ApplicationDefinition/ApplicationDefinitionConstants';
|
16
12
|
|
17
13
|
import {
|
18
|
-
|
14
|
+
APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE,
|
15
|
+
APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE,
|
19
16
|
} from './components/ApplicationInstance/ApplicationInstanceConstants';
|
20
17
|
|
21
18
|
const rootReducer = (state = {}, action) => {
|
@@ -23,13 +20,19 @@ const rootReducer = (state = {}, action) => {
|
|
23
20
|
const param_state = parameterSelectionParameters(state.parameterSelectionParameters, action);
|
24
21
|
const app_ins_report_state = applicationInstanceReport(state.applicationInstanceReport, action);
|
25
22
|
|
26
|
-
if (action.type ==
|
27
|
-
action.payload.
|
23
|
+
if (action.type == APPLICATION_DEFINITION_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE) {
|
24
|
+
action.payload.parameterSelection = param_state.parameters;
|
25
|
+
}
|
26
|
+
if (action.type == APPLICATION_DEFINITION_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE) {
|
27
|
+
action.payload.parameterSelection = param_state.parameters;
|
28
28
|
}
|
29
29
|
const app_def_state = applicationDefinitionConf(state.applicationDefinitionConf, action);
|
30
30
|
|
31
|
-
if (action.type ==
|
32
|
-
action.payload.
|
31
|
+
if (action.type == APPLICATION_INSTANCE_FOREMAN_PARAMETER_SELECTION_MODAL_CLOSE) {
|
32
|
+
action.payload.parameterSelection = param_state.parameters;
|
33
|
+
}
|
34
|
+
if (action.type == APPLICATION_INSTANCE_ANSIBLE_PARAMETER_SELECTION_MODAL_CLOSE) {
|
35
|
+
action.payload.parameterSelection = param_state.parameters;
|
33
36
|
}
|
34
37
|
const app_ins_state = applicationInstanceConf(state.applicationInstanceConf, action);
|
35
38
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_acd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.80.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: foreman_remote_execution
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.3.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.3.0
|
27
41
|
description: Foreman plugin to provide application centric deployment and self service
|
28
42
|
portal
|
29
43
|
email:
|
@@ -36,16 +50,38 @@ files:
|
|
36
50
|
- README.md
|
37
51
|
- Rakefile
|
38
52
|
- app/assets/javascripts/foreman_acd/acd_dummy.js
|
53
|
+
- app/controllers/foreman_acd/ansible_playbooks_controller.rb
|
54
|
+
- app/controllers/foreman_acd/api/v2/ansible_playbooks_controller.rb
|
39
55
|
- app/controllers/foreman_acd/api/v2/app_definitions_controller.rb
|
56
|
+
- app/controllers/foreman_acd/api/v2/app_instances_controller.rb
|
57
|
+
- app/controllers/foreman_acd/api/v2/app_playbooks_controller.rb
|
40
58
|
- app/controllers/foreman_acd/api/v2/base_controller.rb
|
41
59
|
- app/controllers/foreman_acd/app_definitions_controller.rb
|
42
60
|
- app/controllers/foreman_acd/app_instances_controller.rb
|
43
61
|
- app/controllers/foreman_acd/application_controller.rb
|
62
|
+
- app/controllers/foreman_acd/concerns/ansible_playbook_parameters.rb
|
44
63
|
- app/controllers/foreman_acd/concerns/app_definition_parameters.rb
|
45
64
|
- app/controllers/foreman_acd/concerns/app_instance_parameters.rb
|
46
65
|
- app/controllers/ui_acd_controller.rb
|
66
|
+
- app/models/foreman_acd/ansible_playbook.rb
|
47
67
|
- app/models/foreman_acd/app_definition.rb
|
48
68
|
- app/models/foreman_acd/app_instance.rb
|
69
|
+
- app/services/foreman_acd/app_configurator.rb
|
70
|
+
- app/services/foreman_acd/app_deployer.rb
|
71
|
+
- app/services/foreman_acd/inventory_creator.rb
|
72
|
+
- app/views/foreman_acd/ansible_playbooks/_form.html.erb
|
73
|
+
- app/views/foreman_acd/ansible_playbooks/edit.html.erb
|
74
|
+
- app/views/foreman_acd/ansible_playbooks/index.html.erb
|
75
|
+
- app/views/foreman_acd/ansible_playbooks/new.html.erb
|
76
|
+
- app/views/foreman_acd/api/v2/ansible_playbooks/base.json.rabl
|
77
|
+
- app/views/foreman_acd/api/v2/ansible_playbooks/index.json.rabl
|
78
|
+
- app/views/foreman_acd/api/v2/ansible_playbooks/show.json.rabl
|
79
|
+
- app/views/foreman_acd/api/v2/app_definitions/base.json.rabl
|
80
|
+
- app/views/foreman_acd/api/v2/app_definitions/index.json.rabl
|
81
|
+
- app/views/foreman_acd/api/v2/app_definitions/show.json.rabl
|
82
|
+
- app/views/foreman_acd/api/v2/app_instances/base.json.rabl
|
83
|
+
- app/views/foreman_acd/api/v2/app_instances/index.json.rabl
|
84
|
+
- app/views/foreman_acd/api/v2/app_instances/show.json.rabl
|
49
85
|
- app/views/foreman_acd/app_definitions/_form.html.erb
|
50
86
|
- app/views/foreman_acd/app_definitions/edit.html.erb
|
51
87
|
- app/views/foreman_acd/app_definitions/import.html.erb
|
@@ -57,17 +93,24 @@ files:
|
|
57
93
|
- app/views/foreman_acd/app_instances/index.html.erb
|
58
94
|
- app/views/foreman_acd/app_instances/new.html.erb
|
59
95
|
- app/views/foreman_acd/app_instances/report.html.erb
|
96
|
+
- app/views/templates/job/run_acd_ansible_playbook.erb
|
97
|
+
- app/views/ui_acd/ansible_data.json.rabl
|
60
98
|
- app/views/ui_acd/app.json.rabl
|
61
99
|
- app/views/ui_acd/app_definition.json.rabl
|
62
100
|
- app/views/ui_acd/computeprofile.json.rabl
|
63
101
|
- app/views/ui_acd/domain.json.rabl
|
64
102
|
- app/views/ui_acd/environment.json.rabl
|
65
|
-
- app/views/ui_acd/
|
103
|
+
- app/views/ui_acd/foreman_data.json.rabl
|
66
104
|
- app/views/ui_acd/lifecycle_environment.json.rabl
|
67
105
|
- app/views/ui_acd/ptable.json.rabl
|
68
106
|
- config/routes.rb
|
69
107
|
- db/migrate/20190610202252_create_app_definitions.rb
|
70
108
|
- db/migrate/20190625140305_create_app_instances.rb
|
109
|
+
- db/migrate/20200916091018_create_ansible_playbooks.rb
|
110
|
+
- db/migrate/20200917120220_add_ansible_playbook_id.rb
|
111
|
+
- db/migrate/20201016002819_add_ansible_vars_all_to_app_definitions.rb
|
112
|
+
- db/migrate/20201016104338_add_ansible_vars_all_to_app_instances.rb
|
113
|
+
- db/seeds.d/75-job_templates.rb
|
71
114
|
- lib/foreman_acd.rb
|
72
115
|
- lib/foreman_acd/engine.rb
|
73
116
|
- lib/foreman_acd/plugin.rb
|
@@ -90,8 +133,10 @@ files:
|
|
90
133
|
- webpack/components/ApplicationDefinition/ApplicationDefinition.scss
|
91
134
|
- webpack/components/ApplicationDefinition/ApplicationDefinitionActions.js
|
92
135
|
- webpack/components/ApplicationDefinition/ApplicationDefinitionConstants.js
|
136
|
+
- webpack/components/ApplicationDefinition/ApplicationDefinitionHelper.js
|
93
137
|
- webpack/components/ApplicationDefinition/ApplicationDefinitionReducer.js
|
94
138
|
- webpack/components/ApplicationDefinition/ApplicationDefinitionSelectors.js
|
139
|
+
- webpack/components/ApplicationDefinition/components/AnsiblePlaybookSelector.js
|
95
140
|
- webpack/components/ApplicationDefinition/index.js
|
96
141
|
- webpack/components/ApplicationInstance/ApplicationInstance.js
|
97
142
|
- webpack/components/ApplicationInstance/ApplicationInstance.scss
|