How to Effectively verify Cisco IOS code upgrade verification in large environment ?

9 views
Skip to first unread message

Gurminder Singh

unread,
May 9, 2017, 8:31:55 PM5/9/17
to Ansible Project
Freinds,

I wanted to create a playbook which I can take handy to verify my Cisco IOS device to check following things for me:-

a) creating a logic to confirm reload uptime is recent (i.e is after the upgrade & reload)
b) matching the latest code from the boot.
c) collectively displaying the number successful and non-successful upgrades based on above parameter. (Most important because of large number of devices I shall be considering for upgrade based on verification done)


Following above objectives I also wanted to:-
d) create a dictionary/list which would also have list of latest codes based on different IOS model, which can be picked to match to confirm the device has been upgraded to correct version or not.


I created a playbook which does the very basic job. I would like to get the a output which can run on 100 devices and give me a output like how many devices has the desired code and how does not, in a precise format ?


Can some please help on how can I achieve above milestone?


-bash-4.1$ cat ios_post_check.yml
---
- name: IOS UPGRADE CHECK
  hosts: "ios"
  gather_facts: no
  connection: local

  tasks:
    - name: CREDENTIAL
      include_vars: credentials.yml

    - name: IOS VERSION AND UPTIME CHECK
      ios_command:
         provider: "{{creds}}"
         host: "{{ inventory_hostname }}"
         commands:
                - terminal length 0
                - show version | in uptime|boot
                - sh run | in boot
      register: output

    - name: 
      debug:
          var: output.stdout_lines

Thank You !!

Reply all
Reply to author
Forward
0 new messages