forked from DGNum/infrastructure
feat(netconf/scripts): init script for deployment
This commit is contained in:
parent
fabfc982f2
commit
2b4a332bf6
2 changed files with 28 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
||||||
sshOptions = [
|
sshOptions = [
|
||||||
"-J"
|
"-J"
|
||||||
"root@vault01.hyp01.infra.dgnum.eu"
|
"root@vault01.hyp01.infra.dgnum.eu"
|
||||||
|
"-p"
|
||||||
|
"830"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
26
scripts/netconf-apply.sh
Executable file
26
scripts/netconf-apply.sh
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# SPDX-FileCopyrightText: 2025 Lubin Bailly <lubin.bailly@dgnum.eu>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
ssh_command=${SSH_COMMAND-ssh}
|
||||||
|
|
||||||
|
target_host=$1
|
||||||
|
shift
|
||||||
|
|
||||||
|
if [ -z "$target_host" ] ; then
|
||||||
|
echo Usage: netconf-apply target-host
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if toplevel="$(nix-build $(colmena eval -E "{ nodes, ... }: nodes.${target_host}.config.netconf.rpc" --instantiate))"; then
|
||||||
|
$ssh_command $(colmena eval -E "{nodes, ...}:
|
||||||
|
with nodes.${target_host}.config.deployment;
|
||||||
|
\"\${targetUser}@\${targetHost} \${builtins.concatStringsSep \" \" sshOptions}\"" | sed 's/"//g') \
|
||||||
|
-s netconf < $toplevel
|
||||||
|
else
|
||||||
|
echo Build failed
|
||||||
|
fi
|
Loading…
Add table
Add a link
Reference in a new issue