@fateknollogee said in SaltStack setup for /etc/hosts:
I remember this has been discussed on the forums sometime back when...
I'd like to have a master host file & push this out to Linux & Windows servers & desktops.
Anyone have a good how to guide?
One more thing, you'll want to use file.managed in a State file.
That way, you keep a master copy on Git and only need to edit that. Saltstack will take care of the rest and make sure all minions have that updated file.
Otherwise, with salt-cp, you have to manually SSH to the salt-master server and run the command. I'd rather just update the file in VSCode, then be done with it...
In your State file, you can do Linux and Windows using an If statement, having it do it one way for each OS.
I use grains, os_family, etc.