Skip to content

Commit

Permalink
Added Ubuntu 20.04 LTS (Focal Fossa)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudmaniac committed Mar 17, 2021
1 parent 6bde1ab commit 8b8e868
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ubuntu/build-ubuntu-20.04.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Building Ubuntu 20.04.2 LTS (Focal Fossa) template"

packer build -force -var-file=../clouds/var-infra-z67.json ubuntu-20.04.json
Empty file added ubuntu/http/20.04/meta-data
Empty file.
27 changes: 27 additions & 0 deletions ubuntu/http/20.04/user-data
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#cloud-config
autoinstall:
version: 1
locale: en_US
keyboard:
layout: en
variant: us
network:
network:
version: 2
ethernets:
ens192:
dhcp4: true
storage:
layout:
name: lvm
identity:
hostname: ubuntu-packer
username: packer
password: $6$yRp1sC9EfcWC6bg$JLJ8y/UPg6EQsyjIck78qvO6/TdA8wnzeiBPyICI2jwWtU0.sYEpyY4fSxmbVAeB74zgPdVECE/aeW4alye2X0
ssh:
install-server: yes
allow-pw: true
user-data:
disable_root: false
late-commands:
- echo 'packer ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/packer
91 changes: 91 additions & 0 deletions ubuntu/ubuntu-20.04.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"variables":
{
"author": "Romain Decker",
"website": "https://cloudmaniac.net",
"description": "Creation of a Ubuntu 20.04.2.0 LTS (Focal Fossa) vSphere template",
"var_vm_name": "packer-ubuntu-20.04",
"var_vm_hostname": "packer-ubuntu-20.04",
"var_vsphere_template_folder": "templates/packer/ubuntu",
"var_vm_guestos": "ubuntu64Guest",
"var_vm_cpu_size": "1",
"var_vm_ram_size": "1024",
"var_vm_disk_controller": "pvscsi",
"var_vm_disk_size": "16384",
"var_vm_notes": "Ubuntu 20.04.2.0 LTS (Focal Fossa) - {{isotime \"2006-01-02\"}}",
"var_iso_url": "https://releases.ubuntu.com/20.04/ubuntu-20.04.2-live-server-amd64.iso",
"var_iso_checksum_type": "sha256",
"var_iso_checksum": "d1f2bf834bbe9bb43faf16f9be992a6f3935e65be0edece1dee2aa6eb1767423",
"var_http_path": "20.04",
"var_guest_username": "packer",
"var_guest_password": "VMware1!"
}
,
"builders": [
{
"type": "vsphere-iso",

"vcenter_server": "{{user `var_vsphere_vcenter`}}",
"username": "{{user `var_vsphere_username`}}",
"password": "{{user `var_vsphere_password`}}",
"insecure_connection": "true",

"datacenter": "{{user `var_vsphere_datacenter`}}",
"cluster": "{{user `var_vsphere_cluster`}}",
"folder": "{{user `var_vsphere_template_folder`}}",
"datastore": "{{user `var_vsphere_datastore`}}",
"network_adapters": [
{
"network": "{{user `var_vsphere_network`}}",
"network_card": "vmxnet3"
}
],
"convert_to_template": "true",

"vm_name": "{{user `var_vm_name`}}",
"guest_os_type": "{{user `var_vm_guestos`}}",

"CPUs": "{{user `var_vm_cpu_size`}}",
"RAM": "{{user `var_vm_ram_size`}}",
"disk_controller_type": "{{user `var_vm_disk_controller`}}",
"storage": [
{
"disk_size": "{{user `var_vm_disk_size`}}",
"disk_thin_provisioned": true
}
],
"notes": "{{user `var_vm_notes`}}",

"communicator":"ssh",
"ssh_username": "{{user `var_guest_username`}}",
"ssh_password": "{{user `var_guest_password`}}",
"ssh_timeout": "30m",
"ssh_handshake_attempts": "200",

"iso_urls": "{{user `var_iso_url`}}",
"iso_checksum": "{{user `var_iso_checksum_type`}}:{{user `var_iso_checksum`}}",

"http_directory": "http/{{user `var_http_path`}}",

"boot_wait": "5s",
"boot_command": [
"<esc><wait><esc><wait><f6><wait><esc><wait>",
"autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ ",
"--- <enter>"
],
"shutdown_command": "echo '{{user `var_guest_password`}}' | sudo -S -E shutdown -P now"
}],
"provisioners": [{
"execute_command": "echo '{{user `var_guest_password`}}' | sudo -S -E bash '{{.Path}}'",
"scripts": [
"./scripts/update.sh",
"./scripts/cleanup.sh"
],
"type": "shell"
},
{
"inline": "echo 'Template build complete ({{isotime \"2006-01-02 03:04:05\"}})!'",
"type": "shell"
}
]
}

0 comments on commit 8b8e868

Please sign in to comment.