Files
timmy-config/ansible/roles/webhook_deploy/tasks/main.yml
Rockachopa 06e037bf9a
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 22s
Smoke Test / smoke (pull_request) Failing after 23s
Validate Config / YAML Lint (pull_request) Failing after 18s
Validate Config / JSON Validate (pull_request) Successful in 20s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m7s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Cron Syntax Check (pull_request) Successful in 15s
Validate Config / Shell Script Lint (pull_request) Failing after 1m18s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 14s
Validate Config / Playbook Schema Validation (pull_request) Successful in 32s
Architecture Lint / Lint Repository (pull_request) Failing after 26s
PR Checklist / pr-checklist (pull_request) Failing after 3m30s
feat(ansible): add webhook receiver service and register Gitea webhook
This completes the Gitea webhook requirement for ansible IaC (#442). The webhook (ID 34) was registered via API to fire on PR merge and trigger
ansible-pull to converge the fleet.  Added webhook_deploy role that
provisions a systemd oneshot service to handle the webhook endpoint.
Made deploy_on_webhook.sh executable.

Closes #442
2026-04-30 18:20:44 -04:00

33 lines
976 B
YAML

---
- name: "Create ansible log directory"
file:
path: /var/log/ansible
state: directory
mode: "0755"
- name: "Deploy webhook handler systemd service (oneshot)"
copy:
dest: /etc/systemd/system/webhook-ansible-deploy.service
mode: "0644"
content: |
[Unit]
Description=Timmy Config Ansible Deploy Webhook Handler
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/root/wizards/bezalel/workspace/timmy-config
ExecStart=/usr/bin/ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/site.yml --limit "$(hostname)"
StandardOutput=append:/var/log/ansible/webhook-deploy.log
StandardError=append:/var/log/ansible/webhook-deploy.log
- name: "Reload systemd to pick up new service"
systemd:
daemon_reload: yes
- name: "Ensure webhook service is disabled (webhook-triggered only)"
systemd:
name: webhook-ansible-deploy.service
enabled: false
state: stopped