Load vars from vars_files

This commit is contained in:
Sonny Bakker 2021-05-31 20:34:20 +02:00
parent 0d16af9d83
commit af58cdc396
2 changed files with 1 additions and 9 deletions

View file

@ -1,14 +1,5 @@
- hosts: localhost
pre_tasks:
- name: load OS specific vars
include_vars: '{{ item }}'
with_first_found:
- files:
- '{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml'
- '{{ ansible_distribution|lower }}.yml'
- '{{ ansible_os_family|lower }}.yml'
paths:
- 'vars/'
- name: install packages
become: true
package:
@ -35,3 +26,4 @@
- import_tasks: 'tasks/coc.yml'
vars_files:
- 'vars/main.yml'
- 'vars/{{ ansible_distribution|lower }}-{{ ansible_distribution_release|lower }}.yml'