|
11 | 11 | , execTaskDriver |
12 | 12 | , generatorTaskName |
13 | 13 | , oneTracerPerNode ? false |
| 14 | +, withSsh ? false |
14 | 15 | }: |
15 | 16 |
|
16 | 17 | let |
|
593 | 594 | withGenerator = taskName == generatorTaskName; |
594 | 595 | # Only for the tracer task or also nodes if oneTracerPerNode |
595 | 596 | withTracer = oneTracerPerNode || taskName == "tracer"; |
| 597 | + inherit withSsh; |
596 | 598 | # ''{{ env "NOMAD_TASK_DIR" }}/supervisor.sock'' |
597 | 599 | inherit unixHttpServerPort; |
598 | 600 | }; |
|
729 | 731 | perms = "744"; # Only for every "start.sh" script. Default: "644" |
730 | 732 | } |
731 | 733 | ] |
| 734 | + ++ |
| 735 | + # ssh |
| 736 | + (lib.optionals withSsh ( |
| 737 | + let |
| 738 | + ssh-service = import |
| 739 | + ../service/ssh.nix |
| 740 | + { |
| 741 | + inherit pkgs; |
| 742 | + bashInteractive = containerSpecs.containerPkgs.bashInteractive.nix-store-path; |
| 743 | + coreutils = containerSpecs.containerPkgs.coreutils.nix-store-path; |
| 744 | + openssh_hacks = containerSpecs.containerPkgs.openssh_hacks.nix-store-path; |
| 745 | + } |
| 746 | + ; |
| 747 | + in [ |
| 748 | + ## ssh start.sh script. |
| 749 | + { |
| 750 | + env = false; |
| 751 | + destination = "${task_statedir}/ssh/start.sh"; |
| 752 | + data = escapeTemplate ssh-service.start.value; |
| 753 | + change_mode = "noop"; |
| 754 | + error_on_missing_key = true; |
| 755 | + perms = "744"; # Only for every "start.sh" script. Default: "644" |
| 756 | + } |
| 757 | + ## ssh config file. |
| 758 | + { |
| 759 | + env = false; |
| 760 | + destination = "${task_statedir}/ssh/sshd_config"; |
| 761 | + data = escapeTemplate ssh-service.config.value; |
| 762 | + change_mode = "noop"; |
| 763 | + error_on_missing_key = true; |
| 764 | + perms = "744"; # Only for every "start.sh" script. Default: "644" |
| 765 | + } |
| 766 | + # The deployer script must add the templates for the private keys: |
| 767 | + # - ${task_statedir}/ssh/sshd.id_ed25519 |
| 768 | + # - ${task_statedir}/ssh/nobody.id_ed25519.pub |
| 769 | + ] |
| 770 | + )) |
732 | 771 | ; |
733 | 772 |
|
734 | 773 | # Specifies logging configuration for the stdout and stderr of the |
|
0 commit comments