Generally people should write roles so that they are idempotent (grr, that word again) and running them more than one time is a no-op.
If the operation is very destructive and you don't want to run it again, maybe consider a touch file to indicate the configuration has been done once. I do understand what you mean about not being a dependency anywhere, but because ansible allows parameterized roles as dependencies, this would also remove some other use cases if we applied it globally. Some roles might allow deps, others might not, etc. The role gets to pick. On Wed, Jul 16, 2014 at 8:04 PM, Ahmad Khayyat <[email protected]> wrote: > On Thu, Jul 17, 2014 at 2:53 AM, Michael DeHaan <[email protected]> > wrote: > > Take a look at the "allow_duplicates" parameter. >> >> http://docs.ansible.com/playbooks_roles.html#id8 >> > This does not solve my problem. > > I’m happy with the default (allow_duplicates=no). My issue is that it > only prevents the same role from executing multiple times *as a > dependency*. If the same role is also listed somewhere in the playbook > (in addition to being a dependency), allow_duplicates is irrelevant > (currently). > > I am looking for the equivalent of having allow_duplicates affect that > role everywhere, whether it is being executed as a dependency, or > explicitly due to being listed in a play. > > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CAM19uTCNcd7aCkn44RZRtctnxf3dOt8KCUodQw_buMvQO_Puig%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAM19uTCNcd7aCkn44RZRtctnxf3dOt8KCUodQw_buMvQO_Puig%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwfB40jHZ_nYo6_9_R81T2eruTH7zFf4vfoB9qUubHVsA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
