add pre and post freezser execution script execution
The users may need to be able to execute scripts/commands before and/or after freezer execution. Two options need to be implemented:
--pre-exec
-post-exec
The implementation could mean the creation of a new job. It could be the same job for both pre and post execution - it would be simpler like this. An easy way to include that job into the flow would be to expand freezer_main to include, apart from the creation and execution of the only (until now) existing job, the creation and execution of the two (pre and post) "execution" jobs.
In addition to using the new job to implement pre and post, it could be included as a new action. That would make it possible to use it as part of a list of actions.
This new feature opens the door to some security issues (execution of arbitrary code). An analysis of the consequences of this new features must be carried out.
It would be interesting (although it may be out of the scope of this new pre-post feature at this point) to include some form of conditional logic into the pre and post, even into the main action itself. That is: for instance, the post action could be, or could be not, executed, if the main action fails. Inserting complex logic at this stage may actually complicate things unnecessarily, but, still, a decision has to be made on what to do when pre, main action, or post, fail. A relatively easy solution to this would be to include two new flags, --force-action, and --force-post, that would make respectively the main action (for example: backup) be executed even if the pre fails, and the post action be executed even if the main action fails. The default behaviour, in this case, in absence of the force flags, would be to exit on error.
Blueprint information
- Status:
- Complete
- Approver:
- Fausto Marzi
- Priority:
- High
- Drafter:
- Fausto Marzi
- Direction:
- Approved
- Assignee:
- sbartel
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- sbartel
- Completed by
- sbartel
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
Add pre and post freezer execution script execution