add borgmatic role
This commit is contained in:
48
roles/borgmatic/molecule/default/converge.yml
Normal file
48
roles/borgmatic/molecule/default/converge.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
vars:
|
||||
repo_path: "/home/borg/test-repo"
|
||||
|
||||
pre_tasks:
|
||||
- name: "Create a user for borg"
|
||||
ansible.builtin.user:
|
||||
name: borg
|
||||
shell: /bin/bash
|
||||
create_home: true
|
||||
|
||||
- name: "Generate test data file"
|
||||
ansible.builtin.copy:
|
||||
dest: "/tmp/data"
|
||||
content: "This is a test file!"
|
||||
owner: "{{ ansible_user_id }}"
|
||||
group: "{{ ansible_user_id }}"
|
||||
mode: "0644"
|
||||
|
||||
- name: "Ensure the repo path exists"
|
||||
ansible.builtin.file:
|
||||
path: "{{ repo_path }}"
|
||||
state: directory
|
||||
owner: "borg"
|
||||
mode: "0700"
|
||||
|
||||
- name: "Install openssh-server"
|
||||
ansible.builtin.apt:
|
||||
name: openssh-server
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: "Start an SSH openssh-server"
|
||||
ansible.builtin.systemd:
|
||||
name: ssh
|
||||
state: started
|
||||
|
||||
roles:
|
||||
- role: genlab.borgmatic
|
||||
borg_source_directories:
|
||||
- "/tmp/data"
|
||||
borg_repo_path: "ssh://borg@localhost/./test-repo"
|
||||
borg_repo_label: "test-repo"
|
||||
borg_encryption_passphrase: "secret"
|
||||
repo_server_inventory_hostname: ubuntu # in production this should be an Ansible inventory hostname
|
||||
repo_server_user: borg
|
||||
Reference in New Issue
Block a user