From 736ae0b4d76b2b28dcced62ec05e7a429cf42ad5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Fri, 2 Mar 2018 17:02:23 +0000 Subject: [PATCH] Do not imply python-apt is installed If an apt task is used with check mode and python-apt isn't installed, the task will fail. Technically the package python-apt is installed during module execution when not running check-mode, so it makes sense to add it before running check mode to avoid implicit dependencies. --- tasks/keepalived_install.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tasks/keepalived_install.yml b/tasks/keepalived_install.yml index d9aaae2..fc8d2b2 100644 --- a/tasks/keepalived_install.yml +++ b/tasks/keepalived_install.yml @@ -45,6 +45,15 @@ tags: - keepalived-repo +- name: Ensure python apt is installed + apt: + name: python-apt + state: present + when: + - ansible_pkg_mgr == 'apt' + tags: + - keepalived-apt-packages + - name: Check if keepalived is already installed package: name: "{{ keepalived_package_name }}"