From d0099b4f3ed236d10e95b7045ed20bd19860bdf1 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:35:16 +0200 Subject: [PATCH] Ensure consistent SSH key format with idempotent Ed25519 key regeneration (#932) (#933) * Ensure consistent SSH key format with idempotent Ed25519 key regeneration * Update plugins/modules/openssh_keypair.py * removed extra whitespace --------- (cherry picked from commit b2ab04861e524136c2ab446b7012ad423a6eb861) Co-authored-by: Aditya Putta Co-authored-by: Felix Fontein --- plugins/modules/openssh_keypair.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/modules/openssh_keypair.py b/plugins/modules/openssh_keypair.py index 76f978bd..7f4bd678 100644 --- a/plugins/modules/openssh_keypair.py +++ b/plugins/modules/openssh_keypair.py @@ -164,6 +164,13 @@ EXAMPLES = r""" path: /tmp/id_ssh_rsa force: true +- name: Regenerate SSH keypair only if format or options mismatch + community.crypto.openssh_keypair: + path: /home/devops/.ssh/id_ed25519 + type: ed25519 + regenerate: full_idempotence + private_key_format: ssh + - name: Generate an OpenSSH keypair with a different algorithm (dsa) community.crypto.openssh_keypair: path: /tmp/id_ssh_dsa