From 2f10b3f8751b6ed286b79678c7a0ec7d0d54b57c Mon Sep 17 00:00:00 2001 From: tolerryan <105945216+tolerryan@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:19:17 -0500 Subject: [PATCH] added downloading binary --- roles/ind/bookstack-install.yml | 3 +++ roles/lib/setup-restic-cron.yml | 0 roles/lib/setup-restic.yml | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 roles/lib/setup-restic-cron.yml diff --git a/roles/ind/bookstack-install.yml b/roles/ind/bookstack-install.yml index 630585f..b697e11 100644 --- a/roles/ind/bookstack-install.yml +++ b/roles/ind/bookstack-install.yml @@ -50,6 +50,9 @@ - name: Install-docker.yml - setting up docker include: ../lib/install-docker.yml + - name: Install Restic and setup + include: ../lib/setup-restic.yml + - name: Write docker-compose.yml ansible.builtin.copy: content: "{{ docker_compose_definition }}" diff --git a/roles/lib/setup-restic-cron.yml b/roles/lib/setup-restic-cron.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/lib/setup-restic.yml b/roles/lib/setup-restic.yml index 2955f52..c83baec 100644 --- a/roles/lib/setup-restic.yml +++ b/roles/lib/setup-restic.yml @@ -126,3 +126,26 @@ group: users mode: '0644' + - name: Download restic bz2 file + get_url: + url: "https://github.com/restic/restic/releases/download/v0.17.1/restic_0.17.1_linux_amd64.bz2" + dest: "/tmp/restic.bz2" + mode: '0755' + + - name: Extract restic bz2 file + unarchive: + src: "/tmp/restic.bz2" + dest: "/tmp" + remote_src: yes + extra_opts: ["--strip-components=1"] + + - name: Move restic to /usr/bin/ + copy: + src: "/tmp/restic" + dest: "/usr/bin/restic" + remote_src: yes + + - name: Make restic executable + command: chmod +x /usr/bin/restic + args: + creates: /usr/bin/restic \ No newline at end of file