Ansible Playbook for Cisco IOS Upgrade

  Рет қаралды 24,104

Roger Perkin

Roger Perkin

Күн бұрын

Пікірлер: 75
@MrEDGE1984
@MrEDGE1984 2 жыл бұрын
Before this video Ansible was scary for me, now after watching this I can say I feel at home, Thanks ROger! Subscribed.
@RogerPerkin
@RogerPerkin 2 жыл бұрын
Excellent, plenty more to come - any topics you would like covered?
@MrEDGE1984
@MrEDGE1984 2 жыл бұрын
@@RogerPerkin Few more ansible videos would really help along!
@RogerPerkin
@RogerPerkin 2 жыл бұрын
@@MrEDGE1984 Sure, pretty wide topic area though - any vendors or tasks you are working on?
@uche8961
@uche8961 4 жыл бұрын
Great video. Very practical. Just what I need as a beginner in ansible. You really won me over. Please do more of these practical stuffs.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
More to come!
@RohitPatil-qx9tf
@RohitPatil-qx9tf 2 жыл бұрын
Hi Roger, I want to skip the upgrade if the current version and upgrade image are same.. But looks like it skip the debug message but start running other tasks.. ? Any inputs?
@MahmoudTaha92
@MahmoudTaha92 2 жыл бұрын
Thank you for sharing this useful demo, it is awesome!
@martinbuffleo
@martinbuffleo 3 жыл бұрын
Great playbook. Worth adding and MD5 verify task, before reloading the router?
@bantacad
@bantacad 2 жыл бұрын
Awesome video! In my opinion you can use command " write memory", which no require "Yes" for answer and for the network switch you can use console connection instead SSH. Cheers.
@kenmurphy4259
@kenmurphy4259 4 жыл бұрын
Great video Roger and like the Ansible cap! :)
@afara2000
@afara2000 3 жыл бұрын
For reloading a Cisco IOS device, you'll need to hit "enter" or return key i.e., " " instead of 'y' in Ansible script. Although, 'y' may work but it's good to use proper commands.
@edsonrocks
@edsonrocks 4 жыл бұрын
Thank you Roger, it's been a really useful demo. For a firmware upgrade routine like that I'd suggest checking the new firmware file md5 checksum before reloading the device just to prevent it turning into a brick that fails to reboot due to a corrupted file. Thank you for the video series, very cool, keep it up.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Edson, this was just me getting to grips with the basics of the operation. I am aware there are more checks that can be done like check space in flash before pushing and MD5 checksum checks. Glad you enjoyed it.
@edsonrocks
@edsonrocks 4 жыл бұрын
@@RogerPerkin I'm learning a lot with your videos. Thank you very much.
@Aldrin03
@Aldrin03 4 жыл бұрын
excellent work - i'm starting to study ansible to automate daily tasks! appreciate your videos!
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Great to hear! - I have more tutorials on my website www.rogerperkin.co.uk/network-automation/ansible/
@garyauer8070
@garyauer8070 3 жыл бұрын
Absolutely excellent thanks
@RogerPerkin
@RogerPerkin 3 жыл бұрын
Great, glad it helped!
@RohitPatil-qx9tf
@RohitPatil-qx9tf 2 жыл бұрын
Thanks for the video.. A very good script.. Please upload new videos for upgrade of the fortigate and palo alto devices
@RogerPerkin
@RogerPerkin 2 жыл бұрын
Ok thanks for the idea, I will look into that
@umakantjena5154
@umakantjena5154 4 жыл бұрын
thanks Roger for this video. why I am getting this error . fatal: [R1]: FAILED! => {"changed": false, "msg": "path specified in src not found"} I tried ~ or / , file path correct but it just cant get it.
@veerabsc
@veerabsc 2 ай бұрын
Fantastic work
@sameerthorappa3356
@sameerthorappa3356 4 жыл бұрын
Excellent video...we appreciate your time 👍👍👍.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Thank you! Cheers!
@DarkSideDiving
@DarkSideDiving 4 жыл бұрын
Very cool !!!
@adonf
@adonf 3 жыл бұрын
Hello, was the advertised "next video" where you automate all this stuff ever released ? Or is it part of the pay course ? Anyway, thanks for this very informative video.
@SadhamHussainsree
@SadhamHussainsree 3 жыл бұрын
Great video.Thank you for sharing your knowledge.
@chrisdotbrown1
@chrisdotbrown1 4 жыл бұрын
Great video - more network ansible please, especially the impact of ansible changes on routing tables
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Hi Chris, can you expand on that requirement a bit more? Ansible changes on routing tables are basically somebody making changes. Are you looking to compare routing tables before and after a specific change?
@chrisdotbrown1
@chrisdotbrown1 4 жыл бұрын
@@RogerPerkin the scenario would be if you wanted to change a route would you use the config module or command. Just trying to understand how smart the config module is.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
I don’t think the Ansible config module is smart - it literally just performs the same command you would type on the CLI Are you looking for more of a predictive / changing routes based on certain network conditions?
@chrisdotbrown1
@chrisdotbrown1 4 жыл бұрын
@@RogerPerkin Not really just trying to get me head around good operational practice and maintenance and which modules are best for what. I am thinking, facts and command to perform incremental change and test success and then config to ensure it hasn't been changed. I get that config can also best use for initial setup. I think one of my observations with Ansible is that there is a lot of content on how to do change but less on best practice. Great video - make really clear some key technics.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
@@chrisdotbrown1 Think of Ansible as a tool to make changes and config push / pulls in a predictive easy way. It's a great tool but if you want to get it to do clever stuff, you need to put clever config into it. Maybe you should look at Python and PYATS for something that will monitor your network for change and config drift. There is not one right tool for anything and there are so many ways of doing everything.
@gouravrelhan7372
@gouravrelhan7372 5 ай бұрын
Thank for this video. Much appreciated Roger !! :)
@peterly7381
@peterly7381 4 жыл бұрын
Awesome and very intuitive video instruction. However, this is a router by router. If we we 10 routers at once, what's the best method? 10 separate session currently? or how would you do it in parallel? Thanks.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Hi Peter, this playbook was just to explain the basic process. If you have 10 devices to upgrade it's up to you how you want to tackle it. If you added all your devices into the hosts file they would all upgrade at once, you may want to just do 10 at a time or if you wanted to do 1 at at time just wind the forks value back in ansible.cfg. The next device would not start until the previous play had finished. For production devices this playbook is really to take all the manual steps out of the process and some customers prefer to take things slowly over a day others are happy to fire all at once.
@hygri
@hygri 4 жыл бұрын
Sweet tutorial Roger, much appreciated. Just a thought; could you sneak in a check to see if there is actually flash space available for the upgrade? I've been hit by that many a time :)
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Great suggestion! I can add that in a later video - Make sure you subscribe to be alerted when it goes live
@hygri
@hygri 4 жыл бұрын
@@RogerPerkin Nice! Most definitely - I have, as they say , "got the bell on" :)
@RogerPerkin
@RogerPerkin 4 жыл бұрын
@Mr.b I have not deleted any videos, this is the only one I have on Jinja Templates - kzbin.info/www/bejne/pmGmamOwfseYa9U - all my other Ansible videos are in this playlist - kzbin.info/www/bejne/nn3LeY2Vqs-oaLM
@deepak7057
@deepak7057 4 жыл бұрын
cisco WS-C4948 not upgrade so plz help me
@jonathantx
@jonathantx 8 ай бұрын
Is it possible to gather facts based on a wildcard? for example only on a given switch model?
@mihaigrigore2136
@mihaigrigore2136 4 жыл бұрын
Excellent video, Roger! Thank you for sharing.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Thanks, glad it helped.
@JoshepGomez123
@JoshepGomez123 4 жыл бұрын
Ansible can be used to upgrade other Cisco OS (IOS-XR, IOS-XE, NXOS)? or is limited to IOS
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Yes, you can use it to upgrade other Cisco OS, it's just IOS is easiest. If you understand the manual process to upgrade NXOS then using Ansible is just taking the steps and translating them.
@AJ-jm6zp
@AJ-jm6zp 3 жыл бұрын
awesome and very helpful :) subscribed for your great work. could you please share that ansible script please
@RogerPerkin
@RogerPerkin 3 жыл бұрын
Sure, you can find it here - github.com/rogerperkin/network-programmability/blob/master/SCRIPTS/Ansible/ios-upgrade.yml
@packetsbulliespb3441
@packetsbulliespb3441 2 жыл бұрын
Does Ansible copy the image to all members if we have a stack switch, or how does Ansible manage this?
@suelee9346
@suelee9346 4 жыл бұрын
Thanks for the Video! Roger. Positives: This is good for Network Engineers who enjoys breathing through one nostril due to Corona Virus. This is good for someone who does not want to write Python codes. Not so positive: Using Ansible is like running on only 4 cylinders on a V8 car. Python might byte you back later. Why not use both nostrils (Python) or fire up all 8 cylinders (Python)?
@RogerPerkin
@RogerPerkin 4 жыл бұрын
I agree, Ansible is not the fastest way to do things but for IOS upgrades I have found it to be very reliable - which is more important for me!
@neogeoh1
@neogeoh1 4 жыл бұрын
Sir... I Mount a python program to do this. I need this code to try it out. I will check your website otherwise please let me know where I can get it. I am new to Ansible and this will serve me as a great experiment. Thank you for sharing.
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Hi, I am working on this and will be putting a new video out soon performing the task using Python
@koye290904
@koye290904 3 жыл бұрын
Great video Roger! How long would you say the entire upgrade process took from running the yml file in ansible to the completion of the upgrade? I intend to run this in a prod environment on over 30 network devices.
@dhanasekar-uj2ch
@dhanasekar-uj2ch 4 жыл бұрын
Excellent video, one query can we pass the enable password and hoow to do that
@afara2000
@afara2000 3 жыл бұрын
You need to have "become: yes" and "become_method: enable" variables set in playbook or "ansible_become=yes" and "ansible_become_method=enable" in 'hosts' file and set "ansible_become_password=xyz" in your 'hosts' or inventory file. You can also use "-K" in CLI when you run playbook, it'll prompt you to manually enter enable password.
@ankukumar-hi2jt
@ankukumar-hi2jt 11 ай бұрын
Thanks @Roger Perkin for your video so lets suppose i have 100 devices to upgrade and i did them at once so how ansible knows which all devices are coming up and then do post validation as few devices can take more time then other
@RogerPerkin
@RogerPerkin 10 ай бұрын
You would put a delay on the playbook before you run the validation, you would just have to put a sensible figure in i.e wait 10 minutes?
@rochdiferjani6778
@rochdiferjani6778 10 ай бұрын
dear Roger could you please make a training video about aruba switch ! 🥰
@sbahb1396
@sbahb1396 4 жыл бұрын
Awesome video! Thank you Roger. A small question, do you covert this kind of upgrade for wireless controller and ASA in your course on your website? If yes I am really interested. I am currently working on upgrading our infrastructure devices (switches, WLC, ASA) it would be nice if you could share how to perform this kind of tasks with Ansible. Please let me know. Thank you again for the great video!
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Hi sbah B, thank you for the comment. My course really covers from zero knowledge to running some basic playbooks. Once you get up and running there are so many use cases it would be impossible to cover them all. The process is the same you just need to tweak the playbook for your specific hardware. It all depends on how many deivces you have. For me the switch playbook was really worth writing as you can easily upgrade 100's or 1000's of switches with ease. For ASA or WLC it just depends how many you have and how often you want to upgrade them
@jclm1rt
@jclm1rt 4 жыл бұрын
Very good video! Is it possible to do the same upgrade simultaneously on multiple switches?
@dhanasekar-uj2ch
@dhanasekar-uj2ch 4 жыл бұрын
Yes it is possible
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Yes, this is the power of Ansible, you can limit the number of connections with forks in the ansible.cfg file I normally have it at 5 connections at a time, however it can be more. It's just up to you how many you want to have going at the same time. For switch upgrades I would normally have them going at a manageable number so you can monitor them. Some customers want all at once, others prefer one at a time.
@feargalledwidge806
@feargalledwidge806 4 жыл бұрын
Great video - but every time I try to replicate it - I get a failure in the net_put module. I get "An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnboundLocalError: local variable 'changed' referenced before assignment fatal: [TEST]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}. Ansible version is 2.9.19.
@aydinkocak3270
@aydinkocak3270 4 жыл бұрын
Hi I receive same error with centos but same playbook run without any error on ubuntu 20.04 LTS.
@jhonvinod8988
@jhonvinod8988 4 жыл бұрын
Please upload iOS upgrade using python. Thank you
@RogerPerkin
@RogerPerkin 4 жыл бұрын
Sure, that was going to be my next video, performing the same operation using Python! Hit subscribe and you will be notified as soon as it goes live!
@marcosdxdydz
@marcosdxdydz 10 ай бұрын
lousy explanation
@ershadramezani6716
@ershadramezani6716 2 жыл бұрын
Does anyone know why I'm getting this error with scp ?: fatal: [sw1-access]: FAILED! => {"changed": false, "destination": "flash:/test.txt", "msg": "Exception received: Error transferring file to flash:/test.txt: Initializing SCP session of remote file [flash:/test.txt] for write failed with error [b'Socket error: No such file or directory']"} Thanks in advance
Ansible Network Automation Example | Backup Cisco Router Playbook
11:13
How to Use Ansible Vault | Ansible Vault Tutorial
8:39
Roger Perkin
Рет қаралды 27 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Cisco IOS Automation with Ansible
31:22
Kevin Wallace Training, LLC
Рет қаралды 57 М.
Ansible Network Automation
1:02:52
David Bombal
Рет қаралды 76 М.
Using Ansible Automation with EVE-NG
31:22
Charles Judd
Рет қаралды 15 М.
you need to learn Ansible RIGHT NOW!! (Linux Automation)
21:21
NetworkChuck
Рет қаралды 900 М.
How to upgrade IOS on Cisco switch
10:29
Silesio Carvalho
Рет қаралды 6 М.
Ansible Playbook Example to Backup Cisco Router or Switch Config
13:26
Managing 15,000 network devices with Ansible
35:55
Red Hat Summit
Рет қаралды 46 М.
Python and Jinja2 Cisco Network Automation
54:21
David Bombal
Рет қаралды 33 М.
Ansible Jinja2 Template Tutorial  Network Automation Cisco
18:56
Roger Perkin
Рет қаралды 50 М.
Ansible For Network Engineers: Getting Started In Less Than 30 Minutes!
26:32
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41