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:
parent
1156712b16
commit
e297345a34
2 changed files with 12 additions and 22 deletions
|
@ -1,27 +1,6 @@
|
||||||
---
|
---
|
||||||
# tasks file for skeleton
|
|
||||||
|
|
||||||
- name: add OS specific variables
|
- name: add OS specific variables
|
||||||
include_vars: '{{ loop_vars }}'
|
ansible.builtin.include_vars: "{{ lookup('first_found', restic_os_variables) }}"
|
||||||
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
|
|
||||||
|
|
||||||
- name: Ensure restic directories exist
|
- name: Ensure restic directories exist
|
||||||
file:
|
file:
|
||||||
|
|
11
vars/main.yml
Normal file
11
vars/main.yml
Normal 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'
|
Loading…
Reference in a new issue