On 05/28/14 18:17, Maciej Delmanowski wrote: > > Sorry, replying from phone. > > 28 maj 2014 16:59 "'Petros Moisiadis' via Ansible Project" > <[email protected] > <mailto:[email protected]>> napisaĆ(a): > > > > On 05/28/14 16:50, Adam Morris wrote: > > > For the specific example given: apache role and wsgi role there > may be a simple, elegant, solution. Apache can include other > configuration files, I don't know if it can include directories. If > so include a directory. If not use the assemble module to create your > included file. > > > > > > Then the wsgi role just needs to drop a fragment or a complete file. > > > > > > Template encapsulation seems like it could get complicated fast. > Particularly if you have dependency chains... how far back should it go? > > > > It is true that software that has support for include directories can > > help, but it become less helpful as you add more levels in ther > hierarchy > > > > For example, consider a tree like this: > > > > 'apache' role > > | > > +-------------------------+-------------------------+ > > | | > > | > > 'wsgi_app' role 'php_app' role > > 'passenger_app' > > | | > > +-----------------------+ > > +------------------------+ > > | | | > > | > > 'django_app' role 'flask_app' role 'redmine_app' > > role 'gitlab_app' role > > > > > > Deploying all or a subset of the above roles on the same server could be > > most easily done if my proposal for template encapsulation was > available. > > Maybe most easily, but definitely not impossible. Currently I can > deploy gitlab, gitlab-ci, phpmyadmin, phpipam, etherpad, owncloud, all > on the same server behind nginx. I don't see how including templates > in nginx role from other roles to make that possible could help me. >
I am sure that you can deploy all these and that you are happy with the result. However, I took a look at your nginx role and it seems you are doing exactly what I believe people could (and should) avoid with template encapsulation. It seems you are creating a "super-role" merging together what could be at least 3 separate roles connected through dependencies: nginx, fastcgi_app, php_app. If you prefer that monolithic way of doing things, it's fine. You will be one of those who will not be excited by a feature like the one I propose and probably never use it. > > > > > So is there another use case that we can discuss. > > > > I have a 'common' role that deploys /etc/hosts. In 'cluster node' role > > luster nodes I also add lines for all nodes in the cluster. Now I am > > using a really ugly loop around lineinfile for this that took me some > > time before I made it place the content properly. Try to use lineinfile > > with a relatively complex data structure and you will remember my words. > > Instead, it would be far more easy to write an "extra_hosts" block and > > do things in pure jinja. > > Why not deploy for example dnsmasq? I mean, using /etc/hosts for DNS > in a multiple host environment is so 1960... > Because it would be overkill for a 2 or 3 - node cluster. But you are missing the point. dnsmasq would still have a common configuration on most hosts, as well as an extra configuration needed for cluster nodes. > > > > > I'm thinking that they wish they'd called them prerequisites not > dependencies now. :-) > > Seconded. :) > > Maciej > > > > > > > Adam > > > > > > > -- > > 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/5385F9DB.9030903%40yahoo.gr. > > 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] > <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/CAEnKK1y7B3ecBT3KC%2B1pUQxKNv94krF2sQ1Ziboix3Rm5BnosA%40mail.gmail.com > <https://groups.google.com/d/msgid/ansible-project/CAEnKK1y7B3ecBT3KC%2B1pUQxKNv94krF2sQ1Ziboix3Rm5BnosA%40mail.gmail.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 [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/538606DB.7060301%40yahoo.gr. For more options, visit https://groups.google.com/d/optout.
