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.
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?
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.
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.
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.
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.
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)?
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.
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 :)
@Mr.b I have not deleted any videos, this is the only one I have on Jinja Templates - czcams.com/video/p0C90zIbe5s/video.html - all my other Ansible videos are in this playlist - czcams.com/video/hLhHZ_uju2Q/video.html
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.
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.
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.
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?
@@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.
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?
@@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.
@@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.
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.
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.
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
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.
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.
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!
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
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.
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
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.
Before this video Ansible was scary for me, now after watching this I can say I feel at home, Thanks ROger! Subscribed.
Excellent, plenty more to come - any topics you would like covered?
@@RogerPerkin Few more ansible videos would really help along!
@@MrEDGE1984 Sure, pretty wide topic area though - any vendors or tasks you are working on?
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?
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.
Thanks for the video.. A very good script.. Please upload new videos for upgrade of the fortigate and palo alto devices
Ok thanks for the idea, I will look into that
Great playbook. Worth adding and MD5 verify task, before reloading the router?
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.
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.
@@RogerPerkin I'm learning a lot with your videos. Thank you very much.
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.
More to come!
Thank for this video. Much appreciated Roger !! :)
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.
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)?
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!
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.
dear Roger could you please make a training video about aruba switch !
🥰
Thank you for sharing this useful demo, it is awesome!
excellent work - i'm starting to study ansible to automate daily tasks! appreciate your videos!
Great to hear! - I have more tutorials on my website www.rogerperkin.co.uk/network-automation/ansible/
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 :)
Great suggestion! I can add that in a later video - Make sure you subscribe to be alerted when it goes live
@@RogerPerkin Nice! Most definitely - I have, as they say , "got the bell on" :)
@Mr.b I have not deleted any videos, this is the only one I have on Jinja Templates - czcams.com/video/p0C90zIbe5s/video.html - all my other Ansible videos are in this playlist - czcams.com/video/hLhHZ_uju2Q/video.html
cisco WS-C4948 not upgrade so plz help me
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.
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.
Absolutely excellent thanks
Great, glad it helped!
awesome and very helpful :)
subscribed for your great work.
could you please share that ansible script please
Sure, you can find it here - github.com/rogerperkin/network-programmability/blob/master/SCRIPTS/Ansible/ios-upgrade.yml
Excellent video...we appreciate your time 👍👍👍.
Thank you! Cheers!
Great video Roger and like the Ansible cap! :)
Is it possible to gather facts based on a wildcard? for example only on a given switch model?
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.
Hi I receive same error with centos but same playbook run without any error on ubuntu 20.04 LTS.
Does Ansible copy the image to all members if we have a stack switch, or how does Ansible manage this?
Great video - more network ansible please, especially the impact of ansible changes on routing tables
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?
@@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.
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?
@@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.
@@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.
Ansible can be used to upgrade other Cisco OS (IOS-XR, IOS-XE, NXOS)? or is limited to IOS
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.
Excellent video, Roger! Thank you for sharing.
Thanks, glad it helped.
Very cool !!!
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.
Great video.Thank you for sharing your knowledge.
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
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?
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.
Hi, I am working on this and will be putting a new video out soon performing the task using Python
Please upload iOS upgrade using python. Thank you
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!
Excellent video, one query can we pass the enable password and hoow to do that
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.
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!
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
Very good video! Is it possible to do the same upgrade simultaneously on multiple switches?
Yes it is possible
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.
lousy explanation
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