ansible version
root@DESKTOP-NI19EMN:/etc/ansible# ansible --version
ansible 2.9.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0]
playbook
root@DESKTOP-NI19EMN:/etc/ansible# cat facts.yml
---
- name: collect network facts
hosts: all
roles:
- { role: network_facts }
tasks:
- debug: msg="Nose {{ hostname }} is type {{ device_os }} running software version {{ version }}"
When running the playbook
root@DESKTOP-NI19EMN:/etc/ansible# ansible-playbook facts.yml
ERROR! the role 'network_facts' was not found in /etc/ansible/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/etc/ansible
The error appears to be in '/etc/ansible/facts.yml': line 6, column 9, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
roles:
- { role: network_facts }
^ here