Here's a little further improvement that I have, so that I don't need the
condition on the role dependency. I move all the common role tasks to
roles/common/tasks/common.yml, and then my roles/common/tasks/main.yml is
just this:
---
- include: common.yml
when: common_has_run is not defined
-
Very nice approach. FWIW here is how I've been doing it and it works,
thanks to Nathan.
/roles/common/tasks/main.yml (at the very end):
- name: 'Common | Remember that this role had been run'
set_fact: role_common_completed=true
/roles/OTHERS/meta/main.yml
dependencies:
- { role: common, whe
Yeah so what Nathan's said is this:
- hosts: all
roles:
- common
- hosts: other
roles:
- foo
- hosts: more
roles:
- bar
- baz
And if you want to just run hosts in the group "more", you can do that with
"--limit more"
On Thu, Dec 5, 2013 at 5:31 PM, James Cammarata wro
Jürgen, the allow_duplicates setting, along with all role data, is
per-play. Whether it was included or not is tracked in the play itself, not
per-host, so getting that information to persist across plays within a
playbook would be tricky when each play included different host lists.
Nathan's solu
I ended up having my common role use set_fact on its first run, then it
gets skipped on subsequent runs based on that fact, but it's not an ideal
solution. I'd be interested in a better answer for this as well.
Nathan
On Thursday, 5 December 2013 07:40:28 UTC-8, Jürgen Haas wrote:
>
> According