We are using serverdensity (BETA MODULE - https://docs.saltstack.com/en/latest/ref/states/all/salt.states.serverdensity_device.html) with salt and have hit the (bug?) where if you try a :
salt '*SERVER-01*' --state-output=mixed state.apply serverdensity test=True
Then the serverdensity module always tries to add the server to monitoring whether it's in 'test=True' mode or not.
I was hoping to set a Jinja variable (or use an existing one?) with the current test mode and thus do a "if test then echo 'not adding' else add" to get past this.
However I can't find out how to do this in the docs or google searches. I even looked to see if I could pull in the ENV args on the master to see if it was passed as a command line arg but $@ produces nothing in:
{% set args = salt['environ.get']('@') %}
Any ideas?
Running salt 2018.3.2 (Oxygen) on Centos 7