Google Groups

Re: Play includes


Rodney Quillo May 8, 2012 7:46 PM
Posted in group: Ansible Project
Hi all,

Same with you, I'm also looking into 'howto' structure playbooks and
inputs.
Here's my sample also:

 dev-server.yml  (include nginx and mysql playbooks inside it)
 nginx-ubuntu.yml
    - nginx/
      - templates/
        - nginx.j2
      - vars/
      - tasks/
      - files/
 mysql-ubuntu.yml
    - mysql/
      - templates/
      - vars/
      - tasks/
      - files/

( Note: directories ends with /)

Here's my repo for my testing:
https://github.com/cocoy/ansible-playbooks/tree/master/nginx

-Rodney

On May 9, 10:14 am, Suraj Gupta <sur...@gmail.com> wrote:
> How about the following (directories in blue).  Optimized so that all files
> related to a specific task are in the same folder - less jumping around.
>  Separate folders for shared resources are justified because these folders
> are likely to contain many more files than any specific task.
>
>    - roles
>    - webservers.yml
>       - loadbalancer.yml
>    - shared
>       - files
>          - sharedFile1.txt
>       - templates
>          - template1.conf
>       - handlers
>          - sharedHandler1.yml
>       - tasks
>       - openssh
>          - openssh.yml
>          - ssh_config
>       - sysctl
>          - sysctl.yml
>          - sysctl.conf
>
> thoughts?
>
>
>
>
>
>
>
> On Wednesday, May 2, 2012 8:41:42 PM UTC-4, Michael DeHaan wrote:
>
> > Looks good, my personal preferences are mostly cosmetic:
>
> > - always include whitespace between tasks
> > - always have a comment at the top of every file
> > - comment non-obvious tasks where relevant
> > - always name tasks (you do this)
> > - I'd probably have a common.yml in tasks for all hosts in a play if
> > there were any common tasks
>
> > I don't think I have any preferences on openssh vs /etc/ssh/ as a
> > prefix for files.  It seems like a good idea to have them match the
> > playbook on one hand, but on the other,
> > if I had a full filesystem tree, that would be pretty awesome to
> > visualize and jump around in.
>
> > I currently have been using a seperate directory for files and
> > templates -- on one hand it's more explicit, on the other hand, it's
> > harder to visualize what you are putting where (similar
> > to the above)
>
> > We could also do stuff more similar to Puppet land:
>
> >    openssh/tasks
> >    openssh/files
>
> > Which makes sharing easier
>
> > What do people think?
>
> > On Wed, May 2, 2012 at 8:00 PM, Stephen Fromm <sfr...@gmail.com> wrote:
> > > On Wed, May 2, 2012 at 4:36 PM, Michael DeHaan <michael.deh...@gmail.com>
>
> > > wrote:
>
> > >> Suggestion -- Create one and invite comments.  This is how all the BP
> > >> guides get created originally.
>
> > >https://github.com/sfromm/ansible-playbooks
>
> > > It is there, just not advertised.  The readme should be fleshed out and
> > the
> > > repo is a bit thin at the moment.  Comments?  :-)
>
> > > sf