pillar.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. .. _targeting-pillar:
  2. ======================
  3. Targeting using Pillar
  4. ======================
  5. Pillar data can be used when targeting minions. This allows for ultimate
  6. control and flexibility when targeting minions.
  7. .. note::
  8. To start using Pillar targeting it is required to make a Pillar
  9. data cache on Salt Master for each Minion via following commands:
  10. ``salt '*' saltutil.refresh_pillar`` or ``salt '*' saltutil.sync_all``.
  11. Also Pillar data cache will be populated during the
  12. :ref:`highstate <running-highstate>` run. Once Pillar data changes, you
  13. must refresh the cache by running above commands for this targeting
  14. method to work correctly.
  15. Example:
  16. .. code-block:: bash
  17. salt -I 'somekey:specialvalue' test.version
  18. Like with :ref:`Grains <targeting-grains>`, it is possible to use globbing
  19. as well as match nested values in Pillar, by adding colons for each level that
  20. is being traversed. The below example would match minions with a pillar named
  21. ``foo``, which is a dict containing a key ``bar``, with a value beginning with
  22. ``baz``:
  23. .. code-block:: bash
  24. salt -I 'foo:bar:baz*' test.version