I have a task to upgrade a large number of Cisco IOS devices. My confusion is that in this large number of devices 1000+ Some of the stacks may already be running the preferred IOS version while others in this group may not be, and to add a little more complexity we are only wanting to target a specific model the 2960X and ignore all of the 2960S' models and my taget image version is My target image version is c2960x-universalk9-tar.152-2.E5.tar. We are using the NCM config change template for this task because all upgrades will be performed on switch stacks and not stand alone single switches.
My logic is only generate an upgrade script if the sys description contains 2960X and the current Image OS Does Not contain 15.2(2)E5. a portion of the change script is below...
if (@IOS_FILENAME contains ' ')
foreach ( @node in @ContextNode )
if ( @node.OSImage Contains 'C2960X-' ) only generate upgrade script if switch stack is a Cisco 2960X
if ( @node.OSVersion != '15.2(2)E5, RELEASE SOFTWARE' ) and if the current image is not 15.2(2)E5,
When the change wizard runs it seems to identify just the Cisco 2960X OK but it is still generating a config upgrade script for the switches that already have the correct version.
The question I have is am I using the correct syntax for the 'Does Not Contain' if statement?
Thanks in advance for any thoughts or suggestions...