Closed richm closed 2 years ago
Are these three use cases independent? (if any one of these cases is true, then this is a recommendation) or together (if all 3 are true).
I feel like the note, roles that require facts to be gathered should state so explicitly, or fail if undefined is the real good practice here.
Are these three use cases independent? (if any one of these cases is true, then this is a recommendation) or together (if all 3 are true).
The 3 cases are independent.
Yeah - not sure how to do this - for example, if all you want to do is make the role work when gather_facts: false
, this may or may not have anything to do with setting os/platform version specific variables. However, the primary way that roles use facts is to handle os/platform version specific conditionals (such as setting variables) (at least in the case of linux-system-roles). Any suggestions?
I feel like the note, roles that require facts to be gathered should state so explicitly, or fail if undefined is the real good practice here.
Brian C. and I discussed this at length - his point was that roles should just fail: msg: "You must use gather_facts: or setup: in order to use this role" when: distribution is not defined
- IMO that UX is not as good as the role gathering the facts it requires - and using cache plugins to cache facts to avoid gathering facts as much as possible will help in either case.
Can this be merged now? Any other issues?
Can this be merged now? Any other issues?
I'd suggest we do that in the next CoP meeting @richm EDIT: I don't see any further issues.
Approved to be merged in the ACoP meeting
Use
tasks/set_vars.yml
to set OS/platform specific vars. Using a separate file allows role integration tests to access the OS/platform specific vars. Handle the case where a user specifiesgather_facts: false
in the playbook - have the role gather only the facts it requires.