From e8db33947243e2fdeeec5ced6c34e59b1e36cc27 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Mon, 23 Oct 2023 14:38:20 +0200 Subject: [PATCH] Fix SSH config --- os.yml | 4 ++-- roles/os_debian/tasks/local-ssh.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/os.yml b/os.yml index c4ea29d..bc4a6e7 100644 --- a/os.yml +++ b/os.yml @@ -17,7 +17,7 @@ roles: - role: os_debian tags: - - debian + - os_debian - name: Ubuntu hosts: @@ -25,4 +25,4 @@ roles: - role: os_ubuntu tags: - - ubuntu + - os_ubuntu diff --git a/roles/os_debian/tasks/local-ssh.yml b/roles/os_debian/tasks/local-ssh.yml index 5e6343b..ca98518 100644 --- a/roles/os_debian/tasks/local-ssh.yml +++ b/roles/os_debian/tasks/local-ssh.yml @@ -3,10 +3,11 @@ delegate_to: localhost ansible.builtin.stat: path: ~/.ssh/config.d + follow: true register: _stat_ssh_configd - name: Add SSH config on ansible host - when: _stat_ssh_configd.stat.isdir + when: "_stat_ssh_configd.stat.exists and _stat_ssh_configd.stat.isdir" delegate_to: localhost ansible.builtin.copy: dest: ~/.ssh/config.d/{{ inventory_hostname }}.conf