ansible/roles/restic/tasks/main.yaml

69 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2019-12-15 06:40:49 +00:00
---
- name: gather os specific variables
2022-08-31 03:19:06 +00:00
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
2019-12-15 06:40:49 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2019-12-15 06:40:49 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- vars
- name: include os specific tasks
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
2019-12-15 06:40:49 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2019-12-15 06:40:49 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- tasks
2024-04-14 22:25:38 +00:00
- ansible.builtin.include_tasks: pre.yaml
2019-12-15 06:40:49 +00:00
2024-04-14 22:25:38 +00:00
- ansible.builtin.include_tasks: install.yaml
2019-12-15 06:40:49 +00:00
- name: create etc tree
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0755
loop:
- "{{ restic_etc_path }}"
- "{{ restic_etc_path }}/repos"
- "{{ restic_etc_path }}/jobs"
2020-04-21 03:28:32 +00:00
- name: create environment helper
template:
src: env.sh.j2
dest: "{{ restic_etc_path }}/env.sh"
owner: root
group: root
mode: 0400
2019-12-19 04:09:05 +00:00
- name: copy restic helper scripts
copy:
src: "{{ item }}"
dest: "{{ restic_bin_path }}/{{ item | basename | splitext | first }}"
2019-12-16 02:51:51 +00:00
owner: root
group: root
mode: 0755
2019-12-19 04:09:05 +00:00
loop:
- restic-repo.sh
- restic-job.sh
2019-12-16 02:51:51 +00:00
2019-12-15 06:40:49 +00:00
- name: manage repos
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: repo.yaml
2019-12-15 06:40:49 +00:00
loop: "{{ restic_repos | default([]) }}"
- name: manage jobs
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: job.yaml
2019-12-15 06:40:49 +00:00
loop: "{{ restic_jobs | default([]) }}"