Here's my solution with nginx (role:
https://github.com/ginas/ginas/tree/master/playbooks/roles/nginx).
My websites are defined as hashes in inventory variables, like this:
inventory_nginx_site1:
default: False
name: 'subdomain.{{ ansible_domain }}'
root: '/path/to/website'
inventory_nginx_site2:
default: False
name: 'othersite.(( ansible_domain }}'
root: '/other/site'
And my nginx role operates on lists of hashes, so in inventory I can do
this:
nginx_servers:
- '{{ nginx_server_default }}'
- '{{ inventory_nginx_site1 }}'
- '{{ inventory_nginx_site2 }}'
This way I can use default server defined by a role for given host, and add
additional websites as subdomains of that host (or I could replace default
website entirely, of I want to, either by omitting or rewriting
'nginx_server_default' hash (it is defined in nginx/defaults/main.yml). I
can also define 'nginx_servers' multiple times, for example in other roles
vars/ directory, and make nginx manage their websites (I do that with
phpMyAdmin, GitLab, ownCloud and others - you can look in that roles for
example usage).
2014-05-15 8:12 GMT+02:00 Martin Devlin <[email protected]>:
> Thanks, so is there no way to do this at the moment?
>
> Why I want to this:
>
> I have several kinds of web site definitions and in production they live
> on separate nodes. However in dev/test I want the same node to host them on
> and I want to use the combined list in a with_nested. But I can quite
> easily think of many other applications for this. I just want to be sure
> it's not supported at the moment and if there's a reason I shouldn't be
> trying to do it like this.
>
> --
> 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/3cc833cf-97f3-4fb5-8ab2-db9090dcf29a%40googlegroups.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/CAEnKK1w0Cnn6M%2BZgMzE0wq46LmCzcqNu69T%2BMKzDvEGN%3DQ0kBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.