Skip to content

Commit 6b702e1

Browse files
authored
Merge pull request #274 from stackhpc/feat/ephemeral-ssh-keys
Use of ephemeral SSH keys when building Packer images
2 parents aa63d7e + 11d9268 commit 6b702e1

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

environments/.stackhpc/builder.pkrvars.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ networks = ["a262aabd-e6bf-4440-a155-13dbc1b5db0e"] # WCDC-iLab-60
33
source_image_name = "openhpc-230503-0944-bf8c3f63.qcow2" # https://github.com/stackhpc/ansible-slurm-appliance/pull/252
44
fatimage_source_image_name = "Rocky-8-GenericCloud-8.6.20220702.0.x86_64.qcow2"
55
ssh_keypair_name = "slurm-app-ci"
6+
ssh_private_key_file = "~/.ssh/id_rsa"
67
security_groups = ["default", "SSH"]
78
ssh_bastion_host = "128.232.222.183"
89
ssh_bastion_username = "slurm-app-ci"

packer/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ Building an environment-specific compute node image will[^1] require a cluster t
2222
flavor = "general.v1.small" # VM flavor to use for builder VMs
2323
networks = ["26023e3d-bc8e-459c-8def-dbd47ab01756"] # List of network UUIDs to attach the VM to
2424
source_image_name = "Rocky-8.5-GenericCloud" # Name of source image. This must exist in OpenStack and should be a Rocky Linux 8.5 GenericCloud-based image.
25-
ssh_keypair_name = "slurm-app-ci" # Name of an existing keypair in OpenStack. The private key must be on the host running Packer.
2625
```
2726

27+
This configuration will generate and use an ephemeral SSH key for communicating with the Packer VM. If this is undesirable, set `ssh_keypair_name` to the name of an existing keypair in OpenStack. The private key must be on the host running Packer, and its path can be set using `ssh_private_key_file`.
28+
2829
The network used for the Packer VM must provide outbound internet access but does not need to provide access to resources which the final cluster nodes require (e.g. Slurm control node, network filesystem servers etc.).
2930

3031
For additional options such as non-default private key locations or jumphost configuration see the variable descriptions in `./openstack.pkr.hcl`.

packer/openstack.pkr.hcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ variable "ssh_username" {
6464

6565
variable "ssh_private_key_file" {
6666
type = string
67-
default = "~/.ssh/id_rsa"
67+
default = null
6868
}
6969

7070
variable "ssh_keypair_name" {
7171
type = string
72+
default = null
7273
}
7374

7475
variable "security_groups" {

0 commit comments

Comments
 (0)