---
- 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
# 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