You could make a backup role and do something like this:

- hosts: group1
  roles:
     - { role: backup, path: 'group1' }

- hosts: group2
  roles:
     - { role: backup, path: 'group2' }

A host can be in lots of groups, so you shouldn't rely on the group_names
variable to tell you what you are looping over.

For instance, a host could be in a group based on purpose and another based
on geography.






On Fri, May 23, 2014 at 6:05 AM, Makimoto Marakatti <[email protected]>wrote:

> Brian:
> Unfortunately that yields this:
>
> changed: [hostA] => {"changed": true, "dest": "/backup/
> *0dm-sap:dev-sap:tst-sap:pre-sap:pro-sap/hostA/hostA*/root/.bash_profile",
> "md5sum": "bab9333347e752b87add49020919a078", "remote_md5sum":
> "bab9333347e752b87add49020919a078"}
>
> I also failed to make this work declaring vars and including another play.
>
> So I guess it's back to the usual: roles.
> But for this particular task, that seems so inelegant...
>
> thanks to all
>
>
>
> On Thursday, 22 May 2014 15:51:54 UTC, Brian Coca wrote:
>>
>> you can try just rewriting my_groups this way:
>>
>> my_groups: "0dm-sap:dev-sap:tst-sap:pre-sap:pro-sap"
>>
>>  --
> 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/73e4e65b-e10e-45f0-a7df-0bfe4423aa78%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/73e4e65b-e10e-45f0-a7df-0bfe4423aa78%40googlegroups.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%2BnsWgxPQNJ6L7VrZCn-2V1ONY%2BHcti7YiULciDDXK-vQf5R6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to