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.
This commit is contained in:
Alan Orth 2017-11-01 01:21:48 +02:00
parent 73e6d0b7ed
commit e30e4d4b1e
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 5 additions and 1 deletions

View File

@ -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 - name: Configure network time
import_tasks: ntp.yml import_tasks: ntp.yml
tags: ntp tags: ntp

View File

@ -13,6 +13,5 @@
- { role: munin, when: ansible_os_family == 'Debian' } - { role: munin, when: ansible_os_family == 'Debian' }
vars_files: vars_files:
- vars/ipsets.yml - vars/ipsets.yml
- "vars/{{ ansible_os_family }}.yml"
# vim: set sw=2 ts=2: # vim: set sw=2 ts=2: