12345678910111213141516171819202122232425262728 |
- - name: Install dependencies for Tarsnap
- apt: pkg=$item state=installed
- with_items:
- - libssl-dev
- - zlib1g-dev
- - e2fslibs-dev
-
- - name: Download Tarsnap source
- get_url: url=https://www.tarsnap.com/download/tarsnap-autoconf-${tarsnap_version}.tgz dest=/root/tarsnap-autoconf-${tarsnap_version}.tgz
- #sha256sum=14c0172afac47f5f7cbc58e6442a27a0755685711f9d1cec4195c4f457053811
-
- - name: Decompress Tarsnap source
- command: tar xzf /root/tarsnap-autoconf-${tarsnap_version}.tgz chdir=/root creates=/root/tarsnap-autoconf-${tarsnap_version}/COPYING
-
- - name: Configure Tarsnap for local build
- command: ./configure chdir=/root/tarsnap-autoconf-${tarsnap_version} creates=/root/tarsnap-autoconf-${tarsnap_version}/Makefile
-
- - name: Build and install Tarsnap
- command: make all install clean chdir=/root/tarsnap-autoconf-${tarsnap_version} creates=/usr/local/bin/tarsnap
-
- - name: Copy Tarsnap key file into place
- copy: src=root_tarsnap.key dest=/root/tarsnap.key owner=root group=root
-
- - name: Create Tarsnap cache directory
- file: state=directory path=/usr/tarsnap-cache
-
- - name: Install nightly Tarsnap cronjob
- cron: name="Tarsnap backup" hour="3" minute="0" job="/usr/local/bin/tarsnap --cachedir /usr/tarsnap-cache --keyfile /root/tarsnap.key -c -f backup-`date +\%Y\%m\%d` /home /root /decrypted /var/www /var/log /var/lib/mysql > /dev/null"
|