From 92fe57a4da95a9cafdfa66d00c57c07b29917ac1 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 5 Nov 2017 01:51:49 +0200 Subject: [PATCH] Revert "Revert "roles/common: Use static imports for tasks"" This reverts commit 63c5477f852e3054c0423fa2193a183573e1672a. I'm actually still seeing this problem on Ansible 2.4.0.0 with Python 2.7.14. --- roles/common/tasks/main.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index ca182bf..280627f 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -5,11 +5,23 @@ tags: ntp - name: Install common packages - include_tasks: packages_{{ ansible_distribution }}.yml + import_tasks: packages_Debian.yml + when: ansible_distribution == 'Debian' + tags: packages + +- name: Install common packages + import_tasks: packages_Ubuntu.yml + when: ansible_distribution == 'Ubuntu' tags: packages - name: Configure firewall - include_tasks: firewall_{{ ansible_distribution }}.yml + import_tasks: firewall_Debian.yml + when: ansible_distribution == 'Debian' + tags: firewall + +- name: Configure firewall + import_tasks: firewall_Ubuntu.yml + when: ansible_distribution == 'Ubuntu' tags: firewall - name: Configure secure shell daemon