diff options
| author | Colin Wilk <colin.wilk@tum.de> | 2023-05-22 20:17:27 +0200 |
|---|---|---|
| committer | Colin Wilk <colin.wilk@tum.de> | 2023-05-24 19:40:29 +0200 |
| commit | 1f1f6eeaebc148602085515350eb12829f86c315 (patch) | |
| tree | 46dd4aa80ab9125a3254e2b1a26847f41a9e79d6 /molecule/default/converge.yml | |
| download | ansible-role-borgbackup-1f1f6eeaebc148602085515350eb12829f86c315.tar.gz ansible-role-borgbackup-1f1f6eeaebc148602085515350eb12829f86c315.zip | |
init
Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to 'molecule/default/converge.yml')
| -rw-r--r-- | molecule/default/converge.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..9c23b5f --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,43 @@ +--- +- name: Converge + hosts: borg-client + + pre_tasks: + # This would usually be set by the user globally on their ansible + # repository and can be a security risk to do automatically. We will + # however set the variable here in the pre_tasks since it is for testing. + - name: Set borg server openssh key variable + become: true + block: + - name: Fetch ssh_key + ansible.builtin.command: > + ssh-keyscan -t rsa + {{ borg_server_host }} + | sed "s/^[^ ]* //" + register: borg_server_ssh_keyscan + changed_when: false + + - name: Set ssh_key + ansible.builtin.set_fact: + borg_server_host_ssh_key: "{{ borg_server_ssh_keyscan.stdout + | split(' ') + | reject('search', borg_server_host) + | join(' ') }}" + + vars: + borg_server_host: borg-server + borg_server_user_home: /opt/borg + borg_decryption_keys_yaml_path: "{{ playbook_dir }}/decryption_keys.yml" + borg_included_dirs: + - /etc + - /home + borg_excluded_dirs: + - /opt + - /var + - /reee reeee + borg_cron_time: + minute: "*" + hour: "*" + + roles: + - role: kliwniloc.borgbackup |