Skip to content

Conversation

@Nihlus
Copy link
Contributor

@Nihlus Nihlus commented Feb 28, 2025

The current logic used to match module names that should always fork has room for improvement. As exemplified by the recent addition of the FreeIPA modules, which was a rather long list, the ability to use patterns instead of exact string matches would improve readability and long-term maintainability of the mechanism.

This PR changes the module set into a set of regular expression strings and compiles them into a single joint regex that we then use to match against the module name.

@moreati
Copy link
Member

moreati commented Aug 16, 2025

Notes/random thoughts

  • Agree the long frozenset is ugly and too brittle
  • If we're changing the interface/meaning of the attribute ALWAYS_FORK_MODULES, then it's probably not worth keeping.
  • Perhaps hide implementation details behind a method like _module_requires_fork(self, modname)
  • Could it become runtime configurable? E.g. Ansible plugin option, environment variable

Sorry for the long wait to look at this. I plan to give it more attention in the next few weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DesignRequired Issues that cannot progress due to incomplete design feature Design and functional additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants