Compare commits
2
Commits
796047a39f
...
9abed9f2e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9abed9f2e9 | ||
|
|
ac65ba2169 |
No files matched your search
+7
-2
@@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
cmd="$*"
|
cmd="$*"
|
||||||
|
|
||||||
echo "Running on hosts: $cmd"
|
# Build a temporary hosts file without comments (# ...) and blank lines
|
||||||
|
tmp_hosts=$(mktemp)
|
||||||
|
trap 'rm -f "$tmp_hosts"' EXIT
|
||||||
|
sed -e 's/#.*$//' -e 's/[[:space:]]*$//' -e '/^[[:space:]]*$/d' /app/host_vars/hosts > "$tmp_hosts"
|
||||||
|
|
||||||
pssh -h /app/host_vars/hosts -t 0 "$cmd"
|
echo "Running on hosts: $(tr '\n' ' ' < "$tmp_hosts")"
|
||||||
|
echo "Command: $cmd"
|
||||||
|
|
||||||
|
pssh -h "$tmp_hosts" -t 0 "$cmd"
|
||||||
+6
-1
@@ -21,7 +21,12 @@ case "$remotefile" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Read hosts from file descriptor 3 to prevent ssh from consuming stdin
|
# Read hosts from file descriptor 3 to prevent ssh from consuming stdin
|
||||||
while read -r host <&3; do
|
while read -r host <&3 || [ -n "$host" ]; do
|
||||||
|
# Strip comments (# ...) and surrounding whitespace; skip empty lines
|
||||||
|
host="${host%%#*}"
|
||||||
|
host="${host//[[:space:]]/}"
|
||||||
|
[ -z "$host" ] && continue
|
||||||
|
|
||||||
host_env_file="$host_vars_dir/$host/$host.env"
|
host_env_file="$host_vars_dir/$host/$host.env"
|
||||||
|
|
||||||
if [ ! -f "$host_env_file" ]; then
|
if [ ! -f "$host_env_file" ]; then
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ services:
|
|||||||
ipv4_address: 10.5.0.200
|
ipv4_address: 10.5.0.200
|
||||||
|
|
||||||
traefik:
|
traefik:
|
||||||
image: docker.io/library/traefik:3.6
|
image: docker.io/library/traefik:3.7
|
||||||
container_name: traefik
|
container_name: traefik
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
https://dl-cdn.alpinelinux.org/alpine/v3.22/main
|
https://dl-cdn.alpinelinux.org/alpine/v3.24/main
|
||||||
https://dl-cdn.alpinelinux.org/alpine/v3.22/community
|
https://dl-cdn.alpinelinux.org/alpine/v3.24/community
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
rex doas apk update
|
|
||||||
rex doas apk fix
|
|
||||||
rex doas apk upgrade
|
|
||||||
rex doas reboot
|
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
template templates/repositories /etc/apk/repositories
|
||||||
|
template templates/docker-compose.yml /4server/docker-compose.yml
|
||||||
|
|
||||||
|
rex doas apk update
|
||||||
|
rex doas apk fix
|
||||||
|
rex doas apk upgrade
|
||||||
|
rex doas docker compose -f /4server/docker-compose.yml pull
|
||||||
|
rex doas docker compose -f /4server/docker-compose.yml up -d
|
||||||
|
rex doas reboot
|
||||||
Binary file not shown.
Reference in new issue
Block a user