From 173215da340c9233bc0c26a0cbb91b51f9e5f28e Mon Sep 17 00:00:00 2001 From: Oliver Davies <oliver@oliverdavies.uk> Date: Tue, 26 Apr 2022 23:40:27 +0100 Subject: [PATCH] feat(ssh): create ssh configuration file --- roles/ssh/tasks/main.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/ssh/tasks/main.yaml b/roles/ssh/tasks/main.yaml index 1b3ab5f5..44cc7d49 100644 --- a/roles/ssh/tasks/main.yaml +++ b/roles/ssh/tasks/main.yaml @@ -8,3 +8,11 @@ loop_var: ssh_key_item no_log: true with_items: "{{ ssh_key | default({}) | dict2items }}" + +- name: Create SSH configuration file + ansible.builtin.copy: + content: "{{ ssh_config }}" + dest: "{{ ansible_user_dir }}/.ssh/config" + mode: 0400 + no_log: true + when: ssh_config is defined