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.