Initial commit

This commit is contained in:
root
2025-12-08 07:50:32 +00:00
commit 23be1e4059
3664 changed files with 2557 additions and 0 deletions

29
files/.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,29 @@
variables:
ANSIBLE_HOST_KEY_CHECKING: "False"
stages:
- deploy
deploy:
stage: deploy
image: python:3.11-slim
before_script:
- apt-get update && apt-get install -y openssh-client ssh
- pip install Ansible
- ansible-galaxy collection install --force community.docker:3.13.6
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host *\n\tIdentityFile ~/.ssh/id_rsa\n\tIdentitiesOnly yes\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null" > ~/.ssh/config
script:
- echo "🔍 Checking SSH key setup..."
- head -5 ~/.ssh/id_rsa | cat -v
- ls -l ~/.ssh/id_rsa
- file ~/.ssh/id_rsa || echo "file command not available"
- echo "🔐 Testing SSH connection..."
- ssh -i ~/.ssh/id_rsa root@ansible01vt.smartika.azubi-osa.noris.de 'echo ✅ SSH connection successful'
- echo "🚀 Running Ansible Playbook..."
- ansible-playbook -i inventory.yaml playbook.yaml