Quickstart: your first playbook over SSH
Describe your hosts, write a playbook, preview the changes with --check, then apply them. Five steps, no agents.
Get the CLI
Fleetrack will ship as one static binary for Linux and macOS, with no Python or other runtime to install. Download links will appear here with the first release.
Your hosts need nothing but SSH, and a user with the rights your tasks need (installing packages usually means sudo).
Describe your hosts
The inventory is plain YAML: groups of hosts, their addresses, and variables for a group or a single host. Here two groups, web and db, share one SSH user.
# Plain YAML: groups, hosts, variables.all: vars: ssh_user: deploy children: web: hosts: web-01: { host: 10.0.1.11 } web-02: { host: 10.0.1.12 } web-03: { host: 10.0.1.13 } db: hosts: db-01: { host: 10.0.2.21, port: 2222 }Write a playbook
A playbook says which hosts it targets and lists tasks. Each task calls a module that describes an end state, so running it again changes nothing that is already right.
- name: Configure web servers hosts: web vars: workers: 4096 tasks: - name: Install nginx package: name: nginx state: present - name: Render nginx.conf template: src: templates/nginx.conf.j2 dest: /etc/nginx/nginx.conf mode: "0644" - name: Publish the site copy: src: dist/ dest: /var/www/site/ - name: Log directory file: path: /var/log/site state: directory owner: www-data - name: Check the config shell: nginx -t - name: Keep nginx running service: name: nginx state: started enabled: true| Module | What it does | Keys used above |
|---|---|---|
| package | Installs or removes a system package | name, state |
| template | Renders a template with your variables and writes it to the host | src, dest, mode |
| copy | Copies files or directories to the host | src, dest |
| file | Manages paths: directories, owners, permissions | path, state, owner |
| shell | Runs a command on the host | the command |
| service | Starts, stops and enables services | name, state, enabled |
Preview with --check
A dry run connects to every host and reports what would change, without changing anything.
$ fleetrack run site.yml -i inventory.yml --check would change web-01 template /etc/nginx/nginx.conf would change web-03 package nginx in sync web-02 Check mode: nothing was changed.Apply
Drop --check to apply. Tasks run on all hosts in parallel; each host reports ok (already right), changed (with a diff) or failed.
$ fleetrack run site.yml -i inventory.ymlPLAY Configure web servers · 3 hostsTASK Install nginx package ok web-01 ok web-02 changed web-03 nginx 1.24.0 installedTASK Render nginx.conf template changed web-01 /etc/nginx/nginx.conf │ @@ -14,3 +14,3 @@ events { │ - worker_connections 768; │ + worker_connections 4096; ok web-02 ok web-03TASK Keep nginx running service changed web-01 reloaded ok web-02, web-03RECAP web-01 ok=3 changed=2 failed=0 web-02 ok=3 changed=0 failed=0 web-03 ok=3 changed=1 failed=0 3 hosts in 2.1s$ Output shortened to three of the six tasks; illustrative until the first release.
Run the same command again and every host reports changed=0: the playbook is idempotent.
Next: run it as a team
Fleetrack Cloud runs the same playbooks from a web UI with schedules, job history, access control and an audit log, through a runner in your network. See it in the demo, on sample data.
Try the live demo