I use a global ansible.cfg. I just didn't fancy ansible behaviour changing if I changed directory.
Thinking about it, I have some groups which I use across inventories, and some groups which are strictly specific to one inventory - this is achievable using group children. The inventory file is a little more complex but it hasn't been painful to manage once I'd got my head round the necessary groups. I do use some groups just for connection settings (mixture of linux and windows hosts makes this necessary). More recently have started defaulting a lot of vars as in a lot of cases I only actually need to have different values for production environments. Hope this helps, On Thursday, May 12, 2016 at 2:01:59 AM UTC+1, James Pearson Hughes wrote: > > On Tuesday, May 10, 2016 at 10:27:58 PM UTC-7, J Hawkesworth wrote: >> >> I don't know what other people do - I suspect it varies a lot according >> to use and team size - ansible is very flexible after all, but for what >> its worth I moved all my playbooks out of root and into dirs a while ago as >> they were getting out of control too. >> >> I have dirs like >> >> plays/provision (putting the software stack in place for each type of >> server) >> plays/update (install latest versions of software components) >> plays/untested (where I work up new plays) >> plays/operations (check things, rolling restarts etc) >> > > Do you use an ansible.cfg in the playbook directory, or just a global one? > I guess you could use symlinks in each of those directories so you only > have to maintain one copy... > > >> I do however keep all my roles in a single roles dir and so far have >> managed not to have any roles which are 'private' to the playbook dirs. To >> me this maximizes the re-use I can get out of roles. >> I make use of playbook includes to run multiple playbooks where >> appropriate in some cases too. >> >> As far as vars are concerned I have several inventory files and at least >> 1 group_vars (directory) per inventory so I can set vars for each >> environment independently, where necessary. >> > > So you don't find any times you wish you could share variables across > playbook groups? We have things like ansible_ssh_user defined in > host_vars, and some common "we use this value in a bunch of places" > variables in another vars file, and I'm hesitant about duplicating them. > > >> Hope this helps >> > > Yes, thank you. > -- 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/506fb879-c792-4809-852b-13236a288612%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
