From c5317f1bca416565b96e98fe15a15dfab38a7e4a Mon Sep 17 00:00:00 2001 From: neingeist Date: Mon, 9 Jan 2017 22:34:59 +0100 Subject: [PATCH] Use apt_repository module instead of handling apt-get update ourself The apt_repository module already handles apt-get updating after install of a repo, so use that instead of handling it ourself. Also, ansible-lint didn't like our approach. The change also requires Ansible >= 2.1 due to the filename option to apt_repository. --- files/jessie-backports.list | 2 -- tasks/main.yml | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 files/jessie-backports.list diff --git a/files/jessie-backports.list b/files/jessie-backports.list deleted file mode 100644 index f12e73c..0000000 --- a/files/jessie-backports.list +++ /dev/null @@ -1,2 +0,0 @@ -deb http://ftp.de.debian.org/debian jessie-backports main -deb-src http://ftp.de.debian.org/debian jessie-backports main diff --git a/tasks/main.yml b/tasks/main.yml index 51aae06..a4c69f9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,9 @@ - name: install jessie-backports apt list - copy: src=jessie-backports.list dest=/etc/apt/sources.list.d/ - register: jessie_backports_list + apt_repository: + filename: jessie-backports + repo: "deb http://ftp.de.debian.org/debian jessie-backports main" -- name: apt-get update - apt: update_cache=yes - when: jessie_backports_list|changed +- name: install jessie-backports sources apt list + apt_repository: + filename: jessie-backports + repo: "deb-src http://ftp.de.debian.org/debian jessie-backports main"