I have a roster with some hosts/users:
myhos1:
host: 192.168.1.1
user: foouser
myhost2:
host: 192.168.1.2
user: bazuser
Now in the state file I would like to use the username from the roster to do things, e.g.
Install VNC script:
file.managed:
- name: /home/<user>/test.sh
- source: salt://files/test.sh
- user: <user>
- group: <user>
How do I use the template language to replace <user>
with the actual user-id of the host that I apply the state to?
Would be nice if I can somehow directly access the information from the roster, but I did not find anything that would work in the relevant docu-pages.