Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sample_pet/README
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
Pets configuration examples.

This directory contains sample pet files demonstrating various use cases:

cron/
certbot - Let's Encrypt certificate renewal cron job
mdadm - RAID monitoring cron job

docker/
docker-compose.yml - Deploy a docker-compose stack (nginx + redis)

git/
gitconfig - System-wide git configuration with sensible defaults

ssh/
sshd_config - SSH daemon configuration with key-only auth
user_ssh_config - User SSH client configuration

ssmtp/
ssmtp.conf - Simple SMTP relay configuration
revaliases - Reverse aliases for outgoing mail

sudo/
sudoers - Sudo configuration
sudo_group - Sudo group membership

systemd/
backup.service - Systemd service unit for scheduled backups
backup.timer - Systemd timer for daily backup execution

vimrc - Vim editor configuration
29 changes: 29 additions & 0 deletions sample_pet/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# pets: destfile=/opt/myapp/docker-compose.yml, owner=root, group=docker, mode=0640
# pets: package=docker.io
# pets: package=docker-compose
# pets: post=/usr/bin/docker-compose -f /opt/myapp/docker-compose.yml up -d
#
# Example: Deploy a simple web application with nginx and redis
# Run 'pets' to install docker packages and deploy the compose stack

version: '3.8'

services:
web:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./html:/usr/share/nginx/html:ro
depends_on:
- cache
restart: unless-stopped

cache:
image: redis:alpine
volumes:
- redis_data:/data
restart: unless-stopped

volumes:
redis_data:
26 changes: 26 additions & 0 deletions sample_pet/git/gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# pets: destfile=/etc/gitconfig, owner=root, group=root, mode=0644
# pets: package=git
#
# Example: System-wide git configuration
# Sets sensible defaults for all users on the system

[init]
defaultBranch = main

[core]
autocrlf = input
editor = vim

[pull]
rebase = true

[push]
default = current
autoSetupRemote = true

[alias]
st = status
co = checkout
br = branch
ci = commit
lg = log --oneline --graph --decorate
19 changes: 19 additions & 0 deletions sample_pet/systemd/backup.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# pets: destfile=/etc/systemd/system/backup.service, owner=root, group=root, mode=0644
# pets: post=/bin/systemctl daemon-reload
#
# Example: A systemd service unit for scheduled backups
# Use with backup.timer to run backups on a schedule

[Unit]
Description=System backup service
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions sample_pet/systemd/backup.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pets: destfile=/etc/systemd/system/backup.timer, owner=root, group=root, mode=0644
# pets: post=/bin/systemctl daemon-reload
# pets: post=/bin/systemctl enable --now backup.timer
#
# Example: A systemd timer to trigger daily backups at 3am

[Unit]
Description=Run backup daily

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true
RandomizedDelaySec=1800

[Install]
WantedBy=timers.target