Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-ISSUE: nutanix change to disk image #2458

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "DISK_IMAGE"
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_url": "placeholder",
"image_name": "assisted-test-infra-machine"
}