Live data from Hacker News

Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

github.com

31–40 of 77 posts

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#31
Looks interesting; my klunky script for doing something similar has been something along the lines of

    printf 'started: %s\n' "$(utcdate)"

    (
        trap 'kill 0' SIGINT
        for REMOTE in "${REMOTES[@]}"
        do
            ssh -- "$REMOTE" "$COMMAND" "$@" &
        done
        wait
    )

    printf 'ended: %s\n' "$(utcdate)"
but twiddling with it has been quite annoying, so I'll look into this tool.

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#32
To me GNU parallel is the top of the line here (as it is for most things parallel).

For the most common cases I have it aliased to just `p`: https://github.com/Julian/dotfiles/blob/main/.config/zsh/com...

Or https://github.com/Julian/dotfiles/blob/4d36e6b17e9804a887ba...

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#33

To me GNU parallel is the top of the line here (as it is for most things parallel). For the most common cases I have it aliased to just `p`: https://github.com/Julian/dotfiles/blob/main/.config/zsh/com... Or https://github.com/Julian/dotfiles/blob/4d36e6b17e9804a887ba...

what is the use case? why wouldn't you use something else (like ansible or puppet or something)? I do not understand why someone would do things like this.

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#34

To me GNU parallel is the top of the line here (as it is for most things parallel). For the most common cases I have it aliased to just `p`: https://github.com/Julian/dotfiles/blob/main/.config/zsh/com... Or https://github.com/Julian/dotfiles/blob/4d36e6b17e9804a887ba...

what is the use case? why wouldn't you use something else (like ansible or puppet or something)? I do not understand why someone would do things like this.

[deleted]

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#36

ansible my_servers -m shell -a 'fortune && reboot' -b I know it is easy to be a hater, but sincerely do not see a reason to use something like that over Ansible or just pure sh, ssh and scp. All you have to do is to set up keys and the inventory. Takes 10 minutes, even if you are doing it for the first time. And you can expand it if you need it.

Ansible doesn't work on windows. Stop assuming your method works across the universe of edge cases.

Ansible server does not work on windows, yes, but you can configure windows hosts with Ansible out of the box.

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#37

To me GNU parallel is the top of the line here (as it is for most things parallel). For the most common cases I have it aliased to just `p`: https://github.com/Julian/dotfiles/blob/main/.config/zsh/com... Or https://github.com/Julian/dotfiles/blob/4d36e6b17e9804a887ba...

[flagged]

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#38

ansible my_servers -m shell -a 'fortune && reboot' -b I know it is easy to be a hater, but sincerely do not see a reason to use something like that over Ansible or just pure sh, ssh and scp. All you have to do is to set up keys and the inventory. Takes 10 minutes, even if you are doing it for the first time. And you can expand it if you need it.

I use pssh often (not this tool, but as I understand is similar). The reasons I find it over Ansible are: - takes the same syntax and options as plain SSH, just run over multiple hosts. So if you already know SSH, you know how to use pssh that is an extension of the command. Ansible requires to study it. The configuration format is trivial, just a file that contains on each line one host, no need to study complex for…

For clarity Ansible does allow to run commands on a target host without Python installed using the raw module

I do agree with your point, sometimes it's just easier to use native tools or simple wrappers around native tools. Use whatever makes your job easier

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#39
post #4

How are commands handled, that require user input? E.g. password for sudo in your example: sshsync group web-servers "sudo systemctl restart nginx" I like that you included a demo in the README, but it is too long for a gif, as I can't pause/rewind/forward. So splitting into multiple short gifs or converting into a video (if GitHub supports them) could improve the experience.

As of now there is no way to take user input in transit, so either the user is required to have the privilege to execute the specified command or have passwordless sudo available. And Yeah, now that you've mentioned it multiple shorter gifs would be better.

Or https://asciinema.org/ instead of gifs

Re: Show HN: Sshsync – CLI tool to run shell commands across multiple remote servers

#40

ansible my_servers -m shell -a 'fortune && reboot' -b I know it is easy to be a hater, but sincerely do not see a reason to use something like that over Ansible or just pure sh, ssh and scp. All you have to do is to set up keys and the inventory. Takes 10 minutes, even if you are doing it for the first time. And you can expand it if you need it.

Ansible requires python to be installed on all of the target computers.

That's not necessarily true. There is the raw module that executes a bare command. https://docs.ansible.com/ansible/latest/collections/ansible/...
Post reply on HN