On 13.05.2018 13:55, Saranya N wrote:
I'm seriously not understanding whats going wrong here.

It's impotent to pay attention to the details.


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"

}

That's because it doesn't exist, I explain bellow.


  - name: Load the variables

    include_vars:

     file:
/home/devuser/ansible_test/ansible_dev/clearcase/inventories/NP/voblist.yml

     name: localvar

Here you say, take the variables in voblist.yml and put them is the variable localvar.
This you did not have in you first post.


  - name: List id

    shell: ls -ltr | grep -i {{ item }}

    register: shell_op

    with_items: "{{ dits }}"

So you then need to use localvar.dits


  - debug:

     msg: "{{ localvar.dits }}"

You did it here so it's important to go over the entire code when you changes things.

To me it looks like you are changing too many things at the same time, and because of that makes bugs in your code.

--
Kai Stian Olstad

--
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/7ebefcc780db86a20b927fa59b4c2f51%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to