This question is similar to this.
If I understand your question correctly - I believe that the best way to achieve what you want is Salt Macros .
In this case, most of your state will go to macros with placeholders, such as:
Then your condition will look like this:
# john.sls {% from 'lib.sls' import create_user with context %} {{ create_user('john', '<password hash>') }}
and
# jane.sls {% from 'lib.sls' import create_user with context %} {{ create_user('john', '<password hash>') }}
alexK
source share