Thanks for responding Uwe! I appreciate your time. :)

I'm already using a with_dict to get the list of sites, but now for each
site I would like to provide a list of symlinks to generate. The list of
symlinks does not change.

This creates the docroots:

- name: Create docroot
  file: path=/var/www/html/{{ item.value.url }} state=directory
owner=www-data group=www-data
  with_dict: "{{ sites }}"
  when: item.value.type == "grav"
  tags: grav, grav-sites

I would like to create the same symlinks for each of these sites, but I
don't know how to get {{ site from dict }}:

- name: Create symlinks
  file: dest=/var/www/html/{{ site from dict }}/{{ item }}
src=/var/www/grav/grav/{{ item }} state=link owner=www-data group=www-data
  with_items:
    - bin
    - CHANGELOG.md
    - composer.json
    - .editorconfig
    - .gitignore
    - index.php
    - LICENSE.txt
    - system
    - vendor
  tags: grav, grav-sites


On Mon, Aug 28, 2017 at 12:52 PM, Uwe Sauter <[email protected]>
wrote:

> I'm not quiet sure I understand your data model but instead of with_items
> have a look at with_dict.
>
> Am 28.08.2017 um 21:51 schrieb Michael Bushey:
> > Hello,
> >
> > I have a dict that contains a list of sites. For each of these sites I
> would like to provide a list of symlinks to
> > create provided by with_items. Is this possible? I have Ansible 2.3.1.0.
> >
> >
> > Thanks!
> > Michael
> >
> > --
> > 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] <mailto:ansible-project+
> [email protected]>.
> > To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ansible-project/
> 13eb2739-7e21-4503-8e75-7f3db8803966%40googlegroups.com
> > <https://groups.google.com/d/msgid/ansible-project/
> 13eb2739-7e21-4503-8e75-7f3db8803966%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 a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/gns-XRtt9aE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d8d85ea0-addc-6d99-c3ad-be9bfc62f83d%40gmail.com.
> 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/CAPJTyAXqsGF7HMoF5fNjaacL%2Bfsxz%3D9dZ%3DhHR6K7THF%2B74QhTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to