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 <[email protected]> wrote:

> 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 like this it doesn't work. How can I do
> this?
>
> ansible-playbook -i inventory/{{ env }}/ -e "env=prod"
>
> --
> 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/a3626294-830b-45a3-933e-d5b3cf29694f%40googlegroups.com
> .
> 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/CAJ%2BRxtSaA9ndzYa%3D7nW5exFFy3Ut_pOSs5tzUoMumi69szYPLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to