That for loop doesn't make sense with that file.
On fist loop it would contain "---", and the second it would contain "dist:" and third "- /project/vob_solaris_test.vbs".
"msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'items' is undefined\n\nThe error appears to have been in '/home/dev_user/ansible_test/ansible_dev/clearcase/playbooks/testdump.yml': line 32, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: lsvob\n ^ here\n"
}
to retry, use: --limit @/home/dev_user/ansible_test/ansible_dev/clearcase/playbooks/testdump.retry
PLAY RECAP ***************************************************************************************************************************
I’m new to Ansible too, so take this explanation with a grain of salt!
My understanding of “with_items” is that it takes a list. The loop iterates over the list, referring to the current element as “item”.
So inside your loop, you should refer to “item” (not “items”!)) which on each iteration will be replaced by the next element from the list called “dits”.
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.
to retry, use: --limit @/home/devuser/ansible_test/ansible_dev/clearcase/playbooks/simple.retry
PLAY RECAP ****************************************************************************************************************************************************************************************************