2021-11-30 13:44:54 +01:00
|
|
|
---
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: include user tasks
|
|
|
|
include_tasks: user.yml
|
|
|
|
|
|
|
|
- name: install packages from repo
|
2021-11-30 13:44:54 +01:00
|
|
|
become: true
|
2022-04-03 11:04:27 +02:00
|
|
|
ansible.builtin.apt:
|
2021-11-30 13:44:54 +01:00
|
|
|
name:
|
2023-07-05 11:47:57 +02:00
|
|
|
- mbuffer
|
|
|
|
- lzop
|
2023-07-17 22:24:44 +02:00
|
|
|
- libcapture-tiny-perl
|
|
|
|
- pv
|
2021-11-30 13:44:54 +01:00
|
|
|
state: present
|
|
|
|
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: install packages from self-build
|
2021-11-30 13:44:54 +01:00
|
|
|
become: true
|
2023-07-05 11:47:57 +02:00
|
|
|
ansible.builtin.apt:
|
|
|
|
deb: "{{ sanoid_deb_url }}"
|
|
|
|
state: present
|
2021-11-30 13:44:54 +01:00
|
|
|
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: create sanoid directories
|
2021-11-30 13:44:54 +01:00
|
|
|
become: true
|
2023-07-05 11:47:57 +02:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ sanoid_user }}"
|
|
|
|
group: "{{ sanoid_user_group }}"
|
|
|
|
mode: 0700
|
|
|
|
with_items:
|
|
|
|
- "/etc/sanoid"
|
|
|
|
- "/etc/sanoid/.ssh"
|
2021-11-30 13:44:54 +01:00
|
|
|
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: include snaps tasks
|
|
|
|
include_tasks: snaps.yml
|
|
|
|
when:
|
|
|
|
- sanoid_datasets is defined
|
|
|
|
- sanoid_templates is defined
|
|
|
|
- sanoid_snaps_enable is defined
|
|
|
|
- sanoid_snaps_enable
|
2021-11-30 13:44:54 +01:00
|
|
|
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: include source-host tasks
|
|
|
|
include_tasks: source.yml
|
|
|
|
when:
|
|
|
|
- sanoid_syncoid_source_host is defined and sanoid_syncoid_source_host is true
|
|
|
|
- sanoid_syncoid_ssh_pubkey is defined
|
2021-11-30 13:44:54 +01:00
|
|
|
|
2023-07-05 11:47:57 +02:00
|
|
|
- name: include destination-host tasks
|
|
|
|
include_tasks: destination.yml
|
|
|
|
when:
|
|
|
|
- sanoid_syncoid_destination_host is defined and sanoid_syncoid_destination_host is true
|
|
|
|
- sanoid_syncoid_ssh_privkey is defined
|