--
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/954fef17-0a8f-46f9-b12c-37eaf7bf1a98n%40googlegroups.com.
so, there are several things to look at. what was given was one way.
Another is to have the pillar targeted so that a minion only gets the items it needs instead of the whole thing. so no ifs would be needed at all just putting the contents there and using targeting to handle the rest this is what is considered the best practice.
also you were not far off. in your original question to another answer. just you didn’t know how to concat in jinja. the following would give the expected results you were looking for.
cluster-authorized_key:
file.prepend:
- name: /root/.ssh/authorized_keys - text: {{ pillar[grains['cluster] ~ '-pub'] }}
- makedirs: True
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/3bb2dc10-2341-4f60-9a96-b4c018ebc478n%40googlegroups.com.