Add a command to run a script on all servers
This commit is contained in:
parent
723a6a21f3
commit
779c42684b
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd /home/andreas/.nixos
|
||||
|
||||
hosts=($(echo $(nix eval .#nixosConfigurations --apply 'pkgs: builtins.concatStringsSep " " (builtins.attrNames pkgs)') | xargs))
|
||||
skip=(
|
||||
"desktop-vm"
|
||||
"gwyn"
|
||||
"loki-test"
|
||||
"mobile"
|
||||
"staubfinger"
|
||||
"test-raspi"
|
||||
)
|
||||
|
||||
rsa_key="$HOME/.nixos/secrets/ssh_keys/ansible/ansible.key"
|
||||
|
||||
for host in "${hosts[@]}"; do
|
||||
# Check if the host is in the skip list
|
||||
if [[ " ${skip[*]} " =~ " ${host} " ]]; then
|
||||
continue
|
||||
fi
|
||||
fqdn="$host.2li.local"
|
||||
echo $fqdn
|
||||
ssh -i $rsa_key $fqdn $1
|
||||
echo
|
||||
echo
|
||||
done
|
Loading…
Reference in New Issue