SaltStack: Use Temporary Scripts And Not Cause State Changes To Reported
You might want to consider adding an unless or onlyif requisite in the first directive - especially if script.sh is particularly complicated or expensive. With unless or onlyif, you will use the reults of several BASH commands to determine if you need to push down and execute your script. If your system is out of plumb only then is the state enforced. If everything checks out OK, then the script will never be pushed and executed preventing changed=2 in the final status report. You will want to use a require requisite for the second and third directives to prevent them from running if the script is not pushed by file.managed otherwise you will get to errors instead of two changes.