autoaccept_grains.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. .. _tutorial-autoaccept-grains:
  2. ==============================
  3. Autoaccept minions from Grains
  4. ==============================
  5. .. versionadded:: 2018.3.0
  6. To automatically accept minions based on certain characteristics, e.g. the ``uuid``
  7. you can specify certain grain values on the salt master. Minions with matching grains
  8. will have their keys automatically accepted.
  9. 1. Configure the autosign_grains_dir in the master config file:
  10. .. code-block:: yaml
  11. autosign_grains_dir: /etc/salt/autosign_grains
  12. 2. Configure the grain values to be accepted
  13. Place a file named like the grain in the autosign_grains_dir and write the values that
  14. should be accepted automatically inside that file. For example to automatically
  15. accept minions based on their ``uuid`` create a file named ``/etc/salt/autosign_grains/uuid``:
  16. .. code-block:: none
  17. 8f7d68e2-30c5-40c6-b84a-df7e978a03ee
  18. 1d3c5473-1fbc-479e-b0c7-877705a0730f
  19. The master is now setup to accept minions with either of the two specified uuids.
  20. Multiple values must always be written into separate lines.
  21. Lines starting with a ``#`` are ignored.
  22. 3. Configure the minion to send the specific grains to the master in the minion config file:
  23. .. code-block:: yaml
  24. autosign_grains:
  25. - uuid
  26. Now you should be able to start salt-minion and run ``salt-call
  27. state.apply`` or any other salt commands that require master authentication.