correct the scripts
This commit is contained in:
parent
cb42e3e820
commit
e54b3fbb88
|
@ -1,21 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
hosts = (
|
||||
hosts=(
|
||||
"nixos-management"
|
||||
"grav"
|
||||
"git"
|
||||
"heimdall"
|
||||
"mail"
|
||||
"nextcloud"
|
||||
"pihole"
|
||||
"plex"
|
||||
"proxy"
|
||||
"rss-bridge"
|
||||
"ttrss"
|
||||
)
|
||||
|
||||
rsa_key="~/.nixos/secrets/ssh_keys/ansible/ansible.key"
|
||||
$NIX_SSHOPTS="-t -i $rsa_key"
|
||||
rsa_key="$HOME/.nixos/secrets/ssh_keys/ansible/ansible.key"
|
||||
export NIX_SSHOPTS="-t -i $rsa_key"
|
||||
|
||||
for host in $hosts do
|
||||
for host in "${hosts[@]}"
|
||||
do
|
||||
fqdn="$host.2li.local"
|
||||
echo $fqdn
|
||||
nixos-rebuild switch --use-remote-sudo --build-host localhost --target-host $fqdn --flake ".#$host"
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
hosts = (
|
||||
"nixos-management"
|
||||
"grav"
|
||||
"heimdall"
|
||||
"mail"
|
||||
"plex"
|
||||
"proxy"
|
||||
"rss-bridge"
|
||||
"ttrss"
|
||||
)
|
||||
|
||||
update_command='tmux new -s updates "cd ~/.nixos && git pull && sudo nixos-rebuild -j auto switch || bash;"'
|
||||
rsa_key="~/.nixos/secrets/ssh_keys/ansible/ansible.key"
|
||||
|
||||
for host in $hosts do
|
||||
fqdn="$host.2li.local"
|
||||
echo $fqdn
|
||||
ssh -i $rsa_key -t $fqdn $update_command
|
||||
echo
|
||||
echo
|
||||
done
|
Loading…
Reference in New Issue