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

@@ -1,8 +1,3 @@
init-packet:
mkdir -p $(HOME)/.ssh
echo $(PACKET_VM_SSH_PRIVATE_KEY) | base64 -d > $(HOME)/.ssh/id_rsa
chmod 400 $(HOME)/.ssh/id_rsa
create-tf:
./scripts/create-tf.sh
@@ -12,7 +7,7 @@ delete-tf:
$(ANSIBLE_INVENTORY):
mkdir $@
create-packet: init-packet | $(ANSIBLE_INVENTORY)
create-packet: | $(ANSIBLE_INVENTORY)
ansible-playbook cloud_playbooks/create-packet.yml -c local \
-e @"files/${CI_JOB_NAME}.yml"