hosts: cisco
gather_facts: False
connection: local
vars_files:
- creds.yml
tasks:
- name: configure provider
set_fact:
provider:
username: "{{username}}"
password: "{{password}}"
host: "{{inventory_hostname}}"
- name: DEPLOY SNMP COMMANDS WITHIN PB
delegate_to: localhost
ios_command:
provider: "{{ provider }}"
commands:
- show mod | i c200
register: showmod
- debug: "msg='2c31.24a4.c200'"
when: showmod.stdout | join(" ") | search("/c200/")
PLAY [Checking running cisco config] ********************************************************************************************************************************************************************************************************
TASK [configure provider] *******************************************************************************************************************************************************************************************************************
ok: [sltnrmgmt]
TASK [DEPLOY SNMP COMMANDS WITHIN PB] *******************************************************************************************************************************************************************************************************
fatal: [sltnrmgmt -> localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ios_command) module: register Supported parameters include: auth_pass,authorize,commands,host,interval,match,password,port,provider,retries,ssh_keyfile,timeout,username,wait_for"}
to retry, use: --limit @/etc/ansible/cisco-test.retry
PLAY RECAP **********************************************************************************************************************************************************************************************************************************
sltnrmgmt : ok=1 changed=0 unreachable=0 failed=1
ansible --version
ansible 2.4.2.0
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/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]