Thanks! That clears it up. On Sunday, August 24, 2014 9:50:52 AM UTC-4, Michael DeHaan wrote: > > I wrote those docs :) > > You have this part slightly off: > > inventory/production # inventory file for production servers > inventory/stage # inventory file for stage environment > > group_vars/ > group1 # here we assign variables to particular groups > group2 # "" > > Drop the group_vars directory inside inventory, so like > inventory/group_vars/group1. > > Then it just works. group_vars must be alongside the inventory files, but > "-i inventory_dir" is a shortcut to run multiple inventory files at the same > time, should you ever want to. > > Still use groups and have groups for production and stage, because you may > want them in your playbooks to assign different variable settings to them. > > > > On Sun, Aug 24, 2014 at 9:22 AM, Brian Finch <[email protected] > <javascript:>> wrote: > >> Sorry, I'm new here. Can you elaborate a bit on how this would work? >> >> The docs recommend a setup like this >> >> production # inventory file for production servers >> stage # inventory file for stage environment >> >> group_vars/ >> group1 # here we assign variables to particular groups >> group2 # "" >> host_vars/ >> hostname1 # if systems need specific variables, put them here >> hostname2 # "" >> >> So instead you're recommending this? >> >> inventory/production # inventory file for production servers >> inventory/stage # inventory file for stage environment >> >> group_vars/ >> group1 # here we assign variables to particular groups >> group2 # "" >> >> >> So with that setup would you need to use different group names in the >> inventories so you can set them separately in the global group_vars? >> If I want to use the same group names in my production and stage >> inventories, will something like this work? >> >> inventory/production/inventory # inventory file for >> production servers >> inventory/stage/inventory # inventory file for stage >> environment >> >> inventory/production/group_vars/ >> group1 # here we assign variables to production group1 >> >> >> >> >> >> >> On Saturday, August 16, 2014 10:58:45 AM UTC-4, Michael DeHaan wrote: >> >>> I recommend keeping your inventory in a directory, like inventory/ >>> >>> and then have a inventory/production and a inventory/stage >>> >>> This prevents accidentally running something against both as you'll have >>> to -i inventory/stage (unless you type -i inventory!) >>> >>> Usage of group_vars is then the way to organize variance between them. >>> >>> See http://docs.ansible.com/playbooks_best_practices.html# >>> how-to-arrange-inventory-stage-vs-production >>> >>> >>> On Fri, Aug 15, 2014 at 1:10 PM, olga <[email protected]> wrote: >>> >>>> Hi ! >>>> >>>> I currently using python tools for continuous deloy to AWS ec2 nodes >>>> and want to use ansible for continuous deploy. We have stage and qa env >>>> with different properties. Could someone point to me the right approach to >>>> setup continuous deploy to mulitple env with the right properties. >>>> >>>> Thanks, >>>> Olga S >>>> >>>> -- >>>> 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/d42530f6-a77d-4a13-9506- >>>> b4948efeb003%40googlegroups.com >>>> <https://groups.google.com/d/msgid/ansible-project/d42530f6-a77d-4a13-9506-b4948efeb003%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 the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/1b3ca2b5-114e-4ba0-8075-3c1abf18e1b5%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/1b3ca2b5-114e-4ba0-8075-3c1abf18e1b5%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 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/6d799fbc-1c17-4287-bf4b-e3e3270199ac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
