{"id":13686509,"url":"https://github.com/gikeymarcia/ansible-role-sanoid","last_synced_at":"2025-04-09T21:44:49.455Z","repository":{"id":195276579,"uuid":"692600921","full_name":"gikeymarcia/ansible-role-sanoid","owner":"gikeymarcia","description":"Deploy sanoid ZFS snapshot mangement system in Debian-based environments (Ubuntu/Debian/Proxmox)","archived":false,"fork":false,"pushed_at":"2024-04-02T19:08:29.000Z","size":28,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T23:36:06.136Z","etag":null,"topics":["ansible","debian","proxmox","sanoid","ubuntu","zfs","zfs-snapshots"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/gikeymarcia/sanoid","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gikeymarcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-09-17T01:45:27.000Z","updated_at":"2024-08-25T20:54:00.000Z","dependencies_parsed_at":"2024-04-02T20:27:00.977Z","dependency_job_id":"8490c58f-d172-478d-8bc3-b27233e6cd52","html_url":"https://github.com/gikeymarcia/ansible-role-sanoid","commit_stats":null,"previous_names":["gikeymarcia/ansible-role-sanoid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gikeymarcia%2Fansible-role-sanoid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gikeymarcia%2Fansible-role-sanoid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gikeymarcia%2Fansible-role-sanoid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gikeymarcia%2Fansible-role-sanoid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gikeymarcia","download_url":"https://codeload.github.com/gikeymarcia/ansible-role-sanoid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119428,"owners_count":21050754,"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":["ansible","debian","proxmox","sanoid","ubuntu","zfs","zfs-snapshots"],"created_at":"2024-08-02T15:00:34.039Z","updated_at":"2025-04-09T21:44:49.434Z","avatar_url":"https://github.com/gikeymarcia.png","language":"Jinja","funding_links":[],"categories":["ansible"],"sub_categories":[],"readme":"gikeymarcia.sanoid\n=========\n\nDeploy [sanoid](https://github.com/jimsalterjrs/sanoid) for ZFS snapshot\nmanagement and Debian-based systems (Debian/Ubuntu/Proxmox). Also installs the\nother tools in the repo: `syncoid` (magical), `findoid`, and `sleepymutex` to\n`/usr/local/sbin`\n\nRequirements\n------------\n\nNone.\n\nRole Variables\n--------------\n\n```yaml\n# defaults\nsanoid_version: \"v2.2.0\"\nsanoid_run_each_x_minutes: 15\n```\n\nFirst variable is the version to pull from github\n\nSecond variable determies how regulary the systemd timer should run per hour.\nFor example, a value of 4 means to run every 4th minute of each hour. This\ntimer runs sanoid to check if snapshots need to be taken/pruned. When using\nhigh 'frequently' values you should adjust this value down so more snapshots\ncan be taken.\n\nEach of your snapshot templates are defined in the `sanoid_templates`\nvarialble. Below are a few example values but the\n[`defaults/main.yaml`](https://github.com/gikeymarcia/ansible-role-sanoid/blob/master/defaults/main.yml)\nhas all of the templates Jim Salter defines in the [sample\nsanoid.conf](https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.conf) on\nGitHub.\n\nIf you want to extend these values I recommend copying the default version of\nthe variable and adding/editing your own templates as playbook variables.\n\n```yaml\nsanoid_templates:\n  - name: docker\n    frequently: 3\n    hourly: 48\n    daily: 30\n    monthly: 6\n  - name: archive\n    daily: 5\n    weekly: 6\n    monthly: 12\n    yearly: 3\nsanoid_backup_modules:\n  - name: zpoolname/docker\n    template: docker\n    recursive: yes\n    process_children_only: yes\n  - name: zpoolname/datasetORzvol\n    template: archive\n    daily: 3\n    recursive: yes\n```\n\nThe 'sanoid_backup_modules' define which datasets/zvols are going to be managed\nby sanoid and which template to use as a snapshot policy. You can define\nmultiple template by comma separating them. For example,  'docker,archive'\nwould process those templates in order and apply the end result.\n\nYou can also override any given value by passing as a key value pair. Above the\n'zpoolname/datasetORzvol' dataset will have 3 daily snapshots.\n\nLearn more about the configuration values on [sanoid\ngithub](https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.conf). Not\nall of the available values have been added to the\n[template](https://github.com/gikeymarcia/ansible-role-sanoid/blob/master/templates/sanoid.conf.j2).\nIf you need anything not here add it to the role and send a pull request. I may\nrevisit this in the future but for now the role does all I need.\n\nDependencies\n------------\n\nNone.\n\nExample Playbook\n----------------\n\n```yaml\n- name: Setup sanoid to auto-snapshot your datasets\n  hosts: all\n  become: true\n\n  roles:\n    - role: gikeymarcia.sanoid\n      vars:\n        sanoid_backup_modules:\n          - name: tank/vms\n            template: vm_live\n            recursive: 'yes'\n            process_children_only: 'yes'\n          - name: tank/media\n            template: media\n            recursive: 'yes'\n        sanoid_templates:\n          - name: vm_live\n            hourly: 48\n            daily: 5\n            autosnap: \"yes\"\n            autoprune: \"yes\"\n          - name: media\n            hourly: 6\n            daily: 3\n            weekly: 2\n            monthly: 3\n            yearly: 1\n            autosnap: \"yes\"\n            autoprune: \"yes\"\n```\n\nAbove I define two different templates and apply them to two different\ndatasets.After running this on a node the sanoid systemd unit will be enabled\nand configured to check every 15 minutes for new snapshots to take or prune\nsnapshots (based on the applied template).\n\nYou can dive deeper but this is 99% of what most need to take proper care of\nour ZFS snapshots.\n\nLicense\n-------\n\nGPLv3\n\nAuthor Information\n------------------\n\nFind me on GitHub @ https://github.com/gikeymarcia\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgikeymarcia%2Fansible-role-sanoid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgikeymarcia%2Fansible-role-sanoid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgikeymarcia%2Fansible-role-sanoid/lists"}