From 445eb7a7b20a6a727398b32c716ef0787ba73d74 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 9 Aug 2019 14:07:10 +1000 Subject: [PATCH] backup: minor fixes The ssh config file is /.ssh/config (not ssh_config) We are accepting the ed25519 key, not the ecdsa key, so fix that in the known_hosts stanza. Change-Id: If3a42a7872f5d5e7a2bf9c3b5184fb14d43e6a1a --- playbooks/roles/backup/tasks/main.yaml | 4 ++-- testinfra/test_backups.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/backup/tasks/main.yaml b/playbooks/roles/backup/tasks/main.yaml index 91f4dca1d0..2c3bee1c2a 100644 --- a/playbooks/roles/backup/tasks/main.yaml +++ b/playbooks/roles/backup/tasks/main.yaml @@ -24,7 +24,7 @@ - name: Configure ssh for backup server blockinfile: - path: /root/.ssh/ssh_config + path: /root/.ssh/config create: true block: | Host {{ item }} @@ -41,7 +41,7 @@ - name: Accept hostkey of backup server known_hosts: state: present - key: '{{ item }} ecdsa-sha2-nistp256 {{ hostvars[item]["ansible_ssh_host_key_ed25519_public"] }}' + key: '{{ item }} ssh-ed25519 {{ hostvars[item]["ansible_ssh_host_key_ed25519_public"] }}' name: '{{ item }}' with_inventory_hostnames: backup-server diff --git a/testinfra/test_backups.py b/testinfra/test_backups.py index d5b83d24f8..ed0daebab7 100644 --- a/testinfra/test_backups.py +++ b/testinfra/test_backups.py @@ -53,7 +53,7 @@ def test_backup_host_config(host): f = host.file('/root/.ssh/id_backup_ed25519') assert f.exists - f = host.file('/root/.ssh/ssh_config') + f = host.file('/root/.ssh/config') assert f.exists assert f.contains('Host backup01.region.provider.opendev.org')