Re: [ansible-project] Choose inventory hosts.ini file based on condition

2019-06-04 Thread Wawrzek Niewodniczanski
On Tue, 4 Jun 2019 at 02:36, Saranya Nagaraj wrote: > > Sorry that prod / Prod is a typo. > I'm basically using same at both places. > >> > ansible-playbook -i inventory/{{ env }}/ -e "env=prod" I think 'hosts.ini' is missing from your command. Wawrzek -- Dr Wawrzyniec NiewodniczaƄskior

Re: [ansible-project] Choose inventory hosts.ini file based on condition

2019-06-03 Thread Saranya Nagaraj
Sorry that prod / Prod is a typo. I'm basically using same at both places. On Jun 3, 2019 5:38 PM, "Wawrzek Niewodniczanski" wrote: > On Tue, 28 May 2019 at 16:31, Saranya N wrote: > > > > I have different staging environments under inventory. > > > [...] > > Prod/ > >group_vars > >

Re: [ansible-project] Choose inventory hosts.ini file based on condition

2019-06-03 Thread Wawrzek Niewodniczanski
On Tue, 28 May 2019 at 16:31, Saranya N wrote: > > I have different staging environments under inventory. > [...] > Prod/ >group_vars >hosts.ini > [...] > When I run my ansible playbook like this it doesn't work. How can I do this? > > ansible-playbook -i inventory/{{ env }}/ -e

Re: [ansible-project] Choose inventory hosts.ini file based on condition

2019-05-30 Thread vinoth kumar
Are you using right format? I can see Prod in inventory but in variable you used prod . Check the spelling On Tue, 28 May 2019 at 9:02 PM, Saranya N wrote: > I have different staging environments under inventory. > > Inventory/ > Qa/ >Group_vars >hosts.ini > Uat/ >group_vars >

[ansible-project] Choose inventory hosts.ini file based on condition

2019-05-28 Thread Saranya N
I have different staging environments under inventory. Inventory/ Qa/ Group_vars hosts.ini Uat/ group_vars hosts.ini Prod/ group_vars hosts.ini I want to choose inventory file based on environment. Within my playbooks I also use env variable. When I run my ansible playbook