From ddd59eae3794a687f3fe3b9abf17c16e940083ed Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 11 Oct 2024 09:35:06 +0200 Subject: [PATCH] Fix SSH keys template --- artifacts/add_ssh_key.yml | 4 ---- templates/ssh_keys.yml | 15 ++++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/artifacts/add_ssh_key.yml b/artifacts/add_ssh_key.yml index 5dfac86..24854e9 100644 --- a/artifacts/add_ssh_key.yml +++ b/artifacts/add_ssh_key.yml @@ -4,10 +4,6 @@ vars: username: "{{ user | default(ansible_user) }}" tasks: - - name: Split the ssh_key into a list - set_fact: - ssh_keys: "{{ ssh_key.replace('\r', '').split('\n') }}" - - name: Add the authorized_key to the nodes authorized_key: user: "{{ username }}" diff --git a/templates/ssh_keys.yml b/templates/ssh_keys.yml index ca12666..e3e8557 100644 --- a/templates/ssh_keys.yml +++ b/templates/ssh_keys.yml @@ -16,17 +16,18 @@ metadata: - simple-node-disk.yml tabs: SSH Data: - - ssh_key: - tag_type: textarea + - ssh_keys topology_template: inputs: - ssh_key: - type: string - description: SSH Key/s to inject to the VM (leave empty line to separate keys) - default: '' + ssh_keys: + type: list + entry_schema: + type: string + description: SSH Keys to inject to the VM + default: [] node_templates: @@ -39,4 +40,4 @@ topology_template: configure: implementation: https://raw.githubusercontent.com/grycap/tosca/main/artifacts/add_ssh_key.yml inputs: - ssh_key: { get_input: ssh_key } + ssh_keys: { get_input: ssh_keys }