{"id":18257899,"url":"https://github.com/linkdd/tricorder","last_synced_at":"2025-04-04T18:31:23.300Z","repository":{"id":42461204,"uuid":"474149708","full_name":"linkdd/tricorder","owner":"linkdd","description":"Automation the KISS way","archived":false,"fork":false,"pushed_at":"2023-10-06T15:59:15.000Z","size":251,"stargazers_count":54,"open_issues_count":8,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-20T17:05:51.357Z","etag":null,"topics":["automation","rust","ssh"],"latest_commit_sha":null,"homepage":"https://linkdd.github.io/tricorder/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkdd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-25T20:06:30.000Z","updated_at":"2025-01-19T09:59:32.000Z","dependencies_parsed_at":"2022-09-13T23:52:10.349Z","dependency_job_id":null,"html_url":"https://github.com/linkdd/tricorder","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftricorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftricorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftricorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkdd%2Ftricorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkdd","download_url":"https://codeload.github.com/linkdd/tricorder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128741,"owners_count":20888234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","rust","ssh"],"created_at":"2024-11-05T10:28:06.495Z","updated_at":"2025-04-04T18:31:22.594Z","avatar_url":"https://github.com/linkdd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tricorder\n\nAutomation the [KISS](https://en.wikipedia.org/wiki/KISS_principle) way.\n\n[![Crates.io](https://img.shields.io/crates/v/tricorder?style=flat-square)](https://crates.io/crates/tricorder)\n[![Crates.io](https://img.shields.io/crates/l/tricorder?style=flat-square)](https://crates.io/crates/tricorder)\n[![Crates.io](https://img.shields.io/crates/d/tricorder?style=flat-square)](https://crates.io/crates/tricorder)\n[![docs.rs](https://img.shields.io/docsrs/tricorder?style=flat-square)](https://docs.rs/tricorder)\n[![website](https://img.shields.io/github/actions/workflow/status/linkdd/tricorder/deploy-site.yml?label=website\u0026style=flat-square)](https://linkdd.github.io/tricorder/)\n[![Gitter](https://img.shields.io/gitter/room/linkdd/tricorder?style=flat-square)](https://matrix.to/#/#tricorder:gitter.im)\n\n## Introduction\n\n[Ansible](https://ansible.com) is a great tool for automation. But it suffers\nfrom the same problem of many such tools: a big pile of custom YAML DSL.\n\nYAML is used to provide a declarative syntax of your automated workflow. This is\nnice for simple use cases, but automation can become rather complex very\nquickly.\n\nBut once those tools start implementing:\n\n - control flow structures (conditions, loops)\n - variable assignations\n - modules\n - package management\n - ...\n\nYour YAML files become a programming language with terrible developer\nexperience.\n\n**tricorder** aims to fix this. It gives you a single tool to perform tasks on\nmultiple remotes. You then use your common UNIX tools like `bash`, `jq`, `curl`,\netc... to compose those tasks together.\n\n## Usage\n\nJust like *Ansible*, **tricorder** uses an inventory file, listing the hosts\nto connect to:\n\n```toml\n[[hosts]]\n\nid = \"backend\"\ntags = [\"server\", \"backend\", \"myapp\"]\naddress = \"10.0.1.10:22\"\nuser = \"admin\"\n\n[[hosts]]\n\nid = \"frontend\"\ntags = [\"server\", \"frontend\", \"myapp\"]\naddress = \"10.0.1.20:22\"\nuser = \"admin\"\n```\n\n\u003e **NB:** The inventory is either a TOML file or an executable producing a JSON\n\u003e output. This way you can create dynamic inventories by querying a remote\n\u003e service or database.\n\nThen, run one of the following commands:\n\n```\n$ tricorder -i /path/to/inventory do -- echo \"run on all hosts\"\n$ tricorder -i /path/to/inventory -H backend do -- echo \"run on specific host\"\n$ tricorder -i /path/to/inventory -t \"server \u0026 myapp\" do -- echo \"run on all hosts matching tags\"\n```\n\nOr to run concurrently instead of sequencially:\n\n```\n$ tricorder -i /path/to/inventory do -p -- echo \"run on all hosts\"\n$ tricorder -i /path/to/inventory -H backend do -p -- echo \"run on specific host\"\n$ tricorder -i /path/to/inventory -t \"server \u0026 myapp\" do -p -- echo \"run on all hosts matching tags\"\n```\n\n\u003e **NB:** Authentication is done via `ssh-agent` only.\n\nEvery logging messages is written on `stderr`, the command result for each host\nis written as a JSON document on `stdout`:\n\n```json\n[\n  {\n    \"host\": \"backend\",\n    \"success\": false,\n    \"error\": \"...\"\n  },\n  {\n    \"host\": \"frontend\",\n    \"success\": true,\n    \"info\": {\n      \"exit_code\": 0,\n      \"stdout\": \"...\",\n      \"stderr\": \"...\",\n    }\n  }\n]\n```\n\nThis way, you can compose this tool with `jq` to extract the relevant informations\nin your scripts.\n\n## Usage with the Rust API\n\n**tricorder** is also available as a Rust crate to include it directly in your\nsoftware:\n\n```rust\nuse tricorder::prelude::*;\nuse tricorder::tasks::exec;\nuse serde_json::json;\n\nlet inventory = Inventory::new()\n  .add_host(\n    Host::new(Host::id(\"localhost\").unwrap(), \"localhost:22\".to_string())\n      .set_user(\"root\".to_string())\n      .add_tag(Host::tag(\"local\").unwrap())\n      .set_var(\"msg\".to_string(), json!(\"hello\"))\n      .to_owned()\n  )\n  .to_owned();\n\nlet task = exec::Task::new(\"echo \\\"{host.id} says {host.vars.msg}\\\"\".to_string());\n\n// Run the task sequentially:\nlet result = inventory.hosts.run_task_seq(\u0026task).unwrap();\n// Run the task concurrently:\nlet result = inventory.hosts.run_task_parallel(\u0026task).unwrap();\n\nprintln!(\"{}\", result);\n```\n\n## Documentation\n\nFor more informations, consult the [documentation](https://docs.rs/tricorder).\n\n## Roadmap\n\nCheckout the [Bug Tracker](https://github.com/linkdd/tricorder/milestones).\n\n## License\n\nThis software is released under the terms of the [MIT License](./LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Ftricorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkdd%2Ftricorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkdd%2Ftricorder/lists"}