add new gitea action for ansible deployment
All checks were successful
Ansible Lint / build (push) Successful in 1m10s

This commit is contained in:
Benjamin Hays 2024-10-11 21:46:56 -04:00
parent c9a281d0ee
commit 02acf4afd3
3 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,46 @@
name: Ansible Deploy
on:
workflow_run:
workflows: ["Ansible Lint"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
playbook:
- Ansible/openssh.yml
- Ansible/cloudflare-dns.yml
- Ansible/heartbeat.yml
- Ansible/debian.yml
steps:
- uses: actions/checkout@v4
- name: Install Ansible
run: |
apt update -y
apt install python3-pip -y
python3 -m pip install ansible
#- name: Install Ansible Galaxy requirements
# run: |
# ansible-galaxy install -r requirements.yaml
- name: Run playbook
uses: dawidd6/action-ansible-playbook@v2
with:
# Required, playbook filepath
playbook: ${{ matrix.playbook }}
# Optional, directory where playbooks live
directory: ./Ansible/
# Optional, SSH private key
key: ${{secrets.SSH_PRIVATE_KEY}}
vault_password: ${{secrets.VAULT_PASSWORD}}
# Optional, galaxy requirements filepath
# requirements: requirements.yaml
options: |
--inventory Ansible/inventory.ini

7
Ansible/ansible.cfg Normal file
View File

@ -0,0 +1,7 @@
[defaults]
nocows = 1
host_key_checking = False
inventory = ./inventory.ini
[privilege_escalation]
become_ask_pass = True

7
ansible.cfg Normal file
View File

@ -0,0 +1,7 @@
[defaults]
nocows = 1
host_key_checking = False
inventory = ./Ansible/inventory.ini
[privilege_escalation]
become_ask_pass = True