1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

change how to ged os specific vars

This commit is contained in:
L3D 2021-03-23 16:16:20 +01:00
parent 1156712b16
commit e297345a34
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 12 additions and 22 deletions

View file

@ -1,27 +1,6 @@
---
# tasks file for skeleton
- name: add OS specific variables
include_vars: '{{ loop_vars }}'
with_first_found:
- files:
- '{{ distribution }}-{{ distribution_version }}.yml'
- '{{ distribution }}-{{ distribution_major_version }}.yml'
- '{{ distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- '{{ ansible_system }}.yml'
- 'defaults.yml'
paths:
- 'vars'
loop_control:
loop_var: loop_vars
vars:
distribution: '{{ ansible_distribution }}'
distribution_version: '{{ ansible_distribution_version }}'
distribution_major_version: '{{ ansible_distribution_major_version }}'
tags:
- configuration
- packages
ansible.builtin.include_vars: "{{ lookup('first_found', restic_os_variables) }}"
- name: Ensure restic directories exist
file:

11
vars/main.yml Normal file
View file

@ -0,0 +1,11 @@
---
restic_os_variables:
files:
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
- '{{ distribution }}.yml'
- '{{ ansible_os_family }}.yml'
- '{{ ansible_system }}.yml'
- 'defaults.yml'
paths:
- 'vars'