I am doing some operations with Kafka via salt, and using scripts to perform them.
My current SLS file looks roughly like:
/tmp/script.sh: file.managed: - source: salt://blah/blah Run script: cmd.run: - name: /tmp/script.sh delete /tmp/script.sh: file.absent - name: /tmp/script.sh
script.sh is idempotent itself. But I always get a
changed=2 status report at the end of applying the state, because of it putting the script down and then deleting it.
Is there a more idiomatic way in Salt to have temporary scripts that don't live on the target box? Or do people usually just leave them in /tmp so that they don't see a reported change when applying a state.