Commit Graph

10 Commits

Author SHA1 Message Date
Jean-François Roche
8ba2cbf6f4 terraform: do not show private key in local-exec logs
While running terraform with and without verbose mode enabled, we don't want the private key content to be shown in the terraform apply output.
2023-06-07 01:19:41 +02:00
Jean-François Roche
a82a84da8a terraform/nixos-rebuild: do not ignore deploy errors by default
Add option to ignore systemd errors during deployment.

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2023-04-04 17:10:28 +02:00
Jean-François Roche
4371932193 fix(rebuild): use sudo if rebuild with another user than root
In order to switch the NixOS configuration, we must have root access.
If we are connecting to the target host with a non-root user, we use the "sudo" command.

We could instead use `nixos-rebuild --use-remote-sudo --target-host` but it
would evaluate the nixos system again.
2023-03-31 21:33:05 +02:00
zimbatm
eafa9cfce5
nixos-rebuild: fix double trap
Only one callback can be installed per signal in Bash. Because the
previous `trap` removes the whole temporary workdir, the one around the
SSH key is redundant.
2023-03-29 16:17:29 +02:00
zimbatm
1120774e38
nixos-rebuild: fix SSH key security race
Make sure the ssh_key file is always 0700
2023-03-29 16:17:28 +02:00
Samuel Rounce
5adb698f51
fix(terraform/nixos-rebuild): typo in variables.sh 2023-03-29 09:09:21 +01:00
Jean-François Roche
16143cd8c0 terraform: allow nixos-rebuild to use specified private key for deployment
`nixos-rebuild/deploy.sh` script enable ssh authentication with a given private key
through the `SSH_KEY` environment variable.

Add additional variable for the private key used for the deployment.
To encourage the use of ssh-agent and discourage the storage of deployment keys in the terraform state
we do not set the install ssh key as the default for the deployment key.

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2023-03-28 00:28:48 +02:00
Jörg Thalheim
c2f70ed844 nixos-rebuild: allow to change deploy user 2023-03-03 14:47:03 +01:00
Jörg Thalheim
ed0ab16c58 terraform: drop dependency on the retry program 2023-02-23 16:15:52 +01:00
lassulus
411fb9bd76 terraform: init modules 2023-02-14 07:34:24 +01:00