Hi Kai ,
Thankyou for your response but unfortunately it still doesn't work for me.
It still doesn’t work. Sorry, I’m very new to ansible and just started working
on it.
I get below error:
task path:
/home/dev_user/ansible_test/ansible_dev/clearcase/playbooks/testdump.yml:20
ok: [aaa.com] => {
"ansible_facts": {
"localvar": {
"vobs": [
"/project/vob_solaris_test.vbs",
"/project/vob_solaris_test22.vbs"
]
}
},
"changed": false
}
TASK [lsvob]
**************************************************************************************************************************************************************************************************
task path:
/home/dev_user/ansible_test/ansible_dev/clearcase/playbooks/testdump.yml:32
fatal: [aaa.com]: FAILED! => {
"failed": true,
"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
***************************************************************************************************************************
aaa.com : ok=3 changed=2 unreachable=0 failed=1
my playbook lokks like below:
---
- hosts: sol
become: yes
become_method: su
become_user: vobadmin
gather_facts: no
tasks:
- name: Load the variables
include_vars:
file:
/home/a594588/ansible_test/ansible_dev/clearcase/inventories/NP/voblist.yml
name: localvar
- name: lsvob
shell: /usr/atria/bin/cleartool lsvob | grep -i {{ items }}
args:
chdir: "/home/vobadmin"
with_items: "{{ dits }}"
I changed the contents of the include_vars file input file:
cat /home/devuser/internproj/inventories/NP/voblist.yml
dits:
- /project/vob_solaris_test.vbs
- /project/vob_solaris_test22.vbs
--
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/82f6779b-c698-44f0-81b5-37de10960a4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.