Targeting using List of Minion ID

Targeting using Grains

e.g. we need to know the software version of all IOS routers in our network.

root@mrcissp-master-1:/# salt -C 'G@os:ios' napalm.call 'cli' ['show version']
Router1:
----------
comment:
out:
----------
show version:
Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.6(2)T, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Tue 22-Mar-16 16:19 by prod_rel_team
ROM: Bootstrap program is IOSv
R1 uptime is 1 minute
System returned to ROM by reload
System restarted at 05:47:13 UTC Mon Nov 25 2019
System image file is "flash0:/vios-adventerprisek9-m"
Last reload reason: Unknown reason
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
Cisco IOSv (revision 1.0) with with 460017K/62464K bytes of memory.
Processor board ID 97277GPG1FLKXDX5WL1G0
4 Gigabit Ethernet interfaces
DRAM configuration is 72 bits wide with parity disabled.
256K bytes of non-volatile configuration memory.
2097152K bytes of ATA System CompactFlash 0 (Read/Write)
0K bytes of ATA CompactFlash 1 (Read/Write)
1024K bytes of ATA CompactFlash 2 (Read/Write)
0K bytes of ATA CompactFlash 3 (Read/Write)
Configuration register is 0x0
result:
True
root@mrcissp-master-1:/#

Targeting using Pillars

e.g. we need to know the software version of all WLC in our network. Since, WLCs are managed by NAPALM hence appropriate grains are not collected for OS type. Therefore, we cannot Target all WLC’s using grains as discussed above. To do this, we can be sure that all the WLC’s in our network must be managed by “netmiko” proxy pillar. Hence, we can target using Pillar.

Compound Targeting

e.g. we need to know the software version of all IOS routers of model IOSv.

root@mrcissp-master-1:/# salt -C 'G@os:ios and G@model:IOSv' napalm.call 'cli' ['show version']
Router1:
----------
comment:
out:
----------
show version:
Cisco IOS Software, IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.6(2)T, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2016 by Cisco Systems, Inc.
Compiled Tue 22-Mar-16 16:19 by prod_rel_team
ROM: Bootstrap program is IOSv
R1 uptime is 15 minutes
System returned to ROM by reload
System restarted at 05:47:13 UTC Mon Nov 25 2019
System image file is "flash0:/vios-adventerprisek9-m"
Last reload reason: Unknown reason
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
Cisco IOSv (revision 1.0) with with 460017K/62464K bytes of memory.
Processor board ID 97277GPG1FLKXDX5WL1G0
4 Gigabit Ethernet interfaces
DRAM configuration is 72 bits wide with parity disabled.
256K bytes of non-volatile configuration memory.
2097152K bytes of ATA System CompactFlash 0 (Read/Write)
0K bytes of ATA CompactFlash 1 (Read/Write)
1024K bytes of ATA CompactFlash 2 (Read/Write)
0K bytes of ATA CompactFlash 3 (Read/Write)
Configuration register is 0x0
result:
True