Skip to content

Commit e95de95

Browse files
committed
Add webhook to Ansible config
1 parent 00278ec commit e95de95

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

website.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,38 @@
108108
enabled: true
109109
state: started
110110

111+
# Webhook setup
112+
# #############
113+
- name: Install webhook
114+
ansible.builtin.copy:
115+
src: "{{playbook_dir}}/webhook/webhook.py"
116+
dest: /usr/bin/webhook.py
117+
mode: 0755
118+
notify: Restart webhook
119+
120+
- name: Configure webhook system service
121+
ansible.builtin.copy:
122+
src: "{{playbook_dir}}/webhook/webhook.service"
123+
dest: /etc/systemd/system/webhook.service
124+
mode: 0644
125+
notify:
126+
- Reload systemd
127+
- Restart webhook
128+
129+
- name: Configure webhook secrets
130+
ansible.builtin.copy:
131+
content: "SITE_DIR=/usr/share/caddy"
132+
dest: /etc/caddy/webhook.env
133+
mode: 0644
134+
notify:
135+
- Restart webhook
136+
137+
- name: Enable webhook service
138+
ansible.builtin.systemd:
139+
name: webhook.service
140+
enabled: true
141+
state: started
142+
111143
# Handlers restart/reload services at playbook completion
112144
# #######################################################
113145
handlers:
@@ -124,3 +156,8 @@
124156
ansible.builtin.systemd:
125157
name: caddy
126158
state: restarted
159+
160+
- name: Restart webhook
161+
ansible.builtin.systemd:
162+
name: webhook
163+
state: restarted

0 commit comments

Comments
 (0)