From d766c3dbbe6f650988f5136bc3f229b2bb80aa3f Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 7 Feb 2017 07:28:35 -0800 Subject: [PATCH] roles/common: Add tasks to install tarsnap Now that Tarsnap has official packages this is one less thing that needs to be manually installed from source after bringing a machine up. See: http://mail.tarsnap.com/tarsnap-announce/msg00037.html --- roles/common/tasks/packages_Debian.yml | 2 ++ roles/common/tasks/packages_Ubuntu.yml | 2 ++ roles/common/tasks/tarsnap.yml | 12 ++++++++++++ roles/common/templates/tarsnap_sources.list.j2 | 1 + 4 files changed, 17 insertions(+) create mode 100644 roles/common/tasks/tarsnap.yml create mode 100644 roles/common/templates/tarsnap_sources.list.j2 diff --git a/roles/common/tasks/packages_Debian.yml b/roles/common/tasks/packages_Debian.yml index f0a072c..35fead6 100644 --- a/roles/common/tasks/packages_Debian.yml +++ b/roles/common/tasks/packages_Debian.yml @@ -23,4 +23,6 @@ - include: cron-apt.yml tags: cron-apt +- include: tarsnap.yml + # vim: set sw=2 ts=2: diff --git a/roles/common/tasks/packages_Ubuntu.yml b/roles/common/tasks/packages_Ubuntu.yml index 43d85e4..bae6afb 100644 --- a/roles/common/tasks/packages_Ubuntu.yml +++ b/roles/common/tasks/packages_Ubuntu.yml @@ -46,4 +46,6 @@ - include: cron-apt.yml tags: cron-apt +- include: tarsnap.yml + # vim: set sw=2 ts=2: diff --git a/roles/common/tasks/tarsnap.yml b/roles/common/tasks/tarsnap.yml new file mode 100644 index 0000000..37a6231 --- /dev/null +++ b/roles/common/tasks/tarsnap.yml @@ -0,0 +1,12 @@ +--- +- name: Add Tarsnap apt mirror + template: src=tarsnap_sources.list.j2 dest=/etc/apt/sources.list.d/tarsnap.list owner=root group=root mode=0644 + when: ansible_architecture != 'armv7l' + +- name: Add GPG key for Tarsnap + apt_key: id=0x40B98B68F04DE775 url=https://pkg.tarsnap.com/tarsnap-deb-packaging-key.asc state=present + +- name: Install tarsnap + apt: pkg=tarsnap + +# vim: set sw=2 ts=2: diff --git a/roles/common/templates/tarsnap_sources.list.j2 b/roles/common/templates/tarsnap_sources.list.j2 new file mode 100644 index 0000000..e257c49 --- /dev/null +++ b/roles/common/templates/tarsnap_sources.list.j2 @@ -0,0 +1 @@ +deb http://pkg.tarsnap.com/deb/{{ ansible_distribution_release }} ./