Created
November 19, 2019 11:17
-
-
Save NilashishC/96fed489d46cf1921cc6bc46e012e3f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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