{"id":48178960,"url":"https://github.com/exterrestris/ansible-role-sanoid","last_synced_at":"2026-04-04T17:41:43.826Z","repository":{"id":44567859,"uuid":"346933230","full_name":"exterrestris/ansible-role-sanoid","owner":"exterrestris","description":"Ansible role to install and configure Sanoid \u0026 Syncoid","archived":false,"fork":false,"pushed_at":"2025-09-11T12:40:44.000Z","size":47,"stargazers_count":3,"open_issues_count":13,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T15:49:05.595Z","etag":null,"topics":["ansible","ansible-role","sanoid","syncoid","zfs-snapshots"],"latest_commit_sha":null,"homepage":"","language":"Jinja","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/exterrestris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-12T04:09:25.000Z","updated_at":"2025-09-11T12:35:46.000Z","dependencies_parsed_at":"2022-09-11T20:31:13.628Z","dependency_job_id":"b90c50f4-21a1-48c5-803a-db7384b61c7c","html_url":"https://github.com/exterrestris/ansible-role-sanoid","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/exterrestris/ansible-role-sanoid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exterrestris%2Fansible-role-sanoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exterrestris%2Fansible-role-sanoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exterrestris%2Fansible-role-sanoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exterrestris%2Fansible-role-sanoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exterrestris","download_url":"https://codeload.github.com/exterrestris/ansible-role-sanoid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exterrestris%2Fansible-role-sanoid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ansible","ansible-role","sanoid","syncoid","zfs-snapshots"],"created_at":"2026-04-04T17:41:43.355Z","updated_at":"2026-04-04T17:41:43.821Z","avatar_url":"https://github.com/exterrestris.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible role `exterrestris.sanoid`\n\nAn Ansible role to install and configure automated ZFS snapshots and replication using [Sanoid/Syncoid](https://github.com/jimsalterjrs/sanoid) managed by systemd timers, with optional [Healthchecks.io](https://healthchecks.io) support via [runitor](https://github.com/bdd/runitor)\n\n## Requirements\n\n- ZFS\n- systemd\n\nIn order for Syncoid to replicate to a remote host, you must ensure that SSH access via public key authentication is correctly set up for the relevant users\n\n## Role Variables\n\n### Installation\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `sanoid_install_from` | `\"package\"` | Install Sanoid from OS package or from GitHub |\n| `syncoid_healthchecks_install_runitor` | `false` | Install [runitor](https://github.com/bdd/runitor) for Healthchecks.io support\u003cbr\u003e*When set to `true`, will install runitor only if there is at least one `syncoid_syncs` entry with `healthchecks` defined* |\n\n#### Install from source\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `sanoid_source_github_url` | https://github.com/jimsalterjrs/sanoid | GitHub repo to clone |\n| `sanoid_source_version` | `latest` | Git branch, tag or commit to checkout. `latest` will select the most recent release |\n| `sanoid_source_download_dir` | `/tmp/sanoid` | Directory to clone repo to |\n| `sanoid_source_install_dir` | `/usr/local/sbin` | Directory to install binaries to |\n| `sanoid_source_remove_package` | `yes` | Remove the OS package if installed |\n\n#### Runitor/Healthchecks\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `syncoid_healthchecks_runitor_github_url` | `https://github.com/bdd/runitor` | GitHub repo to download latest release from |\n| `syncoid_healthchecks_runitor_install_dir` | `/usr/local/sbin` | Directory to install runitor binary to |\n\n\n### Sanoid Configuration\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `sanoid_templates` | Example templates from [sanoid.conf](https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.conf) | List of policy templates |\n| `sanoid_datasets` | `[]` | List of datasets to snapshot |\n\n#### `sanoid_templates[]`\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `name` | *Required* | Template name |\n| *`setting`* | `\"\"` | Policy setting |\n\nAll settings supported by Sanoid in templates are supported - see [sanoid.conf](https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.conf) and [sanoid.defaults.conf](https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.defaults.conf) for details\nSimilarly, most [Syncoid flags](https://github.com/jimsalterjrs/sanoid/wiki/Syncoid#options) are configurable via `syncoid_syncs`.\n\n#### `sanoid_datasets[]`\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `name` | *Required* | ZFS dataset to snapshot |\n| `templates` | *Required* | Sanoid template(s) to use for policy |\n| `recursive` | `\"no\"` | Include child datasets with this dataset |\n| `process_children_only` | `\"no\"` | Do not include this dataset |\n| `overrides` | `[]` | List of template settings to override |\n\n#### systemd Settings\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `sanoid_service_pre_start` | `[]` | Add ExecStartPre commands to the Sanoid systemd service file |\n| `sanoid_service_post_start` | `[]` | Add ExecStartPost commands to the Sanoid systemd service file |\n| `sanoid_prune_service_pre_start` | `[]` | Add ExecStartPre commands to the Sanoid Prune systemd service file |\n| `sanoid_prune_service_post_start` | `[]` | Add ExecStartPost commands to the Sanoid Prune systemd service file |\n\n\n### Syncoid Configuration\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `syncoid_syncs` | `[]` | List of datasets to replicate |\n| `syncoid_send_options` | `\"\"` | Default additional options to pass to the zfs send command via `syncoid --sendoptions` |\n| `syncoid_recv_options` | `\"\"` | Default additional options to pass to the zfs recieve command via `syncoid --recvoptions` |\n| `syncoid_use_ssh_key` | `yes` | Use an SSH key to login to remote hosts |\n| `syncoid_generate_ssh_key` | `yes` | Generate an SSH key for Syncoid to use |\n| `syncoid_generated_ssh_key` | `id_syncoid` | Name of generated SSH key |\n| `syncoid_ssh_key` | `/root/.ssh/{`*`syncoid_generated_ssh_key`*` \\| id_rsa }` | Path to SSH key for Syncoid to use |\n| `syncoid_ssh_key_install_remote` | `yes` | Install specified SSH key on remote hosts. Requires remote hosts to be defined in inventory |\n| `syncoid_update_known_hosts` | `yes` | Update known_hosts with src/destination host public keys. |\n\n#### `syncoid_syncs[]`\nA separate systemd service will be generated for each sync listed, grouped into a single systemd target triggered by a systemd timer. The generated services are configured to run one at a time, in the order they are listed\n\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `name` | Auto-generated | Name to use for the generated systemd service.\u003cbr\u003e*Specifying a human-readable name is highly recommended* |\n| `src` | *Required* | Source ZFS dataset |\n| `src_host` | `\"\"` | Source host |\n| `src_user` | `\"root\"` | Source user. Ignored if `src_host` empty |\n| `dest` | *Required* | Destination ZFS dataset |\n| `dest_host` | `\"\"` | Destination host |\n| `dest_user` | `\"root\"` | Destination user. Ignored if `dest_host` empty |\n| `recursive` | `\"no\"` | Copy child datasets |\n| `force_delete` | `\"no\"` | Remove destination datasets recursively |\n| `send_options` | `\"\"` | Additional options to pass to the zfs send command via `syncoid --sendoptions` |\n| `recv_options` | `\"\"` | Additional options to pass to the zfs recieve command via `syncoid --recvoptions` |\n\n#### systemd Settings\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `syncoid_service_name` | `\"syncoid\"` | Name to use for the Syncoid systemd target, and the prefix to use for the individual systemd sync services |\n| `syncoid_timer_frequency` | `\"daily\"` | systemd service frequency for Syncoid |\n| `syncoid_syncs[].systemd.pre_start` | `[]` | Add ExecStartPre commands to the systemd service file for the specific sync |\n| `syncoid_syncs[].systemd.post_start` | `[]` | Add ExecStartPost commands to the systemd service file for the specific sync |\n\n\n### Healthchecks.io\n| Variable | Default | Comments |\n| :--- | :--- | :--- |\n| `syncoid_healthchecks_api_url` | `\"https://hc-ping.com\"` | Default Healthchecks.io API URL to use |\n| `syncoid_healthchecks_ping_key` | `\"\"` | Default project ping key to use |\n| `syncoid_syncs[].healthchecks.api_url` | `{{ syncoid_healthchecks_api_url }}` | API URL to use for the specific sync |\n| `syncoid_syncs[].healthchecks.ping_key` | `{{ syncoid_healthchecks_ping_key }}` | Project ping key to use for the specific sync |\n| `syncoid_syncs[].healthchecks.slug` | Required | Check slug to use for the specific sync |\n\n## Example\n\n```Yaml\nsyncoid_healthchecks_install_runitor: true\nsyncoid_healthchecks_ping_key: **project-ping-key**\n\nsanoid_templates:\n  - name: production\n    frequently: 0\n    hourly: 36\n    daily: 30\n    monthly: 3\n    yearly: 0\n    autosnap: 'yes'\n    auto prune: 'yes'\n  - name: backup\n    frequently: 0\n    hourly: 30\n    daily: 90\n    monthly: 12\n    yearly: 0\n    autoprune: 'yes'\n    autosnap: 'no'\n  - name: ignore\n    autoprune: 'no'\n    autosnap: 'no'\n    monitor: 'no'\n\nsanoid_datasets:\n  - name: zpoolname/dataset\n    templates:\n      - production\n      - demo\n    overrides:\n      hourly: 12\n      monthly: 1\n  - name: zpoolname/parent\n    templates: production\n    recursive: 'yes'\n    process_children_only: 'yes'\n  - name: zpoolname/parent/child\n    templates: demo\n    overrides:\n      hourly: 4\n\nsyncoid_syncs:\n  - name: main-backup\n    src: zpoolname/parent\n    dest: zpoolname/parent-backup\n    dest_host: remote\n    recursive: yes\n    # Healthchecks.io ping via runitor\n    healthchecks:\n      slug: main-backup\n  - src: zpoolname/dataset\n    dest: zpoolname/dataset-backup\n    # Manual Healthchecks.io ping via curl\n    systemd:\n      pre_start:\n        - \"/usr/bin/curl https://hc-ping.com/**uuid**/start\"\n      post_start:\n        - \"/usr/bin/curl https://hc-ping.com/**uuid**\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexterrestris%2Fansible-role-sanoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexterrestris%2Fansible-role-sanoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexterrestris%2Fansible-role-sanoid/lists"}