17 Commits

Author SHA1 Message Date
d29f7b3223 Update cloudinit network config
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-24 15:27:20 +02:00
bd82e13fc4 Remove baremetal logic
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-25 13:35:30 +02:00
2f902fa27c Rebase to newer ISO;Revert cloudinit config
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-25 13:21:30 +02:00
37ecd4a1b9 Update password
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-25 09:51:31 +02:00
8a8cb09984 Add cluster reference
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-25 09:21:05 +02:00
bc46b09708 Update hypervisor details
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-25 09:15:48 +02:00
d508b28213 Disable LVM
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-23 13:05:17 +02:00
03ed59680f Remove debugging steps
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-17 14:14:11 +02:00
40ade38c78 Fix typo
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-17 13:52:11 +02:00
c89edd3ee9 FIx paths for postprocessor
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-17 13:15:51 +02:00
e5880c222e Fix source names for only keys
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-17 11:35:48 +02:00
236db40016 Fix line continuators
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-17 11:23:57 +02:00
b340c777ba Create rawdisk image for baremetal provisioning
Some checks failed
continuous-integration/drone/push Build is failing
2021-06-17 11:21:22 +02:00
10624f8c90 Fix regex patterns 2021-06-15 11:11:56 +02:00
eca6ae515e Fix Ansible loop
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-14 17:08:42 +02:00
b6656c3d9c Fix SSH config;Housekeeping 2021-06-14 16:59:20 +02:00
82b8eeca4f Add jq package 2021-06-14 13:41:27 +02:00
8 changed files with 25 additions and 12 deletions

View File

@@ -16,8 +16,8 @@
line: "{{ item.line }}" line: "{{ item.line }}"
state: "{{ item.state }}" state: "{{ item.state }}"
loop: loop:
- { regex: '$#PasswordAuthentication', line: 'PasswordAuthentication no', state: ''} - { regex: '^#PasswordAuthentication', line: 'PasswordAuthentication no', state: present}
- { regex: '', line: 'PasswordAuthentication yes', state: absent} - { regex: '^PasswordAuthentication yes', line: 'PasswordAuthentication yes', state: absent}
- name: Delete 'ubuntu' user - name: Delete 'ubuntu' user
ansible.builtin.user: ansible.builtin.user:
name: ubuntu name: ubuntu

View File

@@ -1,4 +1,5 @@
packages: packages:
- jq
# (python3-*) Dependency for installation of Ansible # (python3-*) Dependency for installation of Ansible
- python3-pip - python3-pip
- python3-setuptools - python3-setuptools

View File

@@ -1,2 +1,4 @@
iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2020.04/ubuntu-20.04.2-live-server-amd64.iso" iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2020.04/ubuntu-20.04.4-live-server-amd64.iso"
iso_checksum = "sha256:D1F2BF834BBE9BB43FAF16F9BE992A6F3935E65BE0EDECE1DEE2AA6EB1767423" iso_checksum = "sha256:28CCDB56450E643BAD03BB7BCF7507CE3D8D90E8BF09E38F6BD9AC298A98EAAD"
// iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2020.04/ubuntu-20.04.2-live-server-amd64.iso"
// iso_checksum = "sha256:D1F2BF834BBE9BB43FAF16F9BE992A6F3935E65BE0EDECE1DEE2AA6EB1767423"

View File

@@ -11,12 +11,14 @@ autoinstall:
ethernets: ethernets:
ens192: ens192:
dhcp4: true dhcp4: true
dhcp-identifier: mac
storage: storage:
layout: layout:
name: lvm name: direct
identity: identity:
hostname: packer-template hostname: packer-template
username: ubuntu username: ubuntu
# password: $6$ZThRyfmSMh9499ar$KSZus58U/l58Efci0tiJEqDKFCpoy.rv25JjGRv5.iL33AQLTY2aljumkGiDAiX6LsjzVsGTgH85Tx4S.aTfx0
password: $6$rounds=4096$ZKfzRoaQOtc$M.fhOsI0gbLnJcCONXz/YkPfSoefP4i2/PQgzi2xHEi2x9CUhush.3VmYKL0XVr5JhoYvnLfFwqwR/1YYEqZy/ password: $6$rounds=4096$ZKfzRoaQOtc$M.fhOsI0gbLnJcCONXz/YkPfSoefP4i2/PQgzi2xHEi2x9CUhush.3VmYKL0XVr5JhoYvnLfFwqwR/1YYEqZy/
ssh: ssh:
install-server: yes install-server: yes

View File

@@ -11,12 +11,13 @@ source "vsphere-iso" "ubuntuserver" {
vm_name = "${var.vm_guestos}-${var.vm_name}" vm_name = "${var.vm_guestos}-${var.vm_name}"
datacenter = var.vsphere_datacenter datacenter = var.vsphere_datacenter
cluster = var.vsphere_cluster
host = var.vsphere_host host = var.vsphere_host
folder = var.vsphere_folder folder = var.vsphere_folder
datastore = var.vsphere_datastore datastore = var.vsphere_datastore
guest_os_type = "ubuntu64Guest" guest_os_type = "ubuntu64Guest"
boot_order = "disk,cdrom" boot_order = "disk,cdrom"
boot_command = [ boot_command = [
"<enter><wait2><enter><wait><f6><esc><wait>", "<enter><wait2><enter><wait><f6><esc><wait>",
@@ -24,17 +25,17 @@ source "vsphere-iso" "ubuntuserver" {
"<wait><enter>" "<wait><enter>"
] ]
boot_wait = "2s" boot_wait = "2s"
communicator = "ssh" communicator = "ssh"
ssh_username = "ubuntu" ssh_username = "ubuntu"
ssh_password = var.ssh_password ssh_password = var.ssh_password
ssh_timeout = "20m" ssh_timeout = "20m"
ssh_handshake_attempts = "100" ssh_handshake_attempts = "100"
ssh_pty = true ssh_pty = true
CPUs = 2 CPUs = 2
RAM = 4096 RAM = 4096
network_adapters { network_adapters {
network = var.vsphere_network network = var.vsphere_network
network_card = "vmxnet3" network_card = "vmxnet3"
@@ -65,9 +66,13 @@ source "vsphere-iso" "ubuntuserver" {
} }
build { build {
sources = ["source.vsphere-iso.ubuntuserver"] sources = [
"source.vsphere-iso.ubuntuserver"
]
provisioner "ansible" { provisioner "ansible" {
only = ["vsphere-iso.ubuntuserver"]
playbook_file = "ansible/playbook.yml" playbook_file = "ansible/playbook.yml"
user = "ubuntu" user = "ubuntu"
ansible_env_vars = [ ansible_env_vars = [
@@ -80,6 +85,7 @@ build {
} }
post-processor "shell-local" { post-processor "shell-local" {
only = ["vsphere-iso.ubuntuserver"]
inline = [ inline = [
"pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\", "pwsh -command \"& scripts/Update-OvfConfiguration.ps1 \\",
" -OVFFile '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.ovf' \\", " -OVFFile '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.ovf' \\",

View File

@@ -6,6 +6,7 @@ variable "vsphere_password" {
variable "vsphere_host" {} variable "vsphere_host" {}
variable "vsphere_datacenter" {} variable "vsphere_datacenter" {}
variable "vsphere_cluster" {}
variable "vsphere_templatefolder" {} variable "vsphere_templatefolder" {}
variable "vsphere_folder" {} variable "vsphere_folder" {}

View File

@@ -1,8 +1,9 @@
vcenter_server = "bv11-vc.bessems.lan" vcenter_server = "bv11-vc.bessems.lan"
vsphere_username = "administrator@vsphere.local" vsphere_username = "administrator@vsphere.local"
vsphere_datacenter = "DeSchakel" vsphere_datacenter = "DeSchakel"
vsphere_cluster = "Cluster.Legacy"
vsphere_host = "bv11-esx.bessems.lan" vsphere_host = "bv11-esx.bessems.lan"
vsphere_datastore = "Datastore01.SSD" vsphere_datastore = "ESX00.SSD01"
vsphere_folder = "/Packer" vsphere_folder = "/Packer"
vsphere_templatefolder = "/Templates" vsphere_templatefolder = "/Templates"
vsphere_network = "LAN" vsphere_network = "LAN"

View File

@@ -38,7 +38,7 @@ PropertyCategories:
Configurations: '*' Configurations: '*'
UserConfigurable: true UserConfigurable: true
- Key: guestinfo.rootsshkey - Key: guestinfo.rootsshkey
Type: string(1..) Type: password(1..)
Label: Local root SSH public key* Label: Local root SSH public key*
Description: This line should start with 'ssh-rsa AAAAB3N' Description: This line should start with 'ssh-rsa AAAAB3N'
DefaultValue: '' DefaultValue: ''