Compare commits

...

3 Commits

Author SHA1 Message Date
max 43ce6a94c0 Merge pull request 'CHANGE: ensures pulls and updates before running jobs' (#4) from dev into main
Reviewed-on: #4
2026-08-18 21:24:44 +04:00
max e9d38ece4d CHANGE: removes unnecessary steps from the gitea action
Deploy new config to the Ansible server / trigger-webhook (pull_request) Successful in 14s
2026-08-18 21:22:38 +04:00
max 04894aef9f CHANGE: ensures pulls and updates before running jobs 2026-08-18 16:57:27 +04:00
3 changed files with 6 additions and 18 deletions
+1 -7
View File
@@ -16,12 +16,6 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Trigger the webhook to start pulling the latest version from the repo
# LAN IP is used because those hosts are in the same network
run: curl "http://192.168.0.38:9000/hooks/pull-latest"
- name: Trigger the webhook to update python and ansible modules
run: curl "http://192.168.0.38:9000/hooks/run-update-script"
- name: Trigger the webhook to run the playbook
# LAN IP is used because those hosts are in the same network
run: curl "http://192.168.0.38:9000/hooks/run-maintain-playbook"
+5 -5
View File
@@ -1,11 +1,11 @@
#!/bin/bash
LOCK_FILE=/tmp/vmn_ansible_lock_file.lock
# 1 - Pull the latest code
git pull origin main
while [ -f "$LOCK_FILE" ]
do
sleep 1s
done
# 2 - Update dependencies and modules
./scripts/update_modules.sh
# 3 - Run the job
source .venv/bin/activate
ansible-playbook playbooks/maintain.yaml --vault-pass-file ~/vault_password -i inventory/hosts.yaml --private-key ~/.ssh/ansible_key
-6
View File
@@ -1,8 +1,5 @@
#!/bin/bash
# Create a lock file to prevent other scripts from running with old modules
touch /tmp/vmn_ansible_lock_file.lock
source .venv/bin/activate
# Install python packages
@@ -13,6 +10,3 @@ ansible-galaxy collection install -r requirements.yaml -p ./collections/
# Install roles
ansible-galaxy role install -r requirements.yaml -p ./roles/
# Installation is finished, remove the lock
rm /tmp/vmn_ansible_lock_file.lock