- name: Install dependencies for Tarsnap apt: pkg=$item state=installed with_items: - libssl-dev - zlib1g-dev - e2fslibs-dev - name: Download the current tarsnap code signing key get_url: url=https://www.tarsnap.com/tarsnap-signing-key.asc dest=/root/tarsnap-signing-key.asc - name: Add the tarsnap code signing key to your list of keys command: gpg --import tarsnap-signing-key.asc chdir=/root/ - name: Download tarsnap SHA file get_url: url="https://www.tarsnap.com/download/tarsnap-sigs-{{ tarsnap_version }}.asc" dest="/root/tarsnap-sigs-{{ tarsnap_version }}.asc" - name: Make the command that gets the current sha template: src=getSha.sh dest=/root/getSha.sh mode=0755 - name: get the SHA256sum for this tarsnap release command: ./getSha.sh chdir=/root register: tarsnap_sha - 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={{ tarsnap_sha.stdout_lines[0] }} - 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 Tarsnap configuration file copy: src=tarsnaprc dest=/root/.tarsnaprc mode="644" - name: Install Tarsnap backup handler script copy: src=tarsnap.sh dest=/root/tarsnap.sh mode="755" - name: Install nightly Tarsnap-generations cronjob cron: name="Tarsnap backup" hour="23" minute="0" job="sh /root/tarsnap.sh >> /var/log/tarsnap.log"