I would have a list of what sites to enable and what sites to disable
centrally, and do this with a simple with_items instead, because it would
be better to have a central record than to have potentially hundreds of
different servers each being their own sources of record.

- template: src={{ site }}.cfg dest=/path/to/sites-available
  with_items:  enable_sites

- file: src=... dest=...
  with_items:   enable_sites

- file: src=... state=absent
  with_items: disable_sites









On Tue, Aug 5, 2014 at 1:22 PM, Dan Vaida <[email protected]> wrote:

> Hello,
>
> I also know some non-ansible ways of doing this, but I am interested to
> see if it can be done entirely in Ansible.
>
> Thanks.
>
> On Aug 5, 2014, at 7:06 PM, Adam Heath <[email protected]> wrote:
>
> > On debian, I could install the program 'symlinks'.  I don't know if it
> is available elsewhere.  It might be able to help.
> >
> > On 08/05/2014 12:05 PM, Dan Vaida wrote:
> >> Hello guys,
> >>
> >> I am trying to get my head around parsing a folder for its files and
> creating symlinks for those files found (depth 0) and place them in another
> directory.
> >>
> >> Example: parse sites-available/ and create symlinks in sites-enabled/
> with relative paths.
> >>
> >> I know one can just use the command/shell modules or even create a task
> and register the result of a 'ls' command for example and then parse
> them... but what about the relative path?
> >> One could also use a script like Apache provides for example: a2ensite
> but what about NGINX?
> >>
> >> Trying now the 'with_fileglob' but the task just skips...
> >>
> >> Cheers.
> >> --
> >> 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 [email protected] <mailto:
> [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/2ef77293-7eaf-4c73-8a9e-72ca62b4aef1%40googlegroups.com
> <
> https://groups.google.com/d/msgid/ansible-project/2ef77293-7eaf-4c73-8a9e-72ca62b4aef1%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/lPawe4hywBA/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/53E10F33.6010303%40brainfood.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/8B1E3FC4-6C18-4F93-B78D-405CC30A280C%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/CA%2BnsWgzpSztFLf9_bXJifOac0QvHKvry9nHmT2yW04PfvyEfKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to