install.yml 960 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. - name: Install fuse (to mount repositories)
  3. become: yes
  4. apt:
  5. name: fuse
  6. - name: Install bzip2 (to install restic)
  7. become: yes
  8. apt:
  9. name: bzip2
  10. - name: Install pigz (to compress db dumps)
  11. become: yes
  12. apt:
  13. name: pigz
  14. - name: Download restic
  15. become: yes
  16. get_url:
  17. url: 'https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_amd64.bz2'
  18. dest: '/tmp/restic_{{ restic_version }}_linux_amd64.bz2'
  19. - name: Extract restic
  20. become: yes
  21. command: 'bzip2 -d /tmp/restic_{{ restic_version }}_linux_amd64.bz2'
  22. args:
  23. creates: '/tmp/restic_{{ restic_version }}_linux_amd64'
  24. - name: Install restic
  25. become: yes
  26. copy:
  27. remote_src: true
  28. src: '/tmp/restic_{{ restic_version }}_linux_amd64'
  29. dest: "{{ restic_path }}"
  30. mode: 0755
  31. - name: Remove downloaded file
  32. become: yes
  33. file:
  34. path: '/tmp/restic_{{ restic_version }}_linux_amd64'
  35. state: absent