{"id":14984406,"url":"https://github.com/kimdre/ansible.hcloud-backup","last_synced_at":"2025-06-18T15:39:57.625Z","repository":{"id":246594788,"uuid":"821034964","full_name":"kimdre/ansible.hcloud-backup","owner":"kimdre","description":"Ansible role for Hetzner Cloud to create backups and snapshot of your servers ","archived":false,"fork":false,"pushed_at":"2024-12-17T07:33:17.000Z","size":48,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T10:26:04.609Z","etag":null,"topics":["ansible","ansible-role","backup","hcloud","hetzner"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/kimdre/hcloud-backup/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kimdre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"kimdre","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"kimdre","thanks_dev":null,"custom":null}},"created_at":"2024-06-27T17:15:57.000Z","updated_at":"2024-12-19T13:00:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8934615-f79d-42a4-b033-946346cf48bf","html_url":"https://github.com/kimdre/ansible.hcloud-backup","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.049180327868852514","last_synced_commit":"34dbacc322122e843cdc80fcf8c072e1d69361ea"},"previous_names":["maki-it/ansible.hcloud-backup"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdre%2Fansible.hcloud-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdre%2Fansible.hcloud-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdre%2Fansible.hcloud-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimdre%2Fansible.hcloud-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimdre","download_url":"https://codeload.github.com/kimdre/ansible.hcloud-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288358,"owners_count":21078903,"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","ansible-role","backup","hcloud","hetzner"],"created_at":"2024-09-24T14:08:59.579Z","updated_at":"2025-04-10T20:11:22.276Z","avatar_url":"https://github.com/kimdre.png","language":null,"funding_links":["https://github.com/sponsors/kimdre","https://buymeacoffee.com/kimdre"],"categories":[],"sub_categories":[],"readme":"[![GitHub Release](https://img.shields.io/github/v/release/kimdre/ansible.hcloud-backup?logo=github\u0026label=Galaxy%20version\u0026link=https%3A%2F%2Fgithub.com%2Fkimdre%2Fansible.hcloud-backup%2Freleases)](https://galaxy.ansible.com/ui/standalone/roles/kimdre/hcloud-backup/)\n\n# Ansible Role: kimdre.hcloud-backup\n\nAnsible role to create and rotate backups and snapshots of servers in Hetzner Cloud.\n\n\u003c!-- TOC --\u003e\n\n* [Requirements](#requirements)\n* [Role Variables](#role-variables)\n    * [api_token](#api_token)\n* [Default Variables](#default-variables)\n* [Example Playbook](#example-playbook)\n* [License](#license)\n* [Author](#author)\n\n\u003c!-- TOC --\u003e\n\n## Requirements\n\n- Ansible 2.15 or later\n\n## Role Variables\n\n### api_token\n\nHetzner Cloud API token.\n\n**Example**\n\n```yaml\napi_token: \"your-hcloud-token\"\n```\n\nCan also be set as an environment variable `HCLOUD_TOKEN`\n\n## Default Variables\n\nSee [hcloud-backup/defaults/main.yml](https://github.com/kimdre/ansible.hcloud-backup/blob/main/defaults/main.yml) for\nall available variables.\n\n### backup_type\n\nType of backup to create.\n\n#### Possible formats:\n\n- `snapshot` is generally cheaper with smaller servers and disk usage and there is no limit on the number of snapshots\n  that can be created.\n- `backup` needs to be enabled first for the server and only 7 backups can be created per server before they get rotated.\n\n#### Default value\n\n```yaml\nbackup_type: snapshot\n```\n\n### backup_description\n\nDescription of the snapshot/backup.\n\n#### Default value\n\n```yaml\nbackup_description: \"{{ inventory_hostname }} {{ now(fmt='%Y-%m-%d %H:%M:%S') }}\"\n```\n\n### backup_labels\n\nList of labels of the snapshot/backup.\n\n#### Possible formats:\n\n- `key: \"value\"`\n- `key: \"\"`  for labels without a value.\n\n#### Default value\n\n```yaml\nbackup_labels:\n    created_by: \"ansible.hcloud-backup\"\n    created_at: \"{{ now(fmt='%Y-%m-%d_%H-%M-%S') }}\"\n    host: \"{{ inventory_hostname }}\"\n    rotation: \"true\"\n```\n\n### label_selector\n\nList of labels to identify snapshots for rotation, should overlap with [`backup_labels`](#backup_labels).\n\nOnly used when [`backup_type`](#backup_type) is set to `snapshot`.\n\n#### Possible formats:\n\n- `key: \"value\"`\n- `key: \"\"`  for labels without a value.\n\n#### Default value\n\n```yaml\nlabel_selector:\n    created_by: ansible.hcloud-backup\n    host: \"{{ inventory_hostname }}\"\n    rotation: \"true\"\n```\n\n### rotate_snapshots\n\nRotate snapshots, if set to `true`, the oldest found snapshot(s) will be deleted\ndepending on the [`keep_snapshots`](#keep_snapshots) variable and the number of existing snapshots.\n\nOnly used when [`backup_type`](#backup_type) is set to `snapshot`.\n\n#### Default value\n\n```yaml\nrotate_snapshots: true\n```\n\n### keep_snapshots\n\nNumber of snapshots to keep, older snapshots will be deleted.\n\nOnly used when [`backup_type`](#backup_type) is set to `snapshot`\nand [`rotate_snapshots`](#rotate_snapshots) is set to `true`.\n\n#### Default value\n\n```yaml\nkeep_snapshots: 5\n```\n\n### backup_check_retries\n\nNumber of retries for the backup creation check.\n\n#### Default value\n\n```yaml\nbackup_check_retries: 40\n```\n\n### backup_check_delay\n\nDelay in seconds between retries for the backup creation check.\n\n#### Default value\n\n```yaml\nbackup_check_delay: 15\n```\n\n### delegation\n\nHost to run the role tasks from\n\n#### Default value\n\n```yaml\ndelegation: \"{{ inventory_hostname }}\"\n```\n\n## Example Playbook\n\n```yaml\n- name: \"Create snapshot of host\"\n  hosts: '{{ target | default(\"all\") }}'\n  roles:\n    - role: kimdre.hcloud-backup\n      vars:\n        api_token: \"your-hcloud-api-token\"\n        backup_type: \"snapshot\"\n        keep_snapshots: 7\n```\n\n## License\n\nApache-2.0\n\n## Author\n\n- [Kim Oliver Drechsel](https://github.com/kimdre)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimdre%2Fansible.hcloud-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimdre%2Fansible.hcloud-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimdre%2Fansible.hcloud-backup/lists"}