---
10.9.9.42:
- name: myapp
path: /app/myapp_war.ear/myapp.war
- name: myapp JS
path: /app/myapp_war.ear/myapp.war/javascripts
10.9.9.43:
- name: CVS
path: /app/CVS.ear/CVS.war/ui/js
- name: CHK
path: /app/logs/tmp
- name: SSO
path: /app/CVS.ear/CVS.war/WEB-INF
TASK [Load entire repository inventory] *********************************************************************************************************************
task path: /app/test.yml:57
ok: [10.9.9.42] => {
"ansible_facts": {
"10.9.9.42": [
{
"name": "myapp",
"path": "/app/myapp_war.ear/myapp.war"
},
{
"name": "myapp JS",
"path": "/app/myapp_war.ear/myapp.war/javascripts"
}
],
"10.9.9.43": [
{
"name": "CVS",
"path": "/app/CVS.ear/CVS.war/ui/js"
},
{
"name": "CHK",
"path": "/app/logs/tmp"
},
{
"name": "SSO",
"path": "/app/CVS.ear/CVS.war/WEB-INF"
}
]
},
"ansible_included_var_files": [
"/app/vars/listing.yml"
],
"changed": false
}
TASK [debug] ************************************************************************************************************************************************
task path: /app/test.yml:62
fatal: [10.9.9.42]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'unicode object' has no attribute 'name'\n\nThe error appears to be in '/app/test.yml': line 62, column 6, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - debug:\n ^ here\n"
}
tasks:
- name: Load entire repository inventory
include_vars:
file="{{ playbook_dir }}/vars/listing.yml"
name: user1
- debug:
msg: "Name {{ item.0.name }} on path{{ item.0.path }}"
loop:
- "{{ inventory_hostname }}"