Re:Show HN: I built a simple, open-source tool to manage ser...
by adolph on Tuesday August 06, 2024 @03:08PM
(#41174166)
Also you can organize servers into different config files and Include them your base config,.
https://man7.org/linux/man-pages/man5/ssh_config.5.html
[ Parent
| on HN ]
Re:Show HN: I built a simple, open-source tool to manage ser...
by malikNF on Tuesday August 06, 2024 @11:21PM
(#41177956)
This looks very useful. I did not know this. Thank you!
Re:Show HN: I built a simple, open-source tool to manage ser...
by adolph on Wednesday August 07, 2024 @12:36AM
(#41178271)
Hope it helps. I use the configs as a source of truth and have a dozen or so different included files. This way the servers are grouped logically similar to ansible enventories (which I generate using the different configs). Running a command against all servers in one or more configs is simple this way:
$ grep '^Host' .ssh/<config file> | awk '{print $2}' | while read hst; do ssh $hst '<remote command>' 2> /dev/null < /dev/null; done