Skip to content

Commit

Permalink
NO-ISSUE: nutanix change to disk image
Browse files Browse the repository at this point in the history
  • Loading branch information
eifrach committed Jun 5, 2024
1 parent 27ea646 commit b8c0530
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 75 deletions.
58 changes: 0 additions & 58 deletions packer_files/nutanix_centos_template/centos-config/ks.cfg

This file was deleted.

14 changes: 14 additions & 0 deletions packer_files/nutanix_centos_template/cloud-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#cloud-config
ssh_pwauth: True
disable_root: False
chpasswd:
list: |
root:packer
expire: False
users:
- name: root
lock_passwd: False
ssh_authorized_keys:
- SSH_KEY_PLACEHOLDER
runcmd:
- systemctl enable --now sshd
19 changes: 4 additions & 15 deletions packer_files/nutanix_centos_template/sources.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,12 @@ source "nutanix" "test-infra" {
nutanix_insecure = var.nutanix_insecure
cluster_name = var.nutanix_cluster
os_type = "Linux"
user_data = base64encode(file("cloud-config.yaml"))

vm_disks {
image_type = "ISO_IMAGE"
source_image_name = var.centos_iso_image_name
}

cd_label = "OEMDRV"
cd_content = {
"ks.cfg" = templatefile("centos-config/ks.cfg", {
ssh_public_key_content = local.ssh_public_key_content
root_password = var.root_password
})
}

vm_disks {
image_type = "DISK"
disk_size_gb = var.disk_size / 1024
image_type = var.image_type
source_image_uri = var.centos_disk_image_url
disk_size_gb = var.disk_size / 1024
}

vm_nics {
Expand Down
2 changes: 1 addition & 1 deletion packer_files/nutanix_centos_template/variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ variable "nutanix_cluster" {

### Builder variables

variable "centos_iso_image_name" {
variable "centos_disk_image_url" {
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion packer_files/nutanix_centos_template/vars.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"nutanix_port": "placeholder",
"nutanix_cluster": "placeholder",
"nutanix_subnet": "placeholder",
"centos_iso_image_name": "placeholder",
"centos_disk_image_name": "placeholder",
"image_name": "assisted-test-infra-machine"
}

0 comments on commit b8c0530

Please sign in to comment.