1
0

testing.rst 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. =============
  2. State Testing
  3. =============
  4. Executing a Salt state run can potentially change many aspects of a system and
  5. it may be desirable to first see what a state run is going to change before
  6. applying the run.
  7. Salt has a test interface to report on exactly what will be changed, this
  8. interface can be invoked on any of the major state run functions:
  9. .. code-block:: bash
  10. salt '*' state.apply test=True
  11. salt '*' state.apply mysls test=True
  12. salt '*' state.single test=True
  13. The test run is mandated by adding the ``test=True`` option to the states. The
  14. return information will show states that will be applied in yellow and the
  15. result is reported as ``None``.
  16. Default Test
  17. ============
  18. If the value ``test`` is set to ``True`` in the minion configuration file then
  19. states will default to being executed in test mode. If this value is set then
  20. states can still be run by calling test=False:
  21. .. code-block:: bash
  22. salt '*' state.apply test=False
  23. salt '*' state.apply mysls test=False
  24. salt '*' state.single test=False