> 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.

Well that was why I was using "my_groups". I do have a lot of groups in the 
inventory...

Your suggestion seems to be like something that could work. I'll try to 
adapt that and report back.

Thanks!

On Friday, 23 May 2014 12:47:34 UTC, Michael DeHaan wrote:
>
> 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 
> <maki...@gmail.com<javascript:>
> > 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 ansible-proje...@googlegroups.com <javascript:>.
>> To post to this group, send email to ansible...@googlegroups.com<javascript:>
>> .
>> 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 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/62e08e35-3438-4d12-a536-745056526a2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to