The file you refer to in your playbook is: /home/devuser/ansible_test/ansible_dev/clearcase/inventories/NP/voblist.yml
The file containing the dits variable is: /home/devuser/internproj/inventories/NP/voblist.yml Could that be the problem? Regards, K. On Sun, May 13, 2018 at 9:55 PM, Saranya N <[email protected]> wrote: > Hi Karl, > > The shell command is for a tool. > But the logic I'm trying to execute is very simple. > List all the files such that the files' names contains the words present > in dits list which I'm sending via the include_vars file. > > I'm seriously not understanding whats going wrong here. > > I get dits is not defined error like below. > > task path: /home/devuser/ansible_test/ansible_dev/clearcase/ > playbooks/simple.yml:15 > > fatal: [aaa.com]: FAILED! => { > > "failed": true, > > "msg": "'dits' is undefined" > > } > > to retry, use: --limit @/home/devuser/ansible_test/ > ansible_dev/clearcase/playbooks/simple.retry > > > > PLAY RECAP ************************************************************ > ************************************************************ > ************************************************************ > **************** > > aaa.com : ok=1 changed=0 unreachable=0 failed=1 > > > > > > --- > > - hosts: sol > > become: yes > > become_method: su > > become_user: vobadmin > > gather_facts: no > > > > tasks: > > > > - name: Load the variables > > include_vars: > > file: /home/devuser/ansible_test/ansible_dev/clearcase/ > inventories/NP/voblist.yml > > name: localvar > > > > - name: List id > > shell: ls -ltr | grep -i {{ item }} > > register: shell_op > > with_items: "{{ dits }}" > > > > - debug: > > msg: "{{ localvar.dits }}" > > > > > > > > cat /home/devuser/internproj/inventories/NP/voblist.yml > > > > dits: > > - aaa > > - bbb > > > > -- > 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/39cebb74-d52a-4690-a0ca-febe264fe248%40googlegroups. > com. > For more options, visit https://groups.google.com/d/optout. > -- Karl Auer Email : [email protected] Website: http://2pisoftware.com GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816 Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA -- 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/CA%2B%2BT08TgRwQ08s8MpNS%3DEYw7owNpXRPFJs3pYUcqbDsdGjbj7A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
