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?
-
-
-
I can't believe this is almost a year old already... it should still be okay though:
https://timothygruber.com/linux/saltstack-installation-configuration/
If you hit any snags let me know and I'll update it.
Edit: Do you already have SaltStack up and running? If so ignore the guide, and I'll help you set up a State file.
-
@obsolesce said in SaltStack setup for /etc/hosts:
I can't believe this is almost a year old already... it should still be okay though:
https://timothygruber.com/linux/saltstack-installation-configuration/
If you hit any snags let me know and I'll update it.
Edit: Do you already have SaltStack up and running? If so ignore the guide, and I'll help you set up a State file.
No man, got nothing running, starting from scratch!!
-
@fateknollogee said in SaltStack setup for /etc/hosts:
@obsolesce said in SaltStack setup for /etc/hosts:
I can't believe this is almost a year old already... it should still be okay though:
https://timothygruber.com/linux/saltstack-installation-configuration/
If you hit any snags let me know and I'll update it.
Edit: Do you already have SaltStack up and running? If so ignore the guide, and I'll help you set up a State file.
No man, got nothing running, starting from scratch!!
Okay. Well let me know when you have the master up and running, and a minion going. Part2 of my guide has State creation and such but isn't finished yet.
-
@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.