I'm new to Ansible. I wanted to manage my network devices with Ansible so I did this:
Any help would be appreciated.
Thanks in advance.
$ ansible --version
ansible 2.8.2
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/ubellavance/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Inventory file:
[switch1]
192.168.xx.xx
[switch1:vars]
switch_host=192.168.xx.xx
switch_user=xxxxxxxx
switch_password=xxxxxxxx
Playbook:
- hosts: switch1
tasks:
- name: gather facts from switch
comware_5_2:
gather_facts=true
host={{ switch_host }}
username={{ switch_user }}
password={{ switch_password }}