feat: add dockcheck cron job for container update notifications
- Install dockcheck.sh script in user's .local/bin directory - Create notification templates directory with notify_v2.sh and notify_gotify.sh - Configure Gotify notifications for container update alerts - Add minimal config with DontUpdate=true (notification only) - Exclude authentik-postgresql-1 and dawarich_redis from checks - Schedule daily cron job at 8:00 AM as phil user - Add dockcheck Gotify token to vault secrets 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -16,3 +16,75 @@
|
|||||||
hour: "9"
|
hour: "9"
|
||||||
user: root
|
user: root
|
||||||
job: "/usr/local/bin/update_warhammer_feed.sh"
|
job: "/usr/local/bin/update_warhammer_feed.sh"
|
||||||
|
|
||||||
|
# Create .local/bin directory for phil user
|
||||||
|
- name: Ensure .local/bin directory exists for phil
|
||||||
|
file:
|
||||||
|
path: /home/phil/.local/bin
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Install dockcheck script in phil's .local/bin
|
||||||
|
- name: Download dockcheck.sh script
|
||||||
|
get_url:
|
||||||
|
url: https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh
|
||||||
|
dest: /home/phil/.local/bin/dockcheck.sh
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Create .config directory for phil user
|
||||||
|
- name: Ensure .config directory exists for phil
|
||||||
|
file:
|
||||||
|
path: /home/phil/.config
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Create notify_templates directory alongside dockcheck.sh
|
||||||
|
- name: Ensure notify_templates directory exists in .local/bin
|
||||||
|
file:
|
||||||
|
path: /home/phil/.local/bin/notify_templates
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Download notify_v2.sh script for dockcheck notifications
|
||||||
|
- name: Download notify_v2.sh script
|
||||||
|
get_url:
|
||||||
|
url: https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_v2.sh
|
||||||
|
dest: /home/phil/.local/bin/notify_templates/notify_v2.sh
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Download notify_gotify.sh script for dockcheck notifications
|
||||||
|
- name: Download notify_gotify.sh script
|
||||||
|
get_url:
|
||||||
|
url: https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_gotify.sh
|
||||||
|
dest: /home/phil/.local/bin/notify_templates/notify_gotify.sh
|
||||||
|
mode: '0755'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Template dockcheck configuration file
|
||||||
|
- name: Template dockcheck configuration
|
||||||
|
template:
|
||||||
|
src: dockcheck.config.j2
|
||||||
|
dest: /home/phil/.config/dockcheck.config
|
||||||
|
mode: '0644'
|
||||||
|
owner: phil
|
||||||
|
group: phil
|
||||||
|
|
||||||
|
# Create cron job for dockcheck as phil user
|
||||||
|
- name: Create cron job for dockcheck container updates
|
||||||
|
cron:
|
||||||
|
name: "Check Docker container updates"
|
||||||
|
minute: "0"
|
||||||
|
hour: "8"
|
||||||
|
user: phil
|
||||||
|
job: "/home/phil/.local/bin/dockcheck.sh"
|
||||||
|
16
roles/cron/templates/dockcheck.config.j2
Normal file
16
roles/cron/templates/dockcheck.config.j2
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Dockcheck Configuration - Check only, no updates
|
||||||
|
# Don't update, just check for updates
|
||||||
|
DontUpdate=true
|
||||||
|
|
||||||
|
# Enable notifications
|
||||||
|
Notify=true
|
||||||
|
|
||||||
|
# Exclude containers from checking
|
||||||
|
Exclude="authentik-postgresql-1,dawarich_redis"
|
||||||
|
|
||||||
|
# Notification channels
|
||||||
|
NOTIFY_CHANNELS="gotify"
|
||||||
|
|
||||||
|
# Gotify notification configuration
|
||||||
|
GOTIFY_DOMAIN="https://{{ subdomains.gotify }}"
|
||||||
|
GOTIFY_TOKEN="{{ vault_dockcheck.gotify_token }}"
|
Reference in New Issue
Block a user