Skip to content

deploy-rs stalls if ssh uses ControlMaster option... #233

Closed
@boxofrox

Description

@boxofrox

Steps to reproduce:

  1. Use ~/.ssh/config to enable ControlMaster yes for deploy recipient host (e.g. prod-1).
  2. Connect to recipient host to establish control master. E.g. ssh root@prod-1.
  3. Initiate deployment from administration host. E.g. deploy -s .#prod-1

Actual outcome:

Progress hangs at Copying profile.

$ deploy -s .#prod-1
🚀 ℹ️ [deploy] [INFO] Evaluating flake in .
🚀 ℹ️ [deploy] [INFO] The following profiles are going to be deployed:
[prod-1.system]
user = "root"
ssh_user = "root"
path = "/nix/store/0lf4flfq6lza9a99hq04qhwchz76b14f-activatable-nixos-system-prod-1-23.05.20230724.a58eb89"
hostname = "prod-1"
ssh_opts = []

🚀 ℹ️ [deploy] [INFO] Building profile `system` for node `prod-1`
🚀 ℹ️ [deploy] [INFO] Copying profile `system` to node `prod-1`

Expected outcome:

Finish deploy, then activate, then terminate program.

$ deploy -s .#prod-1
🚀 ℹ️ [deploy] [INFO] Evaluating flake in .
🚀 ℹ️ [deploy] [INFO] The following profiles are going to be deployed:
[prod-1.system]
user = "root"
ssh_user = "root"
path = "/nix/store/0lf4flfq6lza9a99hq04qhwchz76b14f-activatable-nixos-system-prod-1-23.05.20230724.a58eb89"
hostname = "prod-1"
ssh_opts = []

🚀 ℹ️ [deploy] [INFO] Building profile `system` for node `prod-1`
🚀 ℹ️ [deploy] [INFO] Copying profile `system` to node `prod-1`
🚀 ℹ️ [deploy] [INFO] Activating profile `system` for node `prod-1`
⭐ ℹ️ [activate] [INFO] Activating profile
stopping the following units: [email protected]
activating the configuration...
setting up /etc...
sops-install-secrets: Imported /etc/ssh/ssh_host_rsa_key as GPG key with fingerprint ****
sops-install-secrets: Imported /etc/ssh/ssh_host_ed25519_key as age key with fingerprint  ****
reloading user units for root...
setting up tmpfiles
starting the following units: [email protected]
⭐ ℹ️ [activate] [INFO] Activation succeeded!
🚀 ℹ️ [deploy] [INFO] Success activating, done!

Work around

  1. Use ssh root@prod-1 -O exit to kill existing ControlMaster.
  2. Use deploy -s .#prod-1 to establish new ControlMaster, deploy, activate, and terminate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions