From 3e8cb619b8aeb7d7d858081ac6681cb65034e2bb Mon Sep 17 00:00:00 2001 From: Till Maas Date: Fri, 6 Jul 2018 21:15:40 +0200 Subject: [PATCH] Work around slow package manager --- tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index d44a65d..6204c80 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,10 +7,19 @@ - "{{ ansible_os_family }}.yml" - "default.yml" +# needed for ansible_facst.packages +- name: Check which packages are installed + package_facts: + +# Depending on the plugins, checking installed packages might be slow +# for example subscription manager might slow this down +# Therefore install packages only when rpm does not find them - name: Install packages package: name: "{{ network_packages }}" state: present + when: + - not network_packages is subset(ansible_facts.packages.keys()) - name: Enable network service service: