first commit
This commit is contained in:
commit
6cb709bc3a
16 changed files with 1142 additions and 0 deletions
0
ubuntu2204/http/meta-data
Normal file
0
ubuntu2204/http/meta-data
Normal file
24
ubuntu2204/http/user-data
Normal file
24
ubuntu2204/http/user-data
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#cloud-config
|
||||
autoinstall:
|
||||
version: 1
|
||||
locale: en_US
|
||||
keyboard:
|
||||
layout: en
|
||||
variant: us
|
||||
storage:
|
||||
layout:
|
||||
name: lvm
|
||||
identity:
|
||||
hostname: ubuntu
|
||||
username: ubuntu
|
||||
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
|
||||
ssh:
|
||||
install-server: yes
|
||||
allow-pw: yes
|
||||
user-data:
|
||||
disable_root: false
|
||||
packages:
|
||||
- qemu-guest-agent
|
||||
late-commands:
|
||||
- 'sed -i "s/dhcp4: true/&\n dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
|
||||
- echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
|
||||
74
ubuntu2204/packer.json
Normal file
74
ubuntu2204/packer.json
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"variables": {
|
||||
"proxmox_username": "",
|
||||
"proxmox_password": "",
|
||||
"proxmox_url": "",
|
||||
"proxmox_node": "",
|
||||
"proxmox_storage_pool": "local-lvm",
|
||||
"proxmox_storage_pool_type": "lvm-thin",
|
||||
"proxmox_storage_format": "raw",
|
||||
"proxmox_iso_pool": "local:iso",
|
||||
"ubuntu_image": "ubuntu-22.04.1-live-server-amd64.iso",
|
||||
"template_name": "Ubuntu-22.04-Template",
|
||||
"template_description": "Ubuntu 22.04 Template",
|
||||
"version": ""
|
||||
},
|
||||
"builders": [
|
||||
{
|
||||
"type": "proxmox",
|
||||
"username": "{{user `proxmox_username`}}",
|
||||
"password": "{{user `proxmox_password`}}",
|
||||
"proxmox_url": "{{ user `proxmox_url`}}",
|
||||
"insecure_skip_tls_verify": true,
|
||||
"node": "{{user `proxmox_node`}}",
|
||||
"os": "l26",
|
||||
"boot_command": [
|
||||
"c",
|
||||
"linux /casper/vmlinuz -- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/'",
|
||||
"<enter><wait><wait>",
|
||||
"initrd /casper/initrd",
|
||||
"<enter><wait><wait>",
|
||||
"boot<enter>"
|
||||
],
|
||||
"network_adapters": [
|
||||
{
|
||||
"bridge": "vmbr0"
|
||||
}
|
||||
],
|
||||
"disks": [
|
||||
{
|
||||
"type": "scsi",
|
||||
"disk_size": "8G",
|
||||
"storage_pool": "{{user `proxmox_storage_pool`}}",
|
||||
"storage_pool_type": "{{user `proxmox_storage_pool_type`}}",
|
||||
"format": "{{user `proxmox_storage_format`}}"
|
||||
}
|
||||
],
|
||||
"scsi_controller": "virtio-scsi-single",
|
||||
"iso_file": "{{user `proxmox_iso_pool`}}/{{user `ubuntu_image`}}",
|
||||
"boot_wait": "10s",
|
||||
"cores": "2",
|
||||
"memory": "2048",
|
||||
"http_directory": "ubuntu2204/http",
|
||||
"ssh_username": "ubuntu",
|
||||
"ssh_password": "ubuntu",
|
||||
"ssh_port": 22,
|
||||
"ssh_timeout": "30m",
|
||||
"unmount_iso": true,
|
||||
"template_name": "{{user `template_name`}}",
|
||||
"template_description": "{{user `template_description`}}"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
|
||||
"sudo rm -f /etc/cloud/cloud.cfg.d/99-installer.cfg",
|
||||
"sudo cloud-init clean",
|
||||
"sudo passwd -d ubuntu"
|
||||
],
|
||||
"only": ["proxmox"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue