It is getting to the point where I should have a library or register a var which constructs this. However, it doesn’t
look as though a library has access to hostvars, unless explicitly passed in, and I can’t figure out how I could
register a var, that simply constructs this string.
Having the string constructed is necessary, to keep the manual configuration to a minimum, but I’m not sure how
to tackle such an issue. Sure, I can leave it as is, but it feels like I should clean up the duplication now that I’ve done
it three times in three diff places.
Having the jinja templates construct strings feels a bit naughty. Especially when I am copy pasting code into different templates.
I was hoping a module would be able to deal with iterating over a given group, constructing the string/list, and returning it and/or registering a fact.
That type of code feels like it should be in python vs a template. I attempted to pass the result of groups[‘ROLE’] to a module, but they can
only accept strings.
Anyways, I added some use cases [1] for what we are doing. Was hoping for some reasonable feedback on ways of improving this.