{"id":16961057,"url":"https://github.com/ricsanfre/ansible-role-backup","last_synced_at":"2025-10-23T19:13:54.874Z","repository":{"id":56130409,"uuid":"440799134","full_name":"ricsanfre/ansible-role-backup","owner":"ricsanfre","description":"Role for automating backup of linux filesystems to different backends using restic","archived":false,"fork":false,"pushed_at":"2024-06-07T15:33:37.000Z","size":61,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T18:10:03.876Z","etag":null,"topics":["ansible","ansible-role","backup","gdrive","rclone","restic","s3"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ricsanfre/backup","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/ricsanfre.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":"2021-12-22T09:13:07.000Z","updated_at":"2024-11-16T07:06:46.000Z","dependencies_parsed_at":"2024-06-07T17:11:43.322Z","dependency_job_id":null,"html_url":"https://github.com/ricsanfre/ansible-role-backup","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricsanfre%2Fansible-role-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricsanfre%2Fansible-role-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricsanfre%2Fansible-role-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricsanfre%2Fansible-role-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricsanfre","download_url":"https://codeload.github.com/ricsanfre/ansible-role-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487694,"owners_count":21112190,"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","gdrive","rclone","restic","s3"],"created_at":"2024-10-13T22:50:52.935Z","updated_at":"2025-10-23T19:13:54.795Z","avatar_url":"https://github.com/ricsanfre.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ansible Role: Automate backup to different backends using restic\n=========\n\nThis role install and configure [restic] (https://restic.net/) in a linux server using as storage backend any of the supported by restic (Local file system, SFTP server, REST Server, S3 object storage server (i.e. Minio), and cloud storage services (Google Cloud Storage, Microsoft Azure Blob, Amazon S3).\n\nAdditional cloud storage backends, such as Google Drive, are supported through [rclone](https://rclone.org/) integration. rclone is also installed and configured by this role.\n\nThe role install restic and rclone, configure the repository in the selected backend, configure the directories to backup and schedule backup tasks.\n\nThe backup procedure is scheduled using a systemd service and timer (instead of cron)\n\n\u003e Important NOTE: This role does not configure the reoisitory backend (Minio/AWS Server user credentials and buckets, Google Drive API access and service accout, etc.). Backend need to be configured before applying this role.\n\nRequirements\n------------\n\nNone\n\nRole Variables\n--------------\n\nAvailable variables are listed below along with default values (see `defaults\\main.yaml`)\n\n- Restic version to be installed and wheter to force the installation in case that a previous installation is found\n\n  ```yml\n  # force restic install even when it is already installed\n  restic_force_install: false\n  # restic version\n  restic_version: 0.12.1\n  ```\n- Restic installation details\n\n  Restic UNIX user/group\n  ```yml\n  restic_group: root\n  restic_user: root\n  ```\n  Restic binary location\n  ```yml\n  restic_path: /usr/local/bin/restic\n  ```\n  Restic installation directories to place backup service configuration (`restic_etc_dir`), and CA TLS certificates (`restic_cert_dir`)\n  ```yml\n  restic_etc_dir: /etc/minio\n  minio_ca_dir: \"{{ restic_etc_dir }}/ssl\"\n  ```\n- Restic repository configuration\n\n  Restic backend repository details (`restic_repository`) and repository passwod used for encryption (`restic_password`). \n  ```yml\n  restic_repository: \"/restic-repo\"\n  restic_password: mysupers1cret0\n  ```\n  Restic backend additional environment variables (`restic_environment`). Needed for connecting to different backends. Check out [restic documentation: preparing new repo](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html) to see which environment variables are needed for each backend.\n\n  `restic_respository` name format depends on the repository type\n  \n  As an example to connect to Minio S3 server, it is needed to configure the following \n  ```yml\n  restic_repository: \"s3:https://10.11.0.1:9091/restic\"\n  restic_environment:\n    - name: AWS_ACCESS_KEY_ID\n      value: \"restic\"\n    - name: AWS_SECRET_ACCESS_KEY\n      value: \"supers1cret0\"\n  ```\n  and access credentials (`restic_aws_access_key_id` and `restic_aws_secret_access_key`)\n\n- Rclone installation and configuration\n\n  In case of selecting a rclone based repository. rclone need to be installed and optionally configured\n\n  Indicate whether rclone should be installed (`rclone_install`) and configure (`rclone_configure`)\n\n  ```yml\n  rclone_install: false\n  rclone_configure: false\n  ```\n  rclone configuration is done by creating automatically a rclone configuration file `$HOME/.config/rclone/rclone.conf` based on the content of `rclone_config_file`\n\n  This automatic configuration is optional, if `rclone_configuration` is set to false, then you need to manual configure rclone remote repository (`rclone config` command).\n\n  For example to configure restic to use Google Drive as backend repository the following configuration can be provided.\n  ```yml\n  restic_repository: \"rclone:gdrive:backup\"\n  rclone_install: true\n  rclone_configure: true\n  rclone_config_file: |\n    [gdrive]\n    type = drive\n    scope = drive\n    service_account_file = \u003cpath_to_service_account_file\u003e\n    team_drive =\n  ```\n  \u003e Google API service account file (json file) should be present in the server or uploaded to it before applying the role. See example playbook below.\n\n- Restic TLS configuration\n\n  In case of connecting to a backend through TLS, such as Minio S3 service, restic need to validate the credentials. CA certificate can be added during the installation so restic can validate the TLs communication.\n  Whether to use CA SSL certificate to validate connection to S3 storage (`restic_use_ca_cert`) or not. Needed when self-signed certificates or custom CA certificates are used in S3 server. CA certificate content must be loaded into variable `restic_ca_cert`.\n  ```yml\n  restic_use_ca_cert: false\n  # custom CA certificate content\n  restic_ca_cert: \"\"\n  ```\n  This can be done using `set_fact` ansible task with a lookup filter. See playbook example below\n  ```yml\n  - name: Load tls key and cert\n    set_fact:\n      restic_ca_cert: \"{{ lookup('file','certificates/CA.pem') }}\"\n  ```\n\n- Pre-backup scripts\n\n  In the scheduled backup, scripts can be executed just before restic backup commands. This is useful to schedule manual task like generating the backup files of database (i.e.: mysqldump command).\n\n  `restic_enable_pre_backup_scripts` enable the execution of those scripts\n  `restic_pre_backup_script` contains the list of scripts (name + content) to be executed\n  \n  This is an example of script to be executed before applying restic backup commands\n  ```yml\n  restic_enable_pre_backup_scripts: false\n  restic_pre_backup_script:\n    - name: myprebackup.sh\n      content: |\n        #!/bin/bash\n        echo \"This is a script executed before making the backup\"\n  ```\n- Directories list to be backed up\n\n  `restic_backup_dirs` is a list of dictionaries. Each item of the list is a directory to  include in the backup\n  Each dictionary item has a `path` and an `exclude` (which defaults to nothing). The `exclude` property is a list of exclude patterns to be passed as `--exclude` argument passed to restic when executing the backup (example: `restic backup /root --exclude .cache --exclude .ignore`).\n\n  ```yml\n  # restic backup directories\n  restic_backups_dirs:\n    - path: '/etc'\n    - path: '/var/log'\n    - path: '/root'\n      exclude:\n        - pattern: '.cache'\n        - pattern: '.ignore' \n  ```\n\n- Restic additional flags\n\n  `restic_flags` additional restic commands flags to be included in the execution of all commands. Playbook automatically add --cacert flag if `restic_use_ca_cert` is set to true.\n  \n  ```yml\n  restic_flags: \"\"\n  ```\n\n- Restic logs\n \n  `restic_logs` restic scripts log file. \n  \n  ```yml\n  restic_log: /var/log/restic.log\n  ```\n### Restic repository cleaning tasks\n\nA specific systemd service will be configured to execute checking and purging activities. This service will be independent from the backup service, since it is only needed to be executed from one server and to avoid mutual locking it need to be scheduled differently.\n\nCleaning systemd service will execute a script containing the following restic commands\n\n- `restic check`\n- `restic forget --keep-within \u003cdata_retention_days\u003e`\n- `restic prune`\n\n`restic_clean_service` indicates whether to install or not the restic cleaning service and `restic_forget_keep_within` retention data polocy (`--keep-within` forget parameter)\n\n```yml\nrestic_clean_service: true\net as post backup task (restic forget --keep-within \u003ckeep_within\u003e)\nrestic_forget_keep_within: 30d\n```\n\n### Sytemd services and timers\n\nTwo systemd services of type `oneshot` will be created that will be triggered periodically with its corresponding systemd timers.\n\nFor executing backup process: `restic-backup.service` and `restic-backup.timer` are created.\nFor executing cleaning process: `restic-clean.service` and `restic-clean.timer` are created\n\nThe timers are configurable as follows:\n\n- `restic_backup_systemd_timer_on_calender` and `restic_clean_systemd_timer_on_calender`: defines the `OnCalendar` directive (`*-*-* 03:00:00`)\n- `restic_backup_systemd_timer_randomized_delay_sec` and `restic_clean_systemd_timer_randomized_delay_sec`: Delay the timer by a random amount of time between 0 and the specified time value. (`0`)\n\nSee the [systemd.timer](https://www.freedesktop.org/software/systemd/man/systemd.timer.html) documentation for more information.\n\nYou can see the logs of the backup/cleaning with `journalctl`.\n\n    journalctl -xefu restic-backup\n    journalctl -xefu restic-clean\n\nLogs are also stored in a file indicated by `restic_log`\n\nThe backup/cleaning process can be also triggered manually running the command\n\n    systemctl start restic-backup\n    systemctl start restic-clean\n\n\nTesting\n--------\n\nAnsible Playbook based on the configuration creates the scripts that are launched by the systemd services. Those scripts are stored in `restic_etc_dir` (/etc/restic)\n\n- `restic-repo-init.sh`: Script for initializing the restic repo. Executed by ansible playbook once\n- `restic-backup.sh`: script executed by `restic-backup` systemd service\n- `restic-clean.sh`: script executed by `restic-clean` systemd service\n- `restic-wrapper.sh`: restic wrapper script used by the rest of the scripts. This script load the repository variables stored in `/etc/restic/restic.conf` and if necessary pass the '--cacert' parameter to all restic commands.\n\nAfter installation the backup process can be tested following this procedure:\n\n1) Trigger manually the backup process\n\n       systemctl start restic-backup\n    \n   Or\n\n       /etc/restic/restic-backup.sh\n\n2) Check logs restic-backup service\n\n       journalctl -u restic-backup\n   Or\n\n       tail -f /var/log/restic.log\n\n    \n   Output should be like:\n\n    ```\n    -- Logs begin at Tue 2021-12-28 10:38:54 UTC, end at Tue 2021-12-28 10:53:57 UTC. --\n    Dec 28 10:50:01 server systemd[1]: Starting Restic backup...\n    Dec 28 10:50:01 server restic-backup.sh[2751]: Dec 28 2021 10:50:01 UTC: restic-backup started\n    Dec 28 10:50:01 server restic-backup.sh[2755]: -------------------------------------------------------------------\n    ------------\n    Dec 28 10:50:02 server restic-backup.sh[2757]: no parent snapshot found, will read all files\n    Dec 28 10:50:02 server restic-backup.sh[2757]: Files:         219 new,     0 changed,     0 unmodified\n    Dec 28 10:50:02 server restic-backup.sh[2757]: Dirs:          105 new,     0 changed,     0 unmodified\n    Dec 28 10:50:02 server restic-backup.sh[2757]: Added to the repo: 730.675 KiB\n    Dec 28 10:50:02 server restic-backup.sh[2757]: processed 219 files, 538.536 KiB in 0:00\n    Dec 28 10:50:02 server restic-backup.sh[2757]: snapshot 8bc0e3ea saved\n    Dec 28 10:50:03 server restic-backup.sh[2769]: no parent snapshot found, will read all files\n    Dec 28 10:50:03 server restic-backup.sh[2769]: Files:          11 new,     0 changed,     0 unmodified\n    Dec 28 10:50:03 server restic-backup.sh[2769]: Dirs:            5 new,     0 changed,     0 unmodified\n    Dec 28 10:50:03 server restic-backup.sh[2769]: Added to the repo: 351.917 KiB\n    Dec 28 10:50:03 server restic-backup.sh[2769]: processed 11 files, 346.573 KiB in 0:00\n    Dec 28 10:50:03 server restic-backup.sh[2769]: snapshot bd7c3e4f saved\n    Dec 28 10:50:03 server restic-backup.sh[2781]: no parent snapshot found, will read all files\n    Dec 28 10:50:03 server restic-backup.sh[2781]: Files:           2 new,     0 changed,     0 unmodified\n    Dec 28 10:50:03 server restic-backup.sh[2781]: Dirs:            3 new,     0 changed,     0 unmodified\n    Dec 28 10:50:03 server restic-backup.sh[2781]: Added to the repo: 4.852 KiB\n    Dec 28 10:50:03 server restic-backup.sh[2781]: processed 2 files, 3.190 KiB in 0:00\n    Dec 28 10:50:03 server restic-backup.sh[2781]: snapshot dc362721 saved\n    Dec 28 10:50:03 server restic-backup.sh[2792]: -------------------------------------------------------------------\n    ------------\n    Dec 28 10:50:03 server restic-backup.sh[2794]: Dec 28 2021 10:50:03 UTC: restic.sh finished\n    Dec 28 10:50:03 server systemd[1]: restic-backup.service: Succeeded.\n    Dec 28 10:50:03 server systemd[1]: Finished Restic backup.\n    \n    ```\n3) Check the restic snapshots\n\n   - List backup snapshots\n\n         /etc/restic/restic_wrapper.sh snapshots\n      \n      Output should be like:\n      \n      ```\n      repository df54412d opened successfully, password is correct\n      ID        Time                 Host        Tags        Paths\n      ---------------------------------------------------------------\n      0047e386  2021-12-22 17:02:02  server                  /etc\n      285d0864  2021-12-22 17:02:03  server                  /var/log\n      7d55b179  2021-12-22 17:02:03  server                  /root\n      ---------------------------------------------------------------\n      3 snapshots\n      ```    \n4) Trigger manually the clean process\n\n       systemctl start restic-clean\n    \n   Or\n\n       /etc/restic/restic-repo-clean.sh\n\n5) Check logs restic-clean service\n\n       journalctl -u restic-clean\n   Or\n\n       tail -f /var/log/restic.log\n   \n   Output is like:\n\n    ```\n    -- Logs begin at Tue 2021-12-28 10:38:54 UTC, end at Tue 2021-12-28 10:53:57 UTC. --\n    Dec 28 10:52:20 server systemd[1]: Starting Restic check and purge...\n    Dec 28 10:52:20 server restic-repo-clean.sh[2807]: Dec 28 2021 10:52:20 UTC: restic-repo-clean started\n    Dec 28 10:52:20 server restic-repo-clean.sh[2811]: ---------------------------------------------------------------\n    ----------------\n    Dec 28 10:52:20 server restic-repo-clean.sh[2813]: using temporary cache in /tmp/restic-check-cache-652678859\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: create exclusive lock for repository\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: load indexes\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: check all packs\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: check snapshots, trees and blobs\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: no errors were found\n    Dec 28 10:52:21 server restic-repo-clean.sh[2813]: [0:00] 100.00%  3 / 3 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: Applying Policy: keep all snapshots within 30d of the newest\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: keep 1 snapshots:\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ID        Time                 Host        Tags        Reasons\n        Paths\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ---------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: dc362721  2021-12-28 10:50:03  server                  within 3\n    0d  /root\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ---------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: 1 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: keep 1 snapshots:\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ID        Time                 Host        Tags        Reasons\n        Paths\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ---------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: 8bc0e3ea  2021-12-28 10:50:01  server                  within 3\n    0d  /etc\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ---------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: 1 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: keep 1 snapshots:\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ID        Time                 Host        Tags        Reasons\n        Paths\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ------------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: bd7c3e4f  2021-12-28 10:50:02  server                  within 3\n    0d  /var/log\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: ---------------------------------------------------------------\n    ------------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2825]: 1 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: loading indexes...\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: loading all snapshots...\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: finding data that is still in use for 3 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: [0:00] 100.00%  3 / 3 snapshots\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: searching used packs...\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: collecting packs for deletion and repacking\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: [0:00] 100.00%  8 / 8 packs processed\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: to repack:            0 blobs / 0 B\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: this removes          0 blobs / 0 B\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: to delete:            0 blobs / 0 B\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: total prune:          0 blobs / 0 B\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: remaining:          301 blobs / 1.071 MiB\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: unused size after prune: 0 B (0.00% of remaining size)\n    Dec 28 10:52:22 server restic-repo-clean.sh[2836]: done\n    Dec 28 10:52:22 server restic-repo-clean.sh[2847]: ---------------------------------------------------------------\n    ----------------\n    Dec 28 10:52:22 server restic-repo-clean.sh[2849]: Dec 28 2021 10:52:22 UTC: restic-repo-clean finished\n    Dec 28 10:52:22 server systemd[1]: restic-clean.service: Succeeded.\n    Dec 28 10:52:22 server systemd[1]: Finished Restic check and purge.\n    ```\n  \n\nDependencies\n------------\n\nNone\n\nExample Playbook\n----------------\n\nThe following playbook install restic, and schedule backup of `/etc`, `/var/log` and `/root` directories.\n\nAs backend uses a S3 repository (`s3:https://10.11.0.1:9091/restic`) and to validate SSL certificates from S3 server installs a CA cert load from `certicates/CA.pem`.\n\n```yml\n- name: Configure backup\n  hosts: server\n  become: true\n  gather_facts: true\n  pre_tasks:\n    - name: Load tls key and cert\n      set_fact:\n        restic_ca_cert: \"{{ lookup('file','certificates/CA.pem') }}\"\n  roles:\n    - role: ricsanfre.backup\n      restic_repository: \"s3:https://10.11.0.1:9091/restic\"\n      restic_aws_access_key_id: restic\n      restic_aws_secret_access_key: supers1cret0\n      restic_use_ca_cert: true\n      restic_backups_dirs:\n        - path: '/etc'\n        - path: '/var/log'\n        - path: '/root'\n          exclude:\n            - pattern: '.cache'\n            - pattern: '.ignore'\n```\n\nThe configure restic to perform the backup of the same directories but using Google Drive as backend. \n\n```yml\n\n- name: Configure backup\n  hosts: instance\n  become: true\n  gather_facts: true\n  vars:\n    - restic_user: \"root\"\n    - restic_group: \"root\"\n    - google_service_account: \"\"\n    - restic_user_home: \"\"\n  pre_tasks:\n    - name: Load service account json file\n      set_fact:\n        google_service_account: \"{{ lookup('file','files/google_service_account.json') | from_json }}\"\n    - name: Get Home directory of restic_user\n      getent:\n        database: passwd\n        key: \"{{ restic_user }}\"\n        split: \":\"\n    - name: Set restic user home directory\n      set_fact:\n        restic_user_home: \"{{ getent_passwd[restic_user][4] }}\"\n    - name: Create gdrive config directory\n      file:\n        path: \"{{ restic_user_home }}/.gdrive\"\n        state: directory\n        owner: \"{{ restic_user }}\"\n        group: \"{{ restic_group }}\"\n        mode: 0750\n    - name: Copy service account json file to rclone config directory\n      copy:\n        dest: \"{{ restic_user_home }}/.gdrive/google_service_account.json\"\n        content: \"{{ google_service_account | to_nice_json }}\"\n        owner: \"{{ restic_user }}\"\n        group: \"{{ restic_user }}\"\n        mode: 0644\n  roles:\n    - role: ricsanfre.backup\n      restic_repository: \"rclone:gdrive:backup\"\n      restic_aws_access_key_id: restic\n      restic_aws_secret_access_key: supers1cret0\n      rclone_install: true\n      rclone_configure: true\n      rclone_config_file: |\n        [gdrive]\n        type = drive\n        scope = drive\n        service_account_file = {{ restic_user_home }}/.gdrive/google_service_account.json\n        team_drive =\n      restic_backups_dirs:\n        - path: '/etc'\n        - path: '/var/log'\n        - path: '/root'\n          exclude:\n            - pattern: '.cache'\n            - pattern: '.ignore\n```\nThis playbook expects to find google's service account in json format in `files/google_service_account.json`\n\nLicense\n-------\n\nMIT\n\nAuthor Information\n------------------\n\nCreated by Ricardo Sanchez (ricsanfre) highly inspired by this [project](https://github.com/angristan/ansible-restic) by [angristan](https://github.com/angristan).\n\nCode completely refactored and updated to work properly with S3 repository (i.e. Minio) and with ARM architecture. Also added rclone's backends support.\n\nChanges and improvements:\n- Restic backup and purge activities are splitted into two different systemd services that can be scheduled independetly to avoid locking issues.\n- S3 backend issues solved: repo initialization and the use of custom CA/selfsigned certificates in the communication.\n- Restic installation installation process is architecture agnostic (supporting x86 and ARM architectures). Original code supported only x86 architectures.\n- Adding support to rclone's backends\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricsanfre%2Fansible-role-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricsanfre%2Fansible-role-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricsanfre%2Fansible-role-backup/lists"}