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
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
> >
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
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
>
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