enable trigeer start
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
name: 🏃Run Ansible
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
playbook_path:
|
||||
required: true
|
||||
type: string
|
||||
role_repo:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
install_ansible:
|
||||
@@ -30,6 +33,7 @@ jobs:
|
||||
|
||||
- name: 🔎Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
# Python 3 installieren, was für pip und Ansible notwendig ist
|
||||
@@ -62,13 +66,19 @@ jobs:
|
||||
run: |
|
||||
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
|
||||
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
|
||||
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
|
||||
- name: 📨Telegram Benachrichtigung senden
|
||||
uses: chapvic/telegram-notify@master
|
||||
@@ -77,4 +87,4 @@ jobs:
|
||||
token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # Ihr Bot-Token Secret
|
||||
chat: ${{ secrets.TELEGRAM_CHAT_ID }} # Ihre Chat-ID Secret
|
||||
status: ${{ job.status }} # Sendet den Job-Status (success/failure/cancelled)
|
||||
title: "Workflow abgeschlossen"
|
||||
title: "Deploy: ${{ inputs.role_repo }}"
|
||||
|
||||
Reference in New Issue
Block a user