From 10200e52abd1de2a8a1caec06dad9a384bf3966e Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sat, 6 Jul 2019 21:31:59 +0300 Subject: [PATCH] roles/common: Use a fact for base packages on Debian This is safer and ends up being faster because all packages get in- stalled in one apt transaction. --- roles/common/tasks/packages_Debian.yml | 37 ++++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/roles/common/tasks/packages_Debian.yml b/roles/common/tasks/packages_Debian.yml index 257ebd5..a26119d 100644 --- a/roles/common/tasks/packages_Debian.yml +++ b/roles/common/tasks/packages_Debian.yml @@ -4,24 +4,27 @@ - name: Configure apt mirror template: src=sources.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644 + - name: Set fact for base packages + set_fact: + base_packages: + - git + - tmux + - iotop + - htop + - strace + - cron-apt #how does this work with systemd? + - safe-rm + - debian-goodies + - mosh + - python3-pycurl # for ansible's apt_repository + - lzop + - vim + - lrzip + - unzip + - apt-transport-https # for https support in apt + - name: Install base packages - apt: name={{ item }} update_cache=yes - loop: - - git - - tmux - - iotop - - htop - - strace - - cron-apt #how does this work with systemd? - - safe-rm - - debian-goodies - - mosh - - python-pycurl # for ansible's apt_repository - - lzop - - vim - - lrzip - - unzip - - apt-transport-https # for https support in apt + apt: name={{ base_packages }} update_cache=yes - name: Configure cron-apt import_tasks: cron-apt.yml