Hi,

I was hoping to get more details from you regarding this issue. I 
appreciate what you're trying to do at Ansible's level, but what's going to 
do the data transfer? If it's rsync, then I would like to propose a new 
approach to this, but if it's not, I need to know before I can write some 
example code for you.

Cheers,

Mike.

On Tuesday, 27 January 2015 22:43:46 UTC, Tadej Janež wrote:

> Hi! 
>
> Just a quick ping. Does anyone have any idea how I could solve the 
> problem described below? Maybe a work-around? 
>
> Thanks and best regards, 
> Tadej 
>
> On Thu, 2015-01-22 at 01:29 -0800, Tadej Janež wrote: 
> > Hi! 
> > 
> > I'm trying to develop a simple backup solution with Ansible. 
> > 
> > My inventory file contains: 
> > [backup-hosts] 
> > backup-host1 
> > backup-host2 
> > 
> > [backup-targets] 
> > backup-target1 
> > backup-target2 
> > backup-target3 
> > backup-target4 
> > 
> > Each backup-target has a host_vars file with contents similar to the 
> > following: 
> > # list of users and their directories that should be backed up 
> > backup_target_users_dirs: 
> >   - user: "alice" 
> >     dirs: 
> >       - "Maildir" 
> >       - "Important" 
> >   - user: "bob" 
> >     dirs: 
> >       - "Maildir" 
> >       - "ProjectX" 
> > 
> > I have a role that is played on each backup-host that contains 
> > a task to prepare directories for each backup target: 
> > 
> > - name: prepare directories for each backup target 
> >   file: 
> >     path: "~/{{ item[0] }}/{{ item[1]['dir'] }}" 
> >     state: directory 
> >   sudo: yes 
> >   sudo_user: "{{ backup_host_user }}" 
> >   with_nested: 
> >     - groups["backup-targets"] 
> >     - hostvars[item[0]]["backup_target_users_dirs"] 
> > 
> > As it is, it doesn't work. What I would like to achieve is that 
> > "item[0]" in 
> > the nested loop would refer to the value of the current item of the 
> > outer loop. 
> > How can I do that? 
> > 
> > Thanks and best regards, 
> > Tadej 
>
>
>

-- 
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/16c1853c-3903-43b5-8273-f4d49ba8a369%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to