diff --git a/scripts/run-command b/scripts/run-command new file mode 100755 index 0000000..f61b364 --- /dev/null +++ b/scripts/run-command @@ -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