From e30e4d4b1e3d0221c9bcfaefcbf9524b50c5917b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 1 Nov 2017 01:21:48 +0200 Subject: [PATCH] Import OS-specific vars in tasks instead of play Something seems to have happened as of Ansible 2.4.0.0 where this no longer works. I suspect it is related to the major changes to static and dynamic imports that landed around this same time. We make sure that this tasks always runs by using the special tag of the same name. --- roles/common/tasks/main.yml | 5 +++++ web.yml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index ca182bf..9722793 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,5 +1,10 @@ --- +# ported from top-level play because it stopped working around Ansible 2.4.0.0 +- name: Import OS-specific variables + include_vars: "vars/{{ ansible_os_family }}.yml" + tags: always + - name: Configure network time import_tasks: ntp.yml tags: ntp diff --git a/web.yml b/web.yml index 5f4ab2b..c73ebb6 100644 --- a/web.yml +++ b/web.yml @@ -13,6 +13,5 @@ - { role: munin, when: ansible_os_family == 'Debian' } vars_files: - vars/ipsets.yml - - "vars/{{ ansible_os_family }}.yml" # vim: set sw=2 ts=2: