pipeline housekeeping
All checks were successful
Run Ansible / install_ansible (push) Successful in 2m10s

rename playbook
This commit is contained in:
master of disaster
2025-12-11 00:43:19 +01:00
parent 8e7d3f27ce
commit c71ea0e776
2 changed files with 10 additions and 31 deletions

View File

@@ -5,7 +5,6 @@ on:
branches: [ "main" ] branches: [ "main" ]
pull_request: pull_request:
branches: [ "main" ] branches: [ "main" ]
# Ermöglicht manuellen Start des Workflows über die GitHub UI
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -13,23 +12,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: Konfiguriere SSH-Schlüssel in den Runner laden
# uses: webfactory/ssh-agent@v0.9.0
# with:
# ssh-private-key: ${{ secrets.SSHKEY }}
# - name: Deaktiviere StrictHostKeyChecking für Gitea Host
# run: |
# # Ersetze DEIN_GITEA_HOST durch den Hostnamen deines Gitea-Servers
# DEIN_GITEA_HOST="gitea.mod.home"
#
# # Erstelle oder editiere die globale SSH-Konfiguration
# mkdir -p ~/.ssh
# echo "Host $DEIN_GITEA_HOST" >> ~/.ssh/config
# echo " StrictHostKeyChecking no" >> ~/.ssh/config
# echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config
#
# # Optional: Gib die Konfiguration aus, um sie zu prüfen
# cat ~/.ssh/config
- name: Setup SSH for submodules - name: Setup SSH for submodules
run: | run: |
echo "Key length: ${#SSH_PRIVATE_KEY}" echo "Key length: ${#SSH_PRIVATE_KEY}"
@@ -45,11 +27,13 @@ jobs:
echo " port 2222" >> ~/.ssh/config echo " port 2222" >> ~/.ssh/config
env: env:
SSH_PRIVATE_KEY: ${{ secrets.SSHKEY_B64 }} SSH_PRIVATE_KEY: ${{ secrets.SSHKEY_B64 }}
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
submodules: recursive submodules: recursive
fetch-depth: 0 fetch-depth: 0
# Python 3 installieren, was für pip und Ansible notwendig ist # Python 3 installieren, was für pip und Ansible notwendig ist
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
@@ -64,29 +48,24 @@ jobs:
# vault file anlegen # vault file anlegen
- name: create vault file - name: create vault file
run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > .vault_pass.txt run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > .vault_pass.txt
- name: Manuelles Submodule Update - name: Manuelles Submodule Update
run: | run: |
git submodule init git submodule init
# Hier wird der SSH-Fehler wahrscheinlich auftreten
git submodule update --recursive --init --force git submodule update --recursive --init --force
# Optional: Version prüfen, um die erfolgreiche Installation zu bestätigen
- name: Verify Ansible Installation
run: ansible --version
- name: Validate Ansible inventory
run: |
SUBMODULE_FOLDER="inventory"
ansible-inventory --graph
- name: list inventory directory
run: ls -R .
- name: Install Ansible roles - name: Install Ansible roles
run: | run: |
ansible-galaxy role install -r requirements.yml --roles-path ./roles ansible-galaxy role install -r requirements.yml --roles-path ./roles
- name: Check Ansible roles exists - name: Check Ansible roles exists
run: | run: |
ansible-galaxy list ansible-galaxy list
- name: Check Ansible Playbook Syntax - name: Check Ansible Playbook Syntax
run: | run: |
ansible-playbook --syntax-check playbooks/install_prometheus.yml.ansible ansible-playbook --syntax-check playbooks/update_debian.yml.ansible
- name: Run Ansible Playbook - name: Run Ansible Playbook
run: | run: |
ansible-playbook -i inventory/raspberries.yaml playbooks/install_prometheus.yml.ansible --vault-password-file .vault_pass.txt ansible-playbook -i inventory/raspberries.yaml playbooks/update_debian.yml.ansible --vault-password-file .vault_pass.txt

View File

@@ -1,5 +1,5 @@
- hosts: - hosts:
- monitoring - dev
become: true become: true
vars: vars:
ansible_python_interpreter: /usr/bin/python3 ansible_python_interpreter: /usr/bin/python3