This Ansible playbook runs upgrade task for Cisco IOS/XE.
The playbook by default REBOOT the Router !!!! To change this behavier see reboot
variabile
a second playbook upgrade_ios_post_check.yml
can be used for checking that IOS has been upgraded and creates a simple csv file.
Contact information:
Email: [email protected]
Twitter: @iarnopagliani
IOS are not provided and they are stored outside git repository. Please download them from cisco.com
ios_path: ../images/gold/
- Debug switch used in the tasks; normaly False
debug: "False"
- Used for skipping scp operations; normaly True
upload: "False"
- Used for reboot the router; normaly True
reboot: "True"
Use Command: ansible-playbook upgrade_ios.yml
Remenber to use verbose mode: -v
or -vv
or -vvv
for ansible debug.
Encrypt string commannd used:
encrypt_string --vault-password-file ~/vault_pass_file.txt ansible
where ansible
is the password and ~/vault_pass_file.txt
is user defined
> cat ~/vault_pass_file.txt
secrect
The playbook currently provides Ansible task files for Cisco IOS/IOS-XE ISR1101 and IR1101.
> ansible --version
ansible 2.9.6
A value of 1800 secs in task ansible_command_timeout: 1800
has been configured for copy IOS file.
At the end of the playbook, the following filesystem components are created.
> tree
.
├── README.md
├── RN
│ └── IR1101-release-notes-16-12-3.pdf
├── ansible.cfg
├── config
│ ├── 2020-04-01_R1_facts.cfg
│ └── 2020-04-02_R1_facts.cfg
├── group_vars
│ ├── all.yml
│ ├── ir1101.yml
│ └── isr1101.yml
├── host_vars
├── hosts.yml
├── inventory.csv
├── rtr_script.txt
├── templates
├── upgrade_ios.yml
└── upgrade_ios_post_check.yml