{"id":18719616,"url":"https://github.com/boutetnico/ansible-role-backup","last_synced_at":"2026-02-26T07:39:40.562Z","repository":{"id":45067729,"uuid":"214861695","full_name":"boutetnico/ansible-role-backup","owner":"boutetnico","description":"Manage backups with Ansible.","archived":false,"fork":false,"pushed_at":"2025-02-13T12:23:34.000Z","size":70,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T08:47:33.521Z","etag":null,"topics":["ansible","backup","debian","gcloud","mariabackup","mysql","restic","s3-bucket","ubuntu","xtrabackup"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/boutetnico.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}},"created_at":"2019-10-13T17:18:42.000Z","updated_at":"2025-02-13T12:23:37.000Z","dependencies_parsed_at":"2024-11-04T09:24:59.796Z","dependency_job_id":"1471410d-25bd-4f8d-92a8-e4c4dbb26897","html_url":"https://github.com/boutetnico/ansible-role-backup","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boutetnico%2Fansible-role-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boutetnico%2Fansible-role-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boutetnico%2Fansible-role-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boutetnico%2Fansible-role-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boutetnico","download_url":"https://codeload.github.com/boutetnico/ansible-role-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578867,"owners_count":21127713,"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","backup","debian","gcloud","mariabackup","mysql","restic","s3-bucket","ubuntu","xtrabackup"],"created_at":"2024-11-07T13:27:07.315Z","updated_at":"2026-02-26T07:39:35.526Z","avatar_url":"https://github.com/boutetnico.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![tests](https://github.com/boutetnico/ansible-role-backup/workflows/Test%20ansible%20role/badge.svg)](https://github.com/boutetnico/ansible-role-backup/actions?query=workflow%3A%22Test+ansible+role%22)\n[![Ansible Galaxy](https://img.shields.io/badge/galaxy-boutetnico.backup-blue.svg)](https://galaxy.ansible.com/boutetnico/backup)\n\nansible-role-backup\n===================\n\nThis role configures backups.\n\nRequirements\n------------\n\nAnsible 2.10 or newer.\n\nSupported Platforms\n-------------------\n\n- [Debian - 11 (Bullseye)](https://wiki.debian.org/DebianBullseye)\n- [Debian - 12 (Bookworm)](https://wiki.debian.org/DebianBookworm)\n- [Ubuntu - 22.04 (Jammy Jellyfish)](http://releases.ubuntu.com/22.04/)\n- [Ubuntu - 24.04 (Noble Numbat)](http://releases.ubuntu.com/24.04/)\n\nRole Variables\n--------------\n\n| Variable                     | Required | Default                         | Choices | Comments                                     |\n|------------------------------|----------|---------------------------------|---------|----------------------------------------------|\n| backup_user                  | yes      | `backupd`                       | string  | User who runs backup scripts.                |\n| backup_group                 | yes      | `backupd`                       | string  |                                              |\n| backup_extra_groups          | yes      | `[]`                            | list    | Add `backup_user` to additional groups.      |\n| backup_home_dir              | yes      | `/home/{{ backup_user }}`       | string  |                                              |\n| backup_scripts_dir           | yes      | `{{ backup_home_dir }}/scripts` | string  |                                              |\n| backup_temp_dir              | yes      | `{{ backup_home_dir }}/temp`    | string  |                                              |\n| backup_extra_dir             | yes      | `[]`                            | list    | Create additional directories if needed.     |\n| backup_dependencies          | yes      |                                 | list    | See `defaults/main.yml`.                     |\n| backup_env                   | yes      | `{}`                            | dict    |                                              |\n| backup_archive_enabled       | yes      | `true`                          | bool    | Wether or not to pack files into an archive. |\n| backup_compression_enabled   | yes      | `true`                          | bool    | Wether or not to compress the archive file.  |\n| backup_compressor            | yes      | `gzip`                          | string  |                                              |\n| backup_compression_level     | yes      | `1`                             | int     |                                              |\n| backup_encryption_enabled    | yes      | `false`                         | bool    | Wether or not to encrypt the archive file.   |\n| backup_encryption_key        | yes      | `my_secure_key`                 | string  | Encryption key.                              |\n| backup_encryption_algo       | yes      | `aes-256-cbc`                   | string  | Encryption algorithm.                        |\n| backup_aws_command           | yes      | `aws`                           | string  |                                              |\n| backup_aws_upload_enabled    | yes      | `false`                         | bool    |                                              |\n| backup_aws_bucket_name       | yes      | `mybucket`                      | string  |                                              |\n| backup_aws_region            | yes      | `us-east-1`                     | string  |                                              |\n| backup_gcloud_command        | yes      | `gsutil`                        | string  |                                              |\n| backup_gcloud_upload_enabled | yes      | `false`                         | bool    |                                              |\n| backup_gcloud_bucket_name    | yes      | `mybucket`                      | string  |                                              |\n| backup_b2_command            | yes      | `b2`                            | string  |                                              |\n| backup_b2_upload_enabled     | yes      | `false`                         | bool    | Enable Backblaze B2 upload.                  |\n| backup_b2_bucket_name        | yes      | `mybucket`                      | string  | Backblaze B2 bucket name.                    |\n| backup_restic_command        | yes      | `restic`                        | string  |                                              |\n| backup_restic_enabled        | yes      | `false`                         | bool    |                                              |\n| backup_restic_forget_options | yes      | `--keep-daily 90 --prune`       | string  | See (all options)[https://restic.readthedocs.io/en/latest/060_forget.html#removing-snapshots-according-to-a-policy]. |\n| backup_restic_check_enabled  | yes      | `false`                         | bool    |                                              |\n| backup_cron_syslog_enabled   | yes      | `true`                          | bool    | Log script output to syslog.                 |\n| backup_cron_syslog_tag       | yes      | `cron_backup_`                  | string  |                                              |\n| backup_services              | yes      | `[]`                            | list    | Scripts to install. See `defaults/main.yml`. |\n\nDependencies\n------------\n\n- `backup_aws_*` options require [`awscli` package](https://github.com/boutetnico/ansible-role-awscli).\n- `backup_gcloud_*` options require `gcloud` package.\n- `backup_restic_*` options require [`restic` package](https://github.com/boutetnico/ansible-role-restic).\n- `backup_b2_*` options require [`b2` package](https://github.com/boutetnico/ansible-role-b2).\n\nExample Playbook\n----------------\n\n    - hosts: all\n      roles:\n        - ansible-role-backup\n          backup_aws_upload_enabled: true\n          backup_aws_bucket_name: backup\n          backup_aws_region: us-east-1\n          backup_services:\n            - name: site-files\n              script: files.sh\n              vars:\n                files_path: /var/www/site/data\n              cron:\n                day: 1\n                hour: 6\n                minute: 0\n            - name: site-mysql\n              script: mysqldump.sh\n              vars:\n                mysql_user: backup\n                mysql_password: backup\n                mysql_endpoint: localhost\n                mysql_databases:\n                  - site\n                mysqldump_options: \"--get-server-public-key\"\n              cron:\n                hour: \"*/6\"\n                minute: 30\n            - name: photos-bucket\n              script: s3_bucket.sh\n              vars:\n                bucket_name: photos\n                s3_sync_path: \"/mnt/photos-s3-mirror\"\n                s3_sync_options: \"--follow-symlinks\"\n              cron:\n                hour: 5\n                minute: 20\n                weekday: 0\n            - name: site-mongodb\n              script: mongodump.sh\n              vars:\n                mongodb_user: backup\n                mongodb_password: backup\n                mongodb_endpoint: localhost\n              cron:\n                hour: 7\n                minute: 45\n            - name: site-mysql-xtrabackup\n              script: xtrabackup.sh\n              vars:\n                mysql_user: backup\n                mysql_password: backup\n                xtrabackup_backup_options: --slave-info\n                xtrabackup_prepare_options: --use-memory=1G\n            - name: logs-bucket\n              script: s3_bucket.sh\n              vars:\n                bucket_name: logs\n                s3_sync_path: \"/mnt/logs-s3-mirror\"\n                restic_enabled: true\n                restic_check_enabled: true\n                archive_enabled: false\n                compression_enabled: false\n              cron:\n                hour: 14\n                minute: 30\n            - name: docker_mariabackup\n              script: docker_mariabackup.sh\n              vars:\n                mysql_container_name: project_mysql_1\n                mysql_network_name: project_backend\n                mysql_host: mysql\n                mysql_user: backup\n                mysql_password: backup\n                mariabackup_docker_image: mariadb:latest\n                mariabackup_options: --no-lock\n              cron:\n                hour: \"*/1\"\n                minute: 27\n            - name: influxdb\n              script: influxdb.sh\n              vars:\n                influxdb_host: localhost:8086\n                influxdb_token: influxdb-root-token-created-at-setup\n              cron:\n                hour: 21\n                minute: 06\n\nTesting\n-------\n\n    molecule test\n\nLicense\n-------\n\nMIT\n\nAuthor Information\n------------------\n\n[@boutetnico](https://github.com/boutetnico)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboutetnico%2Fansible-role-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboutetnico%2Fansible-role-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboutetnico%2Fansible-role-backup/lists"}