mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-07-04 15:46:16 +00:00
Compare commits
No commits in common. "a40cd60d6060b22ba3f73842eefede20b349a419" and "9815f44b8467338e118922503d09bf390691ab11" have entirely different histories.
a40cd60d60
...
9815f44b84
5 changed files with 5 additions and 22 deletions
2
.github/workflows/lint-ansible.yml
vendored
2
.github/workflows/lint-ansible.yml
vendored
|
|
@ -22,6 +22,6 @@ jobs:
|
||||||
|
|
||||||
- name: Run ansible-lint
|
- name: Run ansible-lint
|
||||||
if: steps.check.outputs.has_files == 'true'
|
if: steps.check.outputs.has_files == 'true'
|
||||||
uses: ansible/ansible-lint@v26
|
uses: ansible/ansible-lint@v25
|
||||||
with:
|
with:
|
||||||
working_directory: ansible/
|
working_directory: ansible/
|
||||||
|
|
|
||||||
2
.github/workflows/validate-terraform.yml
vendored
2
.github/workflows/validate-terraform.yml
vendored
|
|
@ -89,7 +89,7 @@ jobs:
|
||||||
|
|
||||||
- name: Post plan as PR comment
|
- name: Post plan as PR comment
|
||||||
if: github.actor != 'dependabot[bot]'
|
if: github.actor != 'dependabot[bot]'
|
||||||
uses: actions/github-script@v9
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,6 @@ DIRS=(archive backups stash syncthing ftp)
|
||||||
EMAIL="pez@pez.sh"
|
EMAIL="pez@pez.sh"
|
||||||
SUBJECT="HDD Backup Report - $(date '+%Y-%m-%d %H:%M')"
|
SUBJECT="HDD Backup Report - $(date '+%Y-%m-%d %H:%M')"
|
||||||
|
|
||||||
# Versioning: a plain `rclone sync` permanently deletes/overwrites objects at
|
|
||||||
# the destination, so a deletion or ransomware encryption on /hdd would
|
|
||||||
# propagate to the backup on the next run. Instead, move every superseded
|
|
||||||
# version into a dated folder under $VERSIONS so it can be recovered, then
|
|
||||||
# prune anything older than $RETENTION_DAYS to cap storage.
|
|
||||||
STAMP="$(date '+%Y-%m-%d_%H%M%S')"
|
|
||||||
VERSIONS="$BUCKET/_versions"
|
|
||||||
RETENTION_DAYS=30
|
|
||||||
|
|
||||||
failures=()
|
failures=()
|
||||||
report=""
|
report=""
|
||||||
size_error=""
|
size_error=""
|
||||||
|
|
@ -25,7 +16,7 @@ for dir in "${DIRS[@]}"; do
|
||||||
dst="$BUCKET/$dir"
|
dst="$BUCKET/$dir"
|
||||||
echo "Syncing $src -> $dst"
|
echo "Syncing $src -> $dst"
|
||||||
|
|
||||||
if output=$(rclone sync "$src" "$dst" --backup-dir "$VERSIONS/$STAMP/$dir" -v 2>&1); then
|
if output=$(rclone sync "$src" "$dst" -v 2>&1); then
|
||||||
rc=0
|
rc=0
|
||||||
else
|
else
|
||||||
rc=$?
|
rc=$?
|
||||||
|
|
@ -37,14 +28,6 @@ for dir in "${DIRS[@]}"; do
|
||||||
report+="=== $dir ===\n$output\n\n"
|
report+="=== $dir ===\n$output\n\n"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Prune versioned copies older than the retention window.
|
|
||||||
if prune_output=$(rclone delete "$VERSIONS" --min-age "${RETENTION_DAYS}d" -v 2>&1); then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
failures+=("version-prune")
|
|
||||||
report+="=== Version Prune Error ===\n$prune_output\n\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get bucket storage usage
|
# Get bucket storage usage
|
||||||
if bucket_usage=$(rclone size "$BUCKET" 2>&1); then
|
if bucket_usage=$(rclone size "$BUCKET" 2>&1); then
|
||||||
:
|
:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ terraform {
|
||||||
required_providers {
|
required_providers {
|
||||||
pagerduty = {
|
pagerduty = {
|
||||||
source = "pagerduty/pagerduty"
|
source = "pagerduty/pagerduty"
|
||||||
version = "~> 3.32"
|
version = "~> 2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ terraform {
|
||||||
}
|
}
|
||||||
pagerduty = {
|
pagerduty = {
|
||||||
source = "pagerduty/pagerduty"
|
source = "pagerduty/pagerduty"
|
||||||
version = "~> 3.32"
|
version = "~> 2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue