Sometimes, even the smallest of typos or mistakes in configurations can create the biggest problems in infrastructure if not tested and checked before applying them. In this recipe, you will learn how to test state configurations before applying them to minions.
We will make use of the minion and states configured in the previous recipe Setting and using variables in states. We will also assume that the minion is a fresh install with no previous configurations applied to it:
Run the following command:
[root@salt-master ~]# salt 'stgdc1app02' state.sls user \ saltenv=staging test=True stgdc1app02: ---------- ID: cyclonus Function: user.present Result: None Comment: User cyclonus set to be added Changes: ---------- ID: megatron Function: user.present Result: None Comment: User megatron set to be added Changes: Summary ------------ Succeeded: 0 Failed: 0 Not Run: 2 ...