enable trigeer start

This commit is contained in:
master of disaster
2025-12-30 23:06:05 +01:00
parent ff11384072
commit 43b1d1494e

View File

@@ -1,11 +1,14 @@
name: 🏃Run Ansible name: 🏃Run Ansible
on: on:
push: workflow_call:
branches: ["main"] inputs:
pull_request: playbook_path:
branches: ["main"] required: true
workflow_dispatch: type: string
role_repo:
required: true
type: string
jobs: jobs:
install_ansible: install_ansible:
@@ -30,6 +33,7 @@ jobs:
- name: 🔎Checkout Repository - name: 🔎Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
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
@@ -62,13 +66,19 @@ jobs:
run: | run: |
ansible-galaxy list ansible-galaxy list
- name: 🔎 Checkout Triggering Role Repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.role_repo }}
path: active_role
- name: 🔎Check Ansible Playbook Syntax - name: 🔎Check Ansible Playbook Syntax
run: | run: |
ansible-playbook --syntax-check playbooks/deploy_valkey.yml.ansible ansible-playbook --syntax-check active_role/${{ inputs.playbook_path }}
- name: 🏃Run Ansible deploy_valkey.yml.ansible - name: 🏃Run Ansible deploy_valkey.yml.ansible
run: | run: |
ansible-playbook -i inventory/raspberries.yaml playbooks/deploy_valkey.yml.ansible --vault-password-file .vault_pass.txt -v ansible-playbook -i inventory/raspberries.yaml active_role/${{ inputs.playbook_path }} --vault-password-file .vault_pass.txt -v
# Beispiel für den Benachrichtigungsschritt # Beispiel für den Benachrichtigungsschritt
- name: 📨Telegram Benachrichtigung senden - name: 📨Telegram Benachrichtigung senden
uses: chapvic/telegram-notify@master uses: chapvic/telegram-notify@master
@@ -77,4 +87,4 @@ jobs:
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # Ihr Bot-Token Secret token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # Ihr Bot-Token Secret
chat: ${{ secrets.TELEGRAM_CHAT_ID }} # Ihre Chat-ID Secret chat: ${{ secrets.TELEGRAM_CHAT_ID }} # Ihre Chat-ID Secret
status: ${{ job.status }} # Sendet den Job-Status (success/failure/cancelled) status: ${{ job.status }} # Sendet den Job-Status (success/failure/cancelled)
title: "Workflow abgeschlossen" title: "Deploy: ${{ inputs.role_repo }}"