My module is just a template that loops on an array, where elements are users with groups belongings and sshkeys.
So, If I want to give access to all machines to sysadmins and developers the devs ones, my playbook would be: --- - hosts: all user: root vars: - user_groups: - sysadmin roles: - users - hosts: dev user: root vars: - user_groups: - development roles: - users This happens to run twice the same role, one because of all matching, and the second one the pretended one. Because of the module using a template, instead of receiving as parameters sysadmin + development, it receives once sysadmin, and next development, so it overwrites the first template with the next one. On Fri, Sep 19, 2014 at 7:25 PM, Serge van Ginderachter <se...@vanginderachter.be> wrote: > > Hi Javier, > > Perhaps you could start with explainig - for non-puppeteers here - what an > 'override' exactly is, and show some basic high level example of what you > try to accomplish? > > Serge > > On 19 September 2014 18:58, Javier Domingo Cansino <javier...@gmail.com> > wrote: >> >> Hello, >> >> First of all, I am coming from puppet. I have already done some >> experiments with ansible, and created a user management module, mainly to >> create the root Authkeys file. This was a little approach to see how >> overrides etc are handled by ansible. >> >> The result was having the module executed twice, one for the general case >> and the other for the specific one. Because of this, I wondered whether it >> would be possible to have overrides correctly done. >> >> I have read a thread asking for Ansible's hiera, and for what I >> understood, you proposed using lookups and external inventories. I see >> ansible has a different way to do stuff, but I don't understand how this >> sort of features would provide such flexibility. >> >> I would be glad if someone could help me understand how to correctly >> structure Ansible code for my use case. >> >> -- >> 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-project+unsubscr...@googlegroups.com. >> To post to this group, send email to ansible-project@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/926c5154-0a4e-4a96-95c2-9ecf09ba95f1%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/EuLmmfwZmAo/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > ansible-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/CAEhzMJBbeQBKLMgxrxVg8mqnjHjTiBia0w7%3Df3miKM4PCcNwcg%40mail.gmail.com. > > For more options, visit https://groups.google.com/d/optout. -- Javier Domingo Cansino -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALZVapmBYJ9fUHeG9R-KCt%3DYoC5QP5qz_-i6EOTNB%3DKtMz3Q9A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.