Skip to content

Commit

Permalink
fix ubuntu cloud-init
Browse files Browse the repository at this point in the history
  • Loading branch information
goffinet committed Oct 19, 2024
1 parent a0d51f9 commit a60275b
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion almalinux9.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down
2 changes: 1 addition & 1 deletion centos9.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down
2 changes: 1 addition & 1 deletion fedora40.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down
2 changes: 1 addition & 1 deletion http/almalinux9-kickstart.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

#auth --enableshadow --passalgo=sha512
url --url="https://repo.almalinux.org/almalinux/9.4/BaseOS/x86_64/kickstart/"
Expand Down
2 changes: 1 addition & 1 deletion http/centos9-kickstart.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

#auth --enableshadow --passalgo=sha512
url --url="https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os"
Expand Down
2 changes: 1 addition & 1 deletion http/fedora40-kickstart.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

#auth --enableshadow --passalgo=sha512
url --url="https://fedora.cu.be/linux/releases/40/Server/x86_64/os"
Expand Down
4 changes: 1 addition & 3 deletions http/ubuntu2004/user-data
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z

#cloud-config
autoinstall:
version: 1
identity:
hostname: ubuntu2004
username: ubuntu
password: $6$rounds=4096$oqGACZg/okV0CL8w$SBDD9yaOZ0ZbafbgIfCTlykdTmsNd9glV3BCn9HF5kP0hpHbuiejIIMZYh1pVW/cyIJ3wKa0ONxLau11eOkGW0
password: $6$rounds=4096$RB1imJT3dgIVCpj9$RbbYc72V55bkyMGAxfXAR2gQPkosRty/oFGi/VFxOFJovFXtJiPY5mHyoRY7jdcupjJFgGDjihWiiAGrVQMEM/
user-data:
disable_root: false
keyboard:
Expand Down
4 changes: 1 addition & 3 deletions http/ubuntu2204/user-data
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z

#cloud-config
autoinstall:
version: 1
identity:
hostname: ubuntu2204
username: ubuntu
password: $6$rounds=4096$J/PIZ9pzOve4HYL.$N5.bBokrODtL/1UPW.A.gXy1MHYpVUgt7ZTy.JpgYOhqk8M0Bp9/ARHLWUNOpJGNnPqY9cdumUAdfg0fA0usO1
password: $6$rounds=4096$/ZvrBU0yYprTjiEc$Id6kNiUvkfs6cE3ZGI8O3UmhDYtNqbYkBD/i9Ja9PFN7C3e8kYRjglcpg9tEiLwzF6WP71TlGgx/Clx8WsOjG1
user-data:
disable_root: false
keyboard:
Expand Down
4 changes: 1 addition & 3 deletions http/ubuntu2404/user-data
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z

#cloud-config
autoinstall:
version: 1
identity:
hostname: ubuntu2404
username: ubuntu
password: $6$rounds=4096$RmxDdr3OZpOwbGAj$7zWC6sQxaKISAmRUW.yZvUony68V6D3rWixZ0MM/zzY6PuTCvTTSL.Gdy.TyVkeuY9tU4XKuPGMUPTBmvAMvp0
password: $6$rounds=4096$AiOPgkPIqQRxYp6s$L7kytEdB9KDgCgfo2V2Blh850ntHAPaS.YxoQgZMXIUbGwD8eWku94EtdHrcjhBwPrwkpaRhusFssYbuGQSD9/
user-data:
disable_root: false
keyboard:
Expand Down
2 changes: 1 addition & 1 deletion roles/build-packer-templates/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ debian:
ubuntu2004:
boot_command: '["<enter><enter><f6><esc><wait>", "<bs><bs><bs><bs>", "autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net;s=http://{% raw %}{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.config_file}{% endraw %}/ ", "--- <enter>"]'
ubuntu2204:
boot_command: '["c<wait>linux /casper/vmlinuz --- autoinstall {% raw %}ds="nocloud;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.name}${var.version}/${var.config_file}"{% endraw %}<enter><wait>", "initrd /casper/initrd<enter><wait>", "boot<enter><wait>"]'
boot_command: '["c<wait>linux /casper/vmlinuz --- autoinstall ds={% raw %}"nocloud;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.name}${var.version}/${var.config_file}\"{% endraw %}<enter><wait>", "initrd /casper/initrd<enter><wait>", "boot<enter><wait>"]'
ubuntu2404:
boot_command: '["<esc><esc><esc><esc>e<wait>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "<del><del><del><del><del><del><del><del>", "linux /casper/vmlinuz --- autoinstall ds=\"nocloud-net;seedfrom=http://{% raw %}{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.config_file}{% endraw %}/\"<enter><wait>", "initrd /casper/initrd<enter><wait>", "boot<enter>", "<enter><f10><wait>"]'
shell_provisioner: '["sudo apt-get update", "sudo apt-get -y install software-properties-common", "sudo apt-add-repository --yes --update ppa:ansible/ansible", "sudo apt update", "sudo apt -y install ansible"]'
Expand Down
2 changes: 1 addition & 1 deletion roles/build-packer-templates/templates/kickstart.cfg.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at {{ ansible_date_time.iso8601 }}
#Generated by packer-kvm/build-packer-templates.yaml

#auth --enableshadow --passalgo=sha512
url --url="{% if item.flavor == 'almalinux' %}{{ item.iso_url | regex_replace('isos', 'BaseOS') }}/kickstart/{% elif item.flavor == 'centos' or item.flavor == 'fedora' %}{{ item.iso_url | regex_replace('iso', 'os') }}{% endif %}"
Expand Down
2 changes: 1 addition & 1 deletion roles/build-packer-templates/templates/linux.pkr.hcl.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at {{ ansible_date_time.iso8601 }}
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down
2 changes: 0 additions & 2 deletions roles/build-packer-templates/templates/user-data.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#Generated by packer-kvm/build-packer-templates.yaml at {{ ansible_date_time.iso8601 }}

#cloud-config
autoinstall:
version: 1
Expand Down
2 changes: 1 addition & 1 deletion ubuntu2004.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down
4 changes: 2 additions & 2 deletions ubuntu2204.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down Expand Up @@ -62,7 +62,7 @@ variable "version" {

source "qemu" "ubuntu2204" {
accelerator = "kvm"
boot_command = ["c<wait>linux /casper/vmlinuz --- autoinstall ds=\"nocloud;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.name}${var.version}/${var.config_file}"<enter><wait>", "initrd /casper/initrd<enter><wait>", "boot<enter><wait>"]
boot_command = ["c<wait>linux /casper/vmlinuz --- autoinstall ds=\"nocloud;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/${var.name}${var.version}/${var.config_file}\"<enter><wait>", "initrd /casper/initrd<enter><wait>", "boot<enter><wait>"]
disk_cache = "none"
disk_compression = true
disk_discard = "unmap"
Expand Down
2 changes: 1 addition & 1 deletion ubuntu2404.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Generated by packer-kvm/build-packer-templates.yaml at 2024-10-19T13:47:07Z
#Generated by packer-kvm/build-packer-templates.yaml

variable "config_file" {
type = string
Expand Down

0 comments on commit a60275b

Please sign in to comment.