3 ms·
I couldn't agree more with you about Ansible... I've started using Ansible in two projects, and I think it was enough for me... Ansible is perhaps great when
by ciprian_craciun 5y ago
I couldn't agree more with you about Ansible... I've started using Ansible in two projects, and I think it was enough for me... Ansible is perhaps great when you have granular tasks, that maybe don't need to communicate between them, or perhaps that don't have too much logic (or worse loops). However, as soon as your Ansible "scripts" start becoming actual "scripts", everything gets out of hand... (Also the performance is terrible due to the fact that each task is "bundled" on the host, copied remotely, extracted, executed, deleted, repeat for each and every instance of the same task...)
----
Now about your `tricorder`, by looking at the readme, I gather it just allows one to run the same command over multiple hosts (filtered by name or tag), but nothing beyond that? How could one run for example a pipeline of tools on the remote hosts? (I assume `bash -c 'tool-1 | tool-2'`, but with careful escaping?)
Perhaps a first step towards actually being an "Ansible replacement" would be to bring back in some "scripting" ability. For example instead of giving each command as arguments, there could be a "library of scripts", and the user can choose one of those to run on each remote host. Then those scripts could be written in whatever language the user chooses (`bash`, Python, Ruby, etc.)
Also, with regard to the "library of scripts", one thing that Ansible got right is the possibility to put multiple different tasks in the same file, thus one doesn't need 20 files for 20 small tasks, but instead these can be put inside the same YAML file.
----
For example this is how I did it in my own "Ansible replacement", <https://github.com/volution/z-run https://github.com/volution/z-run>, like for example, one can write something like these snippets: <https://github.com/volution/z-run/blob/development/examples/ssh.z-run https://github.com/volution/z-run/blob/development/examples/...> (see `ssh / launch / simple` that runs locally which just calls `z-run ssh "${_target}" ':: ssh / remote / main' "${@}"`, which is in itself a non trivial `bash` script, one that will run remotely.)
In the end, what I think we need, is a tool to easily run "scripts" on a remote system, but make it as easy to use as it would be on the local machine. (Sort of like the RPC but across SSH and for scripts.)
- gilcot 5y agoAt first look, your z-run remind me a helper[1] I use sometimes. For massive remote executions, I often use dssh[2] program or similar. I think that tricorder belongs to that later category and isn't a true library of scripts dispatcher. [1] https://github.com/lucaswerkmeister/cheats https://github.com/lucaswerkmeister/cheats [2] http://sigpipe.io/dssh http://sigpipe.io/dssh
- linkdd 5y agoThank you for your feedback. > I gather it just allows one to run the same command over multiple hosts (filtered by name or tag), but nothing beyond that? For now. I intend to carefully extend it to other features, like in said in the original post: - mimic the "gather facts" feature from ansible so you can query it with `jq` - provide an API in a few programming languages so that you can choose whatever fits your needs to "script" the logic (and with Rust/Go, distributing a single binary as a 'setup.exe' should be plenty enough) - probably a plugin system similar to kubectl (as in subcommands look in PATH for a binary named `tricorder-subcommand`) I'd like to see it becoming a real replacement for YAML based workflows, but I started small because I don't want to repeat the same mistakes. I'd like to see how people would use this before building on it.
- gilcot 5y ago> For example instead of giving each command as arguments, there could be a "library of scripts", and the user can choose one of those to run on each remote host. Then those scripts could be written in whatever language the user chooses (`bash`, Python, Ruby, etc.) For running scripts from a library, I've used ByJG's automate.sh[1] that call'em recipes. Unlike z-run, they're bash only and there's no select menu and looks simpler. [1] https://github.com/byjg/automate https://github.com/byjg/automate