Comment 1 for bug 1471746

Revision history for this message
Serge van Ginderachter (svg) wrote :

I would not go as far to say that is an anti-pattern. The construct "when: inventory_hostname in groups[somegroup]" is used quite often in the community, and lots of contributors and core-developers propose it as a solution pattern.

It is true however that this makes a role dependent of a specific group name, which at the very least should be explicitly documented, which could address this concern when the role is published for re-use outside of OSAD.

So far I do not see an easy and clean alternative way for this. I do hope that this kind of things might be addressed in Ansible when the inventory will get a major update, which AFAIK is planned post the v2.0 release. It might be useful to give this kind of feedback to upstream Ansible, though currently it might be a bit early for that.