foreman-ansible-modules icon indicating copy to clipboard operation
foreman-ansible-modules copied to clipboard

[RFE] Allow to run sync plan

Open myllynen opened this issue 1 year ago • 2 comments

It would be helpful to be able to run sync plan(s) using Ansible like it is possible from the Web UI. For instance, it would be easier to define which sync plans to run than iterate over plenty of repos which are probably already defined as part of sync plans. Thanks.

myllynen avatar Sep 06 '22 12:09 myllynen

Architecturally, I think I'd disagree, but that doesn't mean we should not have a way to trigger sync plan runs. :)

I think, ideally, one should either use sync plans OR ansible to do syncs. The repository_sync module can do bulk syncs for products (when you omit the repository parameter), which makes a quite nice interface for a job in AWX/Jenkins/whatever. In that case, the actual scheduling is delegated and you don't need any sync plan at all. On the other hand, if you have a sync plan defined (using the sync_plan module or however else), that is responsible for the main schedule, and in the odd case you need an out-of-schedule sync, you can trigger that in the UI.

Again, not saying I'd not add such a module, just consider the alternatives for the actual workflow ;)

evgeni avatar Sep 06 '22 14:09 evgeni

Thanks for looking into this.

Good point wrt omitting the repository parameter, I hadn't noticed that. I was thinking a case where an organization is used to do monthly updates to clients and syncs content weekly, except when there's e.g. critical RHEL security fix needed. Then they go 'oh, shoot, we must sync our RHEL repos right away and publish the update' in which case it, in theory, might be nice to have a way to initiate the sync plan for RHEL related repos and ignore possible other products. Using Web UI would certainly work but perhaps there are orgs trying to do everything programmatically.

This is certainly in the nice-to-have category. Thanks.

myllynen avatar Sep 07 '22 07:09 myllynen