Skip to content

Commit

Permalink
Clear Packer authorized key after build (#82)
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <[email protected]>
  • Loading branch information
peterdeme authored Feb 11, 2025
1 parent 5d590c7 commit d460f58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
9 changes: 5 additions & 4 deletions aws.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ It contains all the neccessary tools to run Spacelift workers.
More information: https://docs.spacelift.io.
EOT

shared_credentials_file = var.shared_credentials_file
encrypt_boot = var.encrypt_boot
instance_type = var.instance_type
ssh_username = "ec2-user"
shared_credentials_file = var.shared_credentials_file
encrypt_boot = var.encrypt_boot
instance_type = var.instance_type
ssh_username = "ec2-user"
ssh_clear_authorized_keys = true

vpc_id = var.vpc_id
region = var.region
Expand Down
2 changes: 2 additions & 0 deletions azure.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ source "azure-arm" "spacelift" {

vm_size = var.vm_size

ssh_clear_authorized_keys = true

azure_tags = merge(var.additional_tags, {
Name = "Spacelift Worker Image"
SourceImagePublisher = var.source_image_publisher
Expand Down
17 changes: 9 additions & 8 deletions gcp.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ variable "zone" {
}

source "googlecompute" "spacelift" {
project_id = var.project_id
source_image_family = var.source_image_family
source_image = var.source_image
ssh_username = "spacelift"
zone = var.zone
disk_size = 50
machine_type = var.machine_type
account_file = var.account_file
project_id = var.project_id
source_image_family = var.source_image_family
source_image = var.source_image
ssh_username = "spacelift"
ssh_clear_authorized_keys = true
zone = var.zone
disk_size = 50
machine_type = var.machine_type
account_file = var.account_file

image_name = "${var.image_base_name}-${var.image_storage_location}-${var.suffix}"
image_family = var.image_family
Expand Down

0 comments on commit d460f58

Please sign in to comment.