ansible/roles/btrbk/tasks/main.yml

45 lines
993 B
YAML
Raw Normal View History

2022-11-04 14:34:44 +01:00
---
- name: alpine setup
include_tasks: alpine.yml
when: ansible_distribution == "Alpine"
- name: debian/ubuntu setup
include_tasks: debian.yml
when: ansible_distribution in ["Debian", "Ubuntu"]
- name: create btrbk directory config
file:
state: directory
path: /etc/btrbk
- name: download btrbk executable
get_url:
url: '{{ btrbk_url }}'
dest: /usr/local/bin/btrbk
mode: '0755'
2022-11-04 14:34:44 +01:00
- name: copy btrbk config
copy:
src: "host_files/btrbk/{{ ansible_hostname }}/btrbk.conf"
dest: /etc/btrbk/btrbk.conf
2022-11-04 15:24:55 +01:00
2022-11-04 17:07:41 +01:00
- name: copy btrbk ssh key
2022-11-04 15:24:55 +01:00
copy:
src: id_ed25519
2022-11-04 17:07:41 +01:00
dest: /etc/btrbk/id_ed25519
2022-11-04 15:24:55 +01:00
owner: btrbk
mode: '0400'
- name: copy btrbk user ssh public key to authorized_keys
copy:
src: id_ed25519.pub
2022-11-04 17:07:41 +01:00
dest: /etc/ssh/authorized_keys/btrbk
2022-11-04 15:24:55 +01:00
owner: btrbk
mode: '0644'
- name: add btrbk files to lbu
2022-11-04 15:24:55 +01:00
lbu:
include:
- /usr/local/bin/btrbk
2022-11-04 15:24:55 +01:00
when: ansible_distribution == "Alpine" and alpine_mode in ["diskless", "data"]