add ssh key settings

This commit is contained in:
2026-06-17 15:38:49 +02:00
parent 12a4191489
commit 9ae23528f5
+25 -12
View File
@@ -3,23 +3,36 @@ default:
tags:
- docker
stages:
- validate
# - validate
- deploy
before_script:
- export ANSIBLE_CONFIG=$CI_PROJECT_DIR/ansible.cfg
# before_script:
# - export ANSIBLE_CONFIG=$CI_PROJECT_DIR/ansible.cfg
ansible-lint:
stage: validate
script:
- ansible-lint
# ansible-lint:
# stage: validate
# script:
# - ansible-lint
syntax-check:
stage: validate
script:
- ansible-playbook --syntax-check playbooks/openvpn.yml
# syntax-check:
# stage: validate
# script:
# - ansible-playbook --syntax-check playbooks/openvpn.yml
deploy-prod:
stage: deploy
when: manual
# when: manual
before_script:
- echo "Setting up ssh ..."
- mkdir -p ~/.ssh
- cat "$SSH_PRIVATE_KEY_FILE" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- cat "$SSH_PUBLIC_KEY_FILE" > ~/.ssh/id_ed25519.pub
- chmod 600 ~/.ssh/id_ed25519.pub
- wc -c ~/.ssh/id_ed25519
- md5sum ~/.ssh/id_ed25519
- cat -A ~/.ssh/id_ed25519 | head -3
- cat -A ~/.ssh/id_ed25519 | tail -3
- export ANSIBLE_CONFIG=$CI_PROJECT_DIR/ansible.cfg
script:
- ansible-playbook playbooks/openvpn.yml