Skip to content
Snippets Groups Projects
Commit d487312c authored by jurgenhaas's avatar jurgenhaas
Browse files

Add borg remote host to known hosts automatically

parent 07733819
Branches
Tags
No related merge requests found
......@@ -37,3 +37,11 @@
name: PATH
env: yes
value: /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- name: Add repo server host key to known hosts
known_hosts:
name: '{{ borgbackup.remote_host }}'
key: "{{ borgbackup.remote_host }} {{ borgbackup_public_key }}"
hash_host: no
ignore_errors: yes
when: borgbackup_public_key is defined and borgbackup is defined and borgbackup.remote_host is defined
......@@ -5,6 +5,7 @@
set_fact:
application: 'drupal'
application_id: '{{ drupal.id }}'
application_remote_host: '{{ drupal.borg_host|default(false) }}'
application_remote_repo: '{{ drupal.borg_repo|default(false) }}'
- name: Set facts without jails
set_fact:
......@@ -27,3 +28,11 @@
notify:
- Init Borgs
when: drupal.mountpoints is not defined
- name: Add repo server host key to known hosts
known_hosts:
name: '{{ application_remote_host }}'
key: "{{ application_remote_host }} {{ borgbackup_public_key }}"
hash_host: no
ignore_errors: yes
when: borgbackup_public_key is defined and application_remote_host
......@@ -5,6 +5,7 @@
set_fact:
application: 'nextcloud'
application_id: '{{ nextcloud.id }}'
application_remote_host: '{{ nextcloud.borg_host|default(false) }}'
application_remote_repo: '{{ nextcloud.borg_repo|default(false) }}'
- name: Set facts without jails
set_fact:
......@@ -22,3 +23,11 @@
mode: 0600
notify:
- Init Borgs
- name: Add repo server host key to known hosts
known_hosts:
name: '{{ application_remote_host }}'
key: "{{ application_remote_host }} {{ borgbackup_public_key }}"
hash_host: no
ignore_errors: yes
when: borgbackup_public_key is defined and application_remote_host
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment