Skip to content

Commit

Permalink
added Ubuntu 16.04 files
Browse files Browse the repository at this point in the history
  • Loading branch information
samgabrail committed Jun 20, 2022
1 parent f227cf7 commit eb06ab4
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .dccache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{"/home/sam/Deployment_Linux/Packer/packer-terraform-vmware/packer-vsphere-iso-windows/win2016.base/autounattend.xml":[14846,1631301008435.3188,"d2d82f997add4f612bc6c02cb99a69e9696b6b223ca755ca2116f9825508723a"],"/home/sam/Deployment_Linux/Packer/packer-terraform-vmware/packer-vsphere-iso-windows/win2019.base/autounattend.xml":[11928,1631301008445.3188,"a5642d0381fdf1fb0be3bbd27cd2f96b20b02692868450d301e6594a2a175fab"]}
1 change: 1 addition & 0 deletions packer-vsphere-iso-linux/Ubuntu-16.04/.dccache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions packer-vsphere-iso-linux/Ubuntu-16.04/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Packer Template for Ubuntu 16.04 LTS

To create the template execute **packer build -force -debug -on-error=ask -var-file variables.json ubuntu16-thick.json** for debugging.

Or execute **packer build -force -var-file variables.json ubuntu16-thick.json** for regular deployment.
43 changes: 43 additions & 0 deletions packer-vsphere-iso-linux/Ubuntu-16.04/sample-preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Setting the locales, country
# Supported locales available in /usr/share/i18n/SUPPORTED
d-i debian-installer/language string en
d-i debian-installer/country string us
d-i debian-installer/locale string en_US.UTF-8

# Keyboard setting
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/xkb-keymap us
d-i keyboard-configuration/modelcode string pc105

# User creation
d-i passwd/user-fullname string username
d-i passwd/username string username
d-i passwd/user-password password xxxx
d-i passwd/user-password-again password xxxx
d-i user-setup/allow-password-weak boolean true

# Disk and Partitioning setup
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# Set root password
d-i passwd/root-login boolean true
d-i passwd/root-password password SecretPass
d-i passwd/root-password-again password SecretPass

# Package installations
d-i pkgsel/include string open-vm-tools openssh-server net-tools perl vim
# d-i pkgsel/include string open-vm-tools openssh-server net-tools perl perl-modules-5.26

d-i grub-installer/only_debian boolean true

d-i preseed/late_command string \
echo 'username ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/username ; \
in-target chmod 440 /etc/sudoers.d/username ;

d-i finish-install/reboot_in_progress note
82 changes: 82 additions & 0 deletions packer-vsphere-iso-linux/Ubuntu-16.04/ubuntu16-thick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"builders": [
{
"type": "vsphere-iso",

"vcenter_server": "{{user `vcenter-server`}}",
"username": "{{user `vcenter-username`}}",
"password": "{{user `vcenter-password`}}",
"insecure_connection": "true",
"datacenter": "{{user `datacenter`}}",

"vm_name": "{{user `vm-name`}}",

"datastore": "{{user `datastore`}}",
"folder": "{{user `folder`}}",
"host": "{{user `host`}}",
"cluster": "{{user `cluster`}}",

"convert_to_template": "true",


"network_adapters": [
{
"network": "{{user `network`}}",
"network_card": "vmxnet3"
}
],

"boot_order": "disk,cdrom",

"guest_os_type": "ubuntu64Guest",

"ssh_username": "{{user `ssh-username`}}",
"ssh_password": "{{user `ssh-password`}}",

"CPUs": "{{user `vm-cpu-num`}}",
"RAM": "{{user `vm-mem-size`}}",
"RAM_reserve_all": true,

"disk_controller_type": "pvscsi",
"storage": [
{
"disk_size": "{{user `vm-disk-size`}}",
"disk_thin_provisioned": false
}
],

"iso_urls": "{{user `iso-url`}}",
"iso_checksum": "{{user `iso-checksum-type`}}:{{user `iso-checksum`}}",

"floppy_files": ["./preseed.cfg"],
"boot_command": [
"<enter><wait><f6><wait><esc><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/install/vmlinuz",
" initrd=/install/initrd.gz",
" priority=critical",
" locale=en_US",
" file=/media/preseed.cfg",
"<enter>"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo rm /etc/machine-id",
"sudo touch /etc/machine-id",
"echo 'Packer Template Build -- Complete'"
]
}
]
}
24 changes: 24 additions & 0 deletions packer-vsphere-iso-linux/Ubuntu-16.04/variables-json.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"vm-name": "Ubuntu-1604-Template",

"vcenter-server":"192.168.x.x",
"vcenter-username":"[email protected]",
"vcenter-password": "xxxxx",

"datacenter": "Datacenter",
"datastore": "Datastore2_NonSSD",
"folder": "Templates",
"cluster": "Cluster01",
"network": "VM Network",

"vm-cpu-num": "1",
"vm-mem-size": "1024",
"vm-disk-size": "10240",

"ssh-username": "username",
"ssh-password": "xxxx",

"iso-url": "http://releases.ubuntu.com/16.04/ubuntu-16.04.7-server-amd64.iso",
"iso-checksum": "b23488689e16cad7a269eb2d3a3bf725d3457ee6b0868e00c8762d3816e25848",
"iso-checksum-type": "sha256"
}
2 changes: 1 addition & 1 deletion packer-vsphere-iso-linux/Ubuntu-18.04/variables-json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vm-disk-size": "10240",

"ssh-username": "username",
"ssh-password": "pass",
"ssh-password": "xxxx",

"iso-url": "http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.5-server-amd64.iso",
"iso-checksum": "8c5fc24894394035402f66f3824beb7234b757dd2b5531379cb310cedfdf0996",
Expand Down

0 comments on commit eb06ab4

Please sign in to comment.