stdevel / katprep

Python toolkit for automating system maintenance and generating patch reports along with Foreman/Katello and Red Hat Satellite 6.x
GNU General Public License v3.0
35 stars 6 forks source link

Implement pre/post scripts #123

Open stdevel opened 4 years ago

stdevel commented 4 years ago

Is your feature request related to a problem? Please describe. It would be great to have the possibility to run pre/post scripts before/after system maintenance (e.g. in order to stop/start applications).

Describe the solution you'd like The workflow could look like this:

  1. katprep maintenance is started
  2. pre script is executed
  3. Patches and package upgrades are installed
  4. post script is executed
  5. System might be rebooted
  6. Maintenance is completed

Describe alternatives you've considered

Additional context Pre-/post scripts are assigned to hosts or hostgroups using key-value pairs (Uyuni: Custom Info Key, Foreman: Host Parameter):

It is possible to assign multiple scripts devided by newline, an URL needs to be supplied. The scripts are downloaded via Remote Execution (Foreman) or Remote Command (Uyuni) When a pre-script fails, system maintenance will not be executed. When multiple scripts are executed and one fails, remaining scripts are not executed, too. When maintenance fails, post scripts will not be run.

stdevel commented 2 years ago

Investigating in branch 44-feat-pre_post_scripts.