Although my current playbook doesn't look for ifcfg files directly, I am 
just trying to grab a list of files and it is failing.  I can't, for the 
life of me, figure out why.  If I change the find: to a command: and then 
run an ls, it works......  wondering if someone can put me on the right 
path.  Not making any real progress on my own.....

Ultimately I am trying to find files starting with ifcfg- in the specified 
directory.

Side question:  Where can I find a list of debug output types for my vars 
(ie. stdout, stdout_lines, etc)?

Thanks in advance

test.yml
---
- hosts: cent
  gather_facts: no
  tasks:
  - name: Gather list of ifcfg-* files
    find:
      paths: "/etc/sysconfig/network-scripts"
    register: net_files

  - name: DEBUG INFO
    debug:
      msg: "{{ net_files.stdout_lines }}"
      verbosity: 3

Output:
# ansible-playbook test.yml

PLAY [cent] 
******************************************************************************************************************************************************************************************************************************

TASK [Gather list of ifcfg-* files] 
******************************************************************************************************************************************************************************************************
ok: [10.202.50.138]

TASK [DEBUG INFO] 
************************************************************************************************************************************************************************************************************************
fatal: [10.202.50.138]: FAILED! => {"failed": true, "msg": "the field 
'args' has an invalid value, which appears to include a variable that is 
undefined. The error was: 'dict object' has no attribute 
'stdout_lines'\n\nThe error appears to have been in 
'/etc/ansible/playbooks/dns/test.yml': line 10, 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: DEBUG INFO\n    ^ here\n"}

PLAY RECAP 
*******************************************************************************************************************************************************************************************************************************
10.202.50.138              : ok=1    changed=0    unreachable=0    failed=1


-- 
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/82dfc911-9c94-4ac3-a8b4-aa5c2d4f83bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to