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

Add repo sync option

Open willtome opened this issue 4 years ago • 4 comments

This PR adds the option sync to the repositories data structure to allow for an on-demand sync of a product when it is enabled. I believe this should be added to the current repositories role because it uses the same variable. The default behavior is not to sync. If sync: true the repos for that product will be synced. This is achieved using async operations so that multiple repos can be synced simultaneously.

closes #1119

willtome avatar Jan 11 '21 20:01 willtome

There was a discussion, at length, in the original role PR (https://github.com/theforeman/foreman-ansible-modules/pull/1027) around this. In that PR, we avoided this as we landed on introducing a role for syncing rather than baking it into the repositories role. That would avoid duplicated logic (as a role for syncing is certainly useful) and would allow users to compose functionality to their desire. And the repositories role could potentially import the role if we went that route DRYing things up.

ehelms avatar Jan 12 '21 13:01 ehelms

@ehelms updated PR to introduce a new role rather than an extension to the existing role.

willtome avatar Jan 18 '21 19:01 willtome

AI: @evgeni wants to link the old issue where the async style broke things

evgeni avatar Jan 19 '21 15:01 evgeni

Hey @willtome,

we had the async: 9999, poll: 0 code as an example in the repository_sync module before, and have removed it (#838, #845) because we had reports that doing this with more than a few repositories would overload the system.

Is there a possibility to batch those syncs better? Like "only do X" at a time?

evgeni avatar Jan 20 '21 09:01 evgeni