Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. - name: Install dependencies for Tarsnap
  2. apt: pkg={{ item }} state=installed
  3. with_items:
  4. - libssl-dev
  5. - zlib1g-dev
  6. - e2fslibs-dev
  7. - name: Download the current tarsnap code signing key
  8. get_url:
  9. url=https://www.tarsnap.com/tarsnap-signing-key.asc
  10. dest=/root/tarsnap-signing-key.asc
  11. - name: Add the tarsnap code signing key to your list of keys
  12. command:
  13. gpg --import tarsnap-signing-key.asc
  14. chdir=/root/
  15. - name: Download tarsnap SHA file
  16. get_url:
  17. url="https://www.tarsnap.com/download/tarsnap-sigs-{{ tarsnap_version }}.asc"
  18. dest="/root/tarsnap-sigs-{{ tarsnap_version }}.asc"
  19. - name: Make the command that gets the current sha
  20. template:
  21. src=getSha.sh
  22. dest=/root/getSha.sh
  23. mode=0755
  24. - name: get the SHA256sum for this tarsnap release
  25. command:
  26. ./getSha.sh
  27. chdir=/root
  28. register: tarsnap_sha
  29. - name: Download Tarsnap source
  30. get_url:
  31. url="https://www.tarsnap.com/download/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
  32. dest="/root/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
  33. sha256sum={{ tarsnap_sha.stdout_lines[0] }}
  34. - name: Decompress Tarsnap source
  35. command: tar xzf /root/tarsnap-autoconf-{{ tarsnap_version }}.tgz chdir=/root creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/COPYING
  36. - name: Configure Tarsnap for local build
  37. command: ./configure chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/Makefile
  38. - name: Build and install Tarsnap
  39. command: make all install clean chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/usr/local/bin/tarsnap
  40. - name: Copy Tarsnap key file into place
  41. copy: src=root_tarsnap.key dest=/root/tarsnap.key owner=root group=root
  42. - name: Create Tarsnap cache directory
  43. file: state=directory path=/usr/tarsnap-cache
  44. - name: Install Tarsnap configuration file
  45. copy: src=tarsnaprc dest=/root/.tarsnaprc mode="644"
  46. - name: Install Tarsnap backup handler script
  47. copy: src=tarsnap.sh dest=/root/tarsnap.sh mode="755"
  48. - name: Install nightly Tarsnap-generations cronjob
  49. cron: name="Tarsnap backup" hour="23" minute="0" job="sh /root/tarsnap.sh >> /var/log/tarsnap.log"