FEATURE: systemd unit and timer added to schedule and run maintenance playbook
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Run Ansible playbook for daily maintenance
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# CAHNGE TO MATCH YOUR REQUIREMENTS
|
||||
User=max
|
||||
Group=max
|
||||
WorkingDirectory=/home/max/projects/ansible_home
|
||||
ExecStart=/home/max/projects/ansible_home/run_playbook.sh /home/max/projects/ansible_home/playbooks/maintain.yaml
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
# Optional: prevent runaway if the playbook hangs
|
||||
TimeoutStopSec=3600
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user