add goatcounter

This commit is contained in:
Gabriel Augendre 2024-10-09 21:39:46 +02:00
parent 5971129176
commit dc8e0da2bb
2 changed files with 53 additions and 0 deletions

View file

@ -44,3 +44,43 @@
39613062303438356436613733396164646662333938353433313135356531373139323939653335 39613062303438356436613733396164646662333938353433313135356531373139323939653335
3730663430656439640a613532326434343438656330363964303766363666393962393065663938 3730663430656439640a613532326434343438656330363964303766363666393962393065663938
30643033303263346538353564333535656437336639336461363261623435656131 30643033303263346538353564333535656437336639336461363261623435656131
- name: goatcounter
hosts: servers
tasks:
- name: write goatcounter unit file
become: true
template:
src: templates/goatcounter.service.j2
dest: /etc/systemd/system/goatcounter.service
notify:
- daemon-reload
- restart goatcounter
- name: ensure goatcounter is running
become: true
service:
name: goatcounter
state: started
enabled: true
handlers:
- name: daemon-reload
become: true
systemd:
daemon_reload: true
- name: restart goatcounter
become: true
service:
name: goatcounter
state: restarted
vars:
gc_mailgun_api_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
31386237653033306338393237353961396535363061363931643863653461333631376365663338
3266346337353564656539666235656265356435343834380a616232383839663639616537393233
64303764306639636136346233366666633765393565353062396632636163643031616235303130
3662343162643033380a326161313036643835636562636165356464393236303533303435353365
36336163313338346235396565363631366564393562326536353262363637653432643830663532
30356133383335653330613965623261323531613131663437363430636565393262353565326132
323830313235313462633335333763363161

View file

@ -0,0 +1,13 @@
[Unit]
Description=Goatcounter
After=network.target
[Service]
ExecStart=/mnt/data/goatcounter/goatcounter serve -listen *:8081 -tls http -smtp smtps://goatcounter%%40mg.augendre.info:{{gc_mailgun_api_key}}@smtp.mailgun.org:587 -email-from goatcounter@mg.augendre.info -automigrate -db sqlite+/mnt/data/goatcounter/db/goatcounter.sqlite3
Type=simple
Restart=always
User=gaugendre
Group=gaugendre
[Install]
WantedBy=default.target