Hello Everyone,
I’ve a task -
- name: Device Description
uri:
url: “{{ URL }}/api-db?username={{ USERNAME }};password={{ PASSWORD }};cmds=mget+*+{{ display_name }}+sys+SNMPv2-MIB.sysDescr”
validate_certs: no
method: GET
return_content: yes
register: get_descriptions
Debug Output
- debug: msg=“{{ get_descriptions.content }}”
ok: [localhost] =>
msg: |-
sw01 sys SNMPv2-MIB.sysDescr = Cisco IOS C2960S (C2960S-UNIVERSALK9-M) Version 12.2(55)SE7 RELEASE (fc1)
I’m able to configure the when to run only when - Cisco IOS C2960S found in the output
- debug: msg=“{{ get_descriptions.content }}”
when: “‘Cisco IOS C2960S’ in get_descriptions.content”
I’ve created a devices.yml