My structure looks like below.

Inventory/qa folder has below.

  hosts # inventory file
  Check # inventory file
 group_vars/
  all.yml
  myrole.yml

myrole folder has below

myrole/

 tasks/main.yml
 Vars/
   ctr1.yml
   Ctr2.yml
   Ctr 3.yml
   main.yml
 Templates/
   Ctr1.yml.j2
   Ctr2.yml.j2
   Ctr3.yml.j2

My roles/tasks/main.yml decides which vars Ctrl file to load depending on my 
extravars c=1 or c=2 or c=3 .

Inventory/qa/Check file has below.

[Myapps]
Ctr1
Ctr2
Ctr3

[Ctr1:vars]
Appname="{{ app }}-{{ ansible-host }}-{{ type }}"

[Ctr2:vars]
Appname="{{ app}}-{{ ansible-e to }}-{{ type }}"

[Ctr2]
Server1/dynt ansible-host=server1 type=dynt
Server1/splunk ansible-host=server2 type=splunk


Roles/tasks/main.yml ( I have customcli)
Command: customcli --host {{ ansible-host }} --appname {{ Appname }}


Roles tasks don't pick any variables defined under Check inventory file

Can someone please help??

I did research a lot in ansible docs and I'm unable to figure out my mistake.

Can someone please guide me why it's not picking inventory variables 

-- 
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/dd3345bf-5ccd-416a-b702-a9c3aca974f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to