4 Commits

Author SHA1 Message Date
73ec424030 Configure 'needrestart' package
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-10 15:01:03 +02:00
154835d33e Update cloudinit network config
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-24 15:27:58 +02:00
2c57dbcddc Fix boot kernel command;Rename files&folders
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-22 11:40:25 +02:00
0f01e803f2 First attempt at 22.04
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-22 11:20:14 +02:00
7 changed files with 29 additions and 15 deletions

View File

@ -18,17 +18,17 @@ steps:
- packer --version
- ansible --version
- ovftool --version
- name: Ubuntu Server 20.04
- name: Ubuntu Server 22.04
image: bv11-cr01.bessems.eu/library/packer-extended
pull: always
commands:
- |
sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \
packer/preseed/UbuntuServer20.04/user-data
packer/preseed/UbuntuServer22.04/user-data
- |
yamllint -d "{extends: relaxed, rules: {line-length: disable}}" \
ansible \
packer/preseed/UbuntuServer20.04/user-data \
packer/preseed/UbuntuServer22.04/user-data \
scripts
- |
packer init -upgrade \
@ -36,7 +36,7 @@ steps:
- |
packer validate \
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
-var vm_guestos=ubuntuserver20.04 \
-var vm_guestos=ubuntuserver22.04 \
-var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \
@ -46,7 +46,7 @@ steps:
packer build \
-on-error=cleanup -timestamp-ui \
-var vm_name=$DRONE_BUILD_NUMBER-${DRONE_COMMIT_SHA:0:10} \
-var vm_guestos=ubuntuserver20.04 \
-var vm_guestos=ubuntuserver22.04 \
-var repo_username=$${REPO_USERNAME} \
-var repo_password=$${REPO_PASSWORD} \
-var vsphere_password=$${VSPHERE_PASSWORD} \

View File

@ -1 +1 @@
# Packer.Images [![Build Status](https://ci.spamasaurus.com/api/badges/djpbessems/Packer.Images/status.svg?ref=refs/heads/Windows10)](https://ci.spamasaurus.com/djpbessems/Packer.Images)
# Packer.Images [![Build Status](https://ci.spamasaurus.com/api/badges/djpbessems/Packer.Images/status.svg?ref=refs/heads/UbuntuServer22.04)](https://ci.spamasaurus.com/djpbessems/Packer.Images)

View File

@ -1,14 +1,27 @@
- name: Configure 'needrestart' package
ansible.builtin.lineinfile:
path: /etc/needrestart/needrestart.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
loop:
- regexp: "^#\\$nrconf\\{restart\\} = 'i';"
line: "$nrconf{restart} = 'a';"
- regexp: "^#\\$nrconf\\{kernelhints\\} = -1;"
line: "$nrconf{kernelhints} = -1;"
- name: Install additional packages
ansible.builtin.apt:
name: "{{ item }}"
state: latest
update_cache: yes
loop: "{{ packages }}"
- name: Upgrade all packages
ansible.builtin.apt:
name: "*"
state: latest
update_cache: yes
- name: Cleanup
ansible.builtin.apt:
autoremove: yes

View File

@ -1,4 +1,4 @@
iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2020.04/ubuntu-20.04.4-live-server-amd64.iso"
iso_checksum = "sha256:28CCDB56450E643BAD03BB7BCF7507CE3D8D90E8BF09E38F6BD9AC298A98EAAD"
iso_url = "sn.itch.fyi/Repository/iso/Canonical/Ubuntu%20Server%2022.04/ubuntu-22.04-live-server-amd64.iso"
iso_checksum = "sha256:84AEAF7823C8C61BAA0AE862D0A06B03409394800000B3235854A6B38EB4856F"
// 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,6 +11,7 @@ autoinstall:
ethernets:
ens192:
dhcp4: true
dhcp-identifier: mac
storage:
layout:
name: direct

View File

@ -20,9 +20,9 @@ source "vsphere-iso" "ubuntuserver" {
boot_order = "disk,cdrom"
boot_command = [
"<enter><wait2><enter><wait><f6><esc><wait>",
" autoinstall<wait2> ds=nocloud;",
"<wait><enter>"
"e<down><down><down><end>",
" autoinstall ds=nocloud;",
"<F10>"
]
boot_wait = "2s"
@ -48,8 +48,8 @@ source "vsphere-iso" "ubuntuserver" {
usb_controller = ["xhci"]
cd_files = [
"packer/preseed/UbuntuServer20.04/user-data",
"packer/preseed/UbuntuServer20.04/meta-data"
"packer/preseed/UbuntuServer22.04/user-data",
"packer/preseed/UbuntuServer22.04/meta-data"
]
cd_label = "cidata"
iso_url = local.iso_authenticatedurl
@ -94,7 +94,7 @@ build {
" -ManifestFileName '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.mf'",
"ovftool --acceptAllEulas --allowExtraConfig --overwrite \\",
" '/scratch/ubuntuserver/${var.vm_guestos}-${var.vm_name}.ovf' \\",
" /output/Ubuntu-Server-20.04.ova"
" /output/Ubuntu-Server-22.04.ova"
]
}
}
}