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
Playbook:
---
- 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: [cent7]
TASK [DEBUG INFO]
************************************************************************************************************************************************************************************************************************
fatal: [cent7]: 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
*******************************************************************************************************************************************************************************************************************************
cent7 : 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/5760038c-755a-4714-9b06-f7d6dbcdd848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.