Skip to content

Commit

Permalink
patch: latest Packer deployment for pve8 (#385)
Browse files Browse the repository at this point in the history
* fix: update on packer template hcl file

* fix: update to the latest distro version

* fix: add packer init procedure to avoid plugin missing error

* chore: add reference link

* Update packer-templates/http/user-data

---------

Co-authored-by: kev <[email protected]>
  • Loading branch information
mptm436 and piyoki authored Oct 6, 2023
1 parent 6780bd8 commit bf636f0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions packer-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ $ brew install hashicorp/tap/packer
# verify installation
$ packer
```
Run `packer init` to install necessary plugins

For detailed instructions on how to install Packer on other platforms or Linux distributions, please head to this [ Getting Started ](https://learn.hashicorp.com/tutorials/packer/get-started-install-cli) guide.

Expand Down
10 changes: 5 additions & 5 deletions packer-templates/bakery-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
},
"ubuntu-2204-server": {
"image_name": "ubuntu-2204-server",
"iso": "ubuntu-22.04.1-live-server-amd64.iso",
"iso": "ubuntu-22.04.3-live-server-amd64.iso",
"playbook": "ubuntu-2204-1-server.yml"
},
"docker-ubuntu-2204-server": {
"image_name": "docker-ubuntu-2204-server",
"iso": "ubuntu-22.04.1-live-server-amd64.iso",
"iso": "ubuntu-22.04.3-live-server-amd64.iso",
"playbook": "docker-2204-ubuntu-server.yml"
},
"containerd-ubuntu-2204-server": {
"image_name": "containerd-ubuntu-2204-server",
"iso": "ubuntu-22.04.1-live-server-amd64.iso",
"iso": "ubuntu-22.04.3-live-server-amd64.iso",
"playbook": "containerd-ubuntu-2204-server.yml"
},
"cn-ubuntu-2204-server": {
"image_name": "cn-ubuntu-2204-server",
"iso": "ubuntu-22.04.1-live-server-amd64.iso",
"iso": "ubuntu-22.04.3-live-server-amd64.iso",
"playbook": "cn-ubuntu-2204-server.yml"
},
"custom": {
"image_name": "custom-server",
"iso": "ubuntu-22.04.1-live-server-amd64.iso",
"iso": "ubuntu-22.04.3-live-server-amd64.iso",
"playbook": "custom.yml"
}
}
6 changes: 3 additions & 3 deletions packer-templates/http/user-data
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#cloud-config
# cloud-init-modules-config
# https://cloudinit.readthedocs.io/en/latest/reference/modules.html
autoinstall:
version: 1
locale: en_US
keyboard:
layout: en
variant: us
layout: us
write_files:
- path: /etc/sysctl.d/10-disable-ipv6.conf
permissions: 0644
Expand Down
14 changes: 13 additions & 1 deletion packer-templates/proxmox-packer-template.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
packer {
required_plugins {
proxmox = {
version = ">= 1.1.5"
source = "github.com/hashicorp/proxmox"
}
ansible = {
source = "github.com/hashicorp/ansible"
version = "~> 1"
}
}
}

# Variable Definitions
variable "proxmox_host" { type = string }
variable "proxmox_api_user" { type = string }
Expand Down Expand Up @@ -124,7 +137,6 @@ build {
post-processor "shell-local" {
inline = [
"ssh root@${var.proxmox_host} qm set ${var.vm_id} --boot c --bootdisk scsi0", # set boot order
"ssh root@${var.proxmox_host} qm set ${var.vm_id} --ide0 ${var.cloud_init_storage_pool}:cloudinit", # ensure cloud-init drive is present
"ssh root@${var.proxmox_host} qm set ${var.vm_id} --delete ide2", # delete default iso
"ssh root@${var.proxmox_host} qm set ${var.vm_id} --vga std", # set default graphics type
"ssh root@${var.proxmox_host} qm set ${var.vm_id} --ciuser ${var.ssh_username}", # set cloud-init default user
Expand Down

0 comments on commit bf636f0

Please sign in to comment.