are you doing this through salt-ssh? if not file.file_exists only tests the file exists on the local filesystem not in the salt file system and no salt doesn’t transfer the whole filesystem to the minion. only the files that have been used. and the file hasn’t been used by that point. there is a reason it is called a cachedir
if you want to test is in the salt file system. us cp.list_master and check if the file is in the list returned to you.
something more along the lines of
also for concat in jinja use ~ not +, ~ will translate everything to str so that there is no type confusion in the system + does not.
{% set filename = ''autoroles" ~ p ~ ".sls"
{% if filename in salt["cp.list_master"](saltenv=saltenv,prefix=filename) %}
stuff
{% endif %}
--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/7e779704-a25d-46bd-a686-984a72bff122n%40googlegroups.com.