From b11817a1dd6af00d92d95de9ab577be9a4558320 Mon Sep 17 00:00:00 2001 From: Rene Mewissen Date: Wed, 23 Nov 2022 09:52:13 +0100 Subject: [PATCH] changed name and added optional ip var --- host_vars/backup.universe.local.yml | 6 +++--- roles/backup/files/config/backup_remote.conf | 2 +- roles/backup/templates/ssh_config.j2 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/host_vars/backup.universe.local.yml b/host_vars/backup.universe.local.yml index 4f35878..6232b95 100644 --- a/host_vars/backup.universe.local.yml +++ b/host_vars/backup.universe.local.yml @@ -1,7 +1,7 @@ hosts_to_backup: - - { hostname: "mail", fqdn: "mail.universe.local" } - - { hostname: "jitsi", fqdn: "mewimeet.de" } - - { hostname: "mewitoot", fqdn: "mewitoot.de" } + - { hostname: "mailcow", fqdn: "mewissen.site", ip: "192.168.3.8" } + - { hostname: "jitsi", fqdn: "mewimeet.de", ip: "192.168.3.10" } + - { hostname: "mewitoot", fqdn: "mewitoot.de", ip: "192.168.3.11" } - { hostname: "coruscant", fqdn: "coruscant.universe.local" } - { hostname: "ns1", fqdn: "ns1.universe.local" } - { hostname: "docker01", fqdn: "docker01.universe.local" } diff --git a/roles/backup/files/config/backup_remote.conf b/roles/backup/files/config/backup_remote.conf index 9553300..cf85553 100644 --- a/roles/backup/files/config/backup_remote.conf +++ b/roles/backup/files/config/backup_remote.conf @@ -1,4 +1,4 @@ -mail;/opt/backup/config/mail_includes.txt;/opt/backup/config/mail_excludes.txt +mailcow;/opt/backup/config/mailcow_includes.txt;/opt/backup/config/mailcow_excludes.txt jitsi;/opt/backup/config/jitsi_includes.txt;/opt/backup/config/jitsi_excludes.txt mewitoot;/opt/backup/config/mewitoot_includes.txt;/opt/backup/config/mewitoot_excludes.txt coruscant;/opt/backup/config/coruscant_includes.txt;/opt/backup/config/coruscant_excludes.txt diff --git a/roles/backup/templates/ssh_config.j2 b/roles/backup/templates/ssh_config.j2 index 9ac9b2f..a8a29a8 100644 --- a/roles/backup/templates/ssh_config.j2 +++ b/roles/backup/templates/ssh_config.j2 @@ -1,6 +1,6 @@ {% for host in hostvars[inventory_hostname]['hosts_to_backup'] %} Host {{ host.hostname }}_backup - Hostname {{ host.fqdn }} + Hostname {{ host.ip | default(host.fqdn) }} User root IdentityFile ~/.ssh/backup_ed25519 IdentitiesOnly yes