2014-06-17 22:15:19 +00:00
|
|
|
.. _targeting-ipcidr:
|
|
|
|
|
|
|
|
==========================
|
|
|
|
Subnet/IP Address Matching
|
|
|
|
==========================
|
|
|
|
|
|
|
|
Minions can easily be matched based on IP address, or by subnet (using CIDR_
|
|
|
|
notation).
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
salt -S 192.168.40.20 test.ping
|
2017-03-09 12:52:13 +00:00
|
|
|
salt -S 2001:db8::/64 test.ping
|
2014-06-17 22:15:19 +00:00
|
|
|
|
2015-02-16 11:05:47 +00:00
|
|
|
Ipcidr matching can also be used in compound matches
|
2015-02-16 10:25:05 +00:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
salt -C 'S@10.0.0.0/24 and G@os:Debian' test.ping
|
|
|
|
|
|
|
|
It is also possible to use in both pillar and state-matching
|
|
|
|
|
2015-02-16 10:03:43 +00:00
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
'172.16.0.0/12':
|
|
|
|
- match: ipcidr
|
|
|
|
- internal
|
2015-02-16 10:25:05 +00:00
|
|
|
|
2014-06-17 22:15:19 +00:00
|
|
|
.. _CIDR: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
|