flight
This commit is contained in:
@@ -4,12 +4,14 @@ echo "command: mount_volume <volume>"
|
||||
echo "alias: set_prod"
|
||||
|
||||
export hosts_file="/app/hosts.dev"
|
||||
export host_vars_dir="/app/host_vars/"
|
||||
|
||||
export PS1="\[\e[32m\]\h:\w\$\[\e[0m\] "
|
||||
df -h .
|
||||
|
||||
set_prod() {
|
||||
export HOSTS_FILE="/app/hosts.all"
|
||||
echo "HOSTS_FILE set to: $HOSTS_FILE"
|
||||
export hosts_file="/app/hosts.all"
|
||||
export host_vars_dir="/app/host_vars/vault/"
|
||||
echo "LIVE MODE ENABLED !!! "
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
127.0.0.1 dev
|
||||
::1 dev
|
||||
|
||||
192.168.111.209 dev
|
||||
192.168.111.209 dev n8n
|
||||
|
||||
192.168.9.11 saopaulo
|
||||
192.168.9.17 mumbai
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
echo "Usage: $0 <localfile> <remotefile> <host_vars_dir>"
|
||||
echo "Usage: $0 <localfile> <remotefile>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
localfile="$1"
|
||||
remotefile="$2"
|
||||
host_vars_dir="$3"
|
||||
remotetmp="/var/tmp/4server"
|
||||
|
||||
|
||||
|
||||
while read -r host; do
|
||||
echo "Processing host: $host"
|
||||
@@ -32,7 +34,8 @@ while read -r host; do
|
||||
done
|
||||
|
||||
echo "Copying to $host:$remotefile"
|
||||
echo "$content" | ssh "$host" "cat > $remotefile"
|
||||
echo "$content" | ssh "$host" "cat > $remotetmp"
|
||||
rex doas mv $remotetmp $remotefile
|
||||
|
||||
done < "$hosts_file"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user