From b4eb8e5e22cfb79943be5470d2f7799c07f3ff8c Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 6 Jul 2025 13:34:05 +0200 Subject: [PATCH] [PR #10337/5ef1cad6 backport][stable-10] Using add_keys_to_agent in ssh_config module (#10351) Using add_keys_to_agent in ssh_config module (#10337) * Using add_keys_to_agent in ssh_config module * removed white space * Apply suggestion --------- (cherry picked from commit 5ef1cad64fdf9b5a14ddc29b89ba35abc0b01d38) Co-authored-by: Aditya Putta Co-authored-by: Abhijeet Kasurde --- plugins/modules/ssh_config.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/modules/ssh_config.py b/plugins/modules/ssh_config.py index 07637e8003..b4d6ed16bf 100644 --- a/plugins/modules/ssh_config.py +++ b/plugins/modules/ssh_config.py @@ -162,6 +162,15 @@ EXAMPLES = r""" other_options: serveraliveinterval: '30' +- name: Add SSH config with key auto-added to agent + community.general.ssh_config: + user: devops + host: "example.com" + hostname: "staging.example.com" + identity_file: "/home/devops/.ssh/id_rsa" + add_keys_to_agent: true + state: present + - name: Delete a host from the configuration community.general.ssh_config: ssh_config_file: "{{ ssh_config_test }}"