Dependency for for loops in saltstack

I have a saltstack script where I add 2 files into /etc/apt/sources.list.d/ using file.managed followed by a for loop like below

{% for repo in salt['file.find']('/etc/apt/sources.list.d/',name='*list') -%}

The for loop is not picking up the two newly added files in prior steps. Anyone know how to force saltstack to evaluate the for loop after the files are written?

What do you want to do with these repos?

You should either manage them entirely from a salt state, or run a shell script from salt that will do manage the repos locally on the target.

1 Like