Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NilashishC/96fed489d46cf1921cc6bc46e012e3f7 to your computer and use it in GitHub Desktop.
Save NilashishC/96fed489d46cf1921cc6bc46e012e3f7 to your computer and use it in GitHub Desktop.
---
- hosts: aws_csr
gather_facts: no
tasks:
- name: Push golden config to the box
ios_interfaces:
config:
- name: GigabitEthernet1
description: 'OUTBOUND_INTERFACE_1'
mtu: 1600
state: merged
- name: Gather Facts For Backup To Use Later
ios_facts:
gather_network_resources:
- interfaces
- name: Push wrong config that needs to be reverted
ios_interfaces:
config:
- name: GigabitEthernet1
description: 'TRUNK_PORT'
mtu: 1900
state: merged
- name: Rollback to golden config using previously fetched facts
ios_interfaces:
config: "{{ ansible_facts['network_resources']['interfaces'] }}"
state: overridden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment