duplicate role execution with role denpendencies

44 views
Skip to first unread message

Daniel Wendler

unread,
Nov 18, 2014, 4:22:09 PM11/18/14
to ansible...@googlegroups.com
Hello,

today i try to split our grown ansible roles in more simple roles.
After do some work i realize that after rewrite and set some dependencies in our roles, some roles got executed multiple times.
So i google a bit and found an bug report (https://github.com/ansible/ansible/issues/5971) which descibe the same behavior.
The bug gets closed because of not reproducable and no further information.

So i recreate the simple test in comment nr. 4 and BAM...no duplicate running! After some testing i figured out the only difference to out plays.
The duplicate run is triggered if you add some tags to the play.

no duplicate run:
- name: role dep test sample
  hosts: is
  roles:
    - { role: base }
    - { role: feature }

PLAY [role dep test sample] ***************************************************

TASK: [base | in base] ********************************************************

ok: [fw48b] => {
    "msg": "here we are in base"
}

TASK: [feature | in feature] **************************************************

ok: [fw48b] => {
    "msg": "here we are in feature"
}

PLAY RECAP ********************************************************************

duplicate run:
- name: role dep test sample
  hosts: is
  roles:
    - { role: base, tags: base }
    - { role: feature, tags: feature }


PLAY [role dep test sample] ***************************************************

TASK: [base | in base] ********************************************************

ok: [fw48b] => {
    "msg": "here we are in base"
}

TASK: [base | in base] ********************************************************

ok: [fw48b] => {
    "msg": "here we are in base"
}

TASK: [feature | in feature] **************************************************

ok: [fw48b] => {
    "msg": "here we are in feature"
}
PLAY RECAP ********************************************************************

As we use tags to limit the runs with the "-t" switch, i can not discard this tags in our playbooks. So what can we do to workaround this behavior?
I don't know how to reopen the bug.

Toshio Kuratomi

unread,
Nov 18, 2014, 7:47:33 PM11/18/14
to ansible...@googlegroups.com
Probably best to open a new bug and link to the old bug (as you did here).

-Toshio
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f2e43e81-5b8f-4506-ab89-bbc1829b9211%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages