CI: Generate ssh key pair on the fly

There is litte reason to share an ssh key common to all CI jobs, so
generate one for each on the fly.

Also use plain-text cloud-init config instead of base64 for readability
This commit is contained in:
Max Gautier
2025-03-10 22:05:34 +01:00
parent e4905f1d1d
commit 611f645907
6 changed files with 19 additions and 35 deletions

View File

@@ -56,4 +56,12 @@ spec:
image: quay.io/kubespray/vm-{{ cloud_image }}
- name: cloudinitvolume
cloudInitNoCloud:
userDataBase64: {{ cloud_init[cloud_image] }}
userData: |
#cloud-config
users:
- name: {{ lookup('env', 'ANSIBLE_REMOTE_USER') }}
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: False
ssh_authorized_keys:
- {{ ssh_key.public_key }}