Commit 2b9f5e0a authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

packer: add Debian 11

parent 75f5b38a
...@@ -29,6 +29,14 @@ ...@@ -29,6 +29,14 @@
- { name: "vm-bootstrap", size: "50", script: "scripts/vm-bootstrap.sh"} - { name: "vm-bootstrap", size: "50", script: "scripts/vm-bootstrap.sh"}
- { name: "vm-bootstrap", size: "25", script: "scripts/vm-bootstrap.sh"} - { name: "vm-bootstrap", size: "25", script: "scripts/vm-bootstrap.sh"}
- shell: PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' debian11.json >> log/debian11-{{ item.name }}.log
args:
creates: output-debian11-{{ item.size }}G-{{ item.name }}
with_items:
- { name: "vm-bootstrap", size: "200", script: "scripts/vm-bootstrap.sh"}
- { name: "vm-bootstrap", size: "50", script: "scripts/vm-bootstrap.sh"}
- { name: "vm-bootstrap", size: "25", script: "scripts/vm-bootstrap.sh"}
- shell: PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' ubuntu-18.04-server-amd64.json >> log/ubuntu-18.04-server-amd64-{{ item.name }}.log - shell: PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' ubuntu-18.04-server-amd64.json >> log/ubuntu-18.04-server-amd64-{{ item.name }}.log
args: args:
...@@ -86,6 +94,15 @@ ...@@ -86,6 +94,15 @@
- { name: "vm-bootstrap", size: "25"} - { name: "vm-bootstrap", size: "25"}
ignore_errors: True ignore_errors: True
- shell: gzip output-debian11-{{ item.size }}G-{{ item.name }}/packer-debian11-{{ item.size }}G-{{ item.name }}
args:
creates: output-debian11-{{ item.size }}G-{{ item.name }}/packer-debian11-{{ item.size }}G-{{ item.name }}.gz
with_items:
- { name: "vm-bootstrap", size: "200"}
- { name: "vm-bootstrap", size: "50"}
- { name: "vm-bootstrap", size: "25"}
ignore_errors: True
- shell: gzip output-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }} - shell: gzip output-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}
args: args:
creates: output-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}.gz creates: output-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}/packer-ubuntu-18.04-server-{{ item.size }}G-{{ item.name }}.gz
...@@ -138,6 +155,9 @@ ...@@ -138,6 +155,9 @@
- { name: "vm-bootstrap", size: "200", distro: "debian10"} - { name: "vm-bootstrap", size: "200", distro: "debian10"}
- { name: "vm-bootstrap", size: "50", distro: "debian10"} - { name: "vm-bootstrap", size: "50", distro: "debian10"}
- { name: "vm-bootstrap", size: "25", distro: "debian10"} - { name: "vm-bootstrap", size: "25", distro: "debian10"}
- { name: "vm-bootstrap", size: "200", distro: "debian11"}
- { name: "vm-bootstrap", size: "50", distro: "debian11"}
- { name: "vm-bootstrap", size: "25", distro: "debian11"}
- { name: "vm-bootstrap", size: "200", distro: "centos7"} - { name: "vm-bootstrap", size: "200", distro: "centos7"}
- { name: "vm-bootstrap", size: "50", distro: "centos7"} - { name: "vm-bootstrap", size: "50", distro: "centos7"}
- { name: "vm-bootstrap", size: "25", distro: "centos7"} - { name: "vm-bootstrap", size: "25", distro: "centos7"}
......
{
"builders": [
{
"accelerator": "kvm",
"boot_command": [
"<esc><wait><wait><wait><wait>",
"auto preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-debian11.cfg ",
"debian-installer=en_US.UTF-8 locale=en_US keymap=fr ",
"netcfg/get_hostname={{ .Name }} ",
"netcfg/get_domain={{ user `domain`}} ",
"fb=false debconf/frontend=noninteractive ",
"passwd/user-fullname={{user `user`}} ",
"passwd/user-password={{user `password`}} ",
"passwd/user-password-again={{user `password`}} ",
"passwd/username={{user `user`}} ",
"<enter>"
],
"boot_wait": "30s",
"disk_size": "{{ user `disk_size`}}000",
"format": "qcow2",
"headless": true,
"http_directory": "http",
"iso_checksum": "md5:b710c178eb434d79ce40ce703d30a5f0",
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.1.0-amd64-netinst.iso",
"name": "debian11-vm-bootstrap-{{ user `disk_size`}}G-{{ user `name`}}",
"shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -h now",
"ssh_password": "{{user `password`}}",
"ssh_timeout": "3600s",
"ssh_username": "{{user `user`}}",
"type": "qemu"
}
],
"provisioners": [
{
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts": [
"scripts/update.sh",
"scripts/packages.sh",
"scripts/network-debian.sh",
"scripts/cleanup.sh",
"scripts/vm-bootstrap.sh"
],
"type": "shell"
}
],
"variables": {
"disk_size": "100",
"domain": "",
"name": "image",
"password": "slapos",
"user": "slapos"
}
}
{
"builders": [
{
"accelerator": "kvm",
"boot_command": [
"<esc><wait><wait><wait><wait>",
"auto preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-debian11.cfg ",
"debian-installer=en_US.UTF-8 locale=en_US keymap=fr ",
"netcfg/get_hostname={{ .Name }} ",
"netcfg/get_domain={{ user `domain`}} ",
"fb=false debconf/frontend=noninteractive ",
"passwd/user-fullname={{user `user`}} ",
"passwd/user-password={{user `password`}} ",
"passwd/user-password-again={{user `password`}} ",
"passwd/username={{user `user`}} ",
"<enter>"
],
"boot_wait": "30s",
"disk_size": "{{ user `disk_size`}}000",
"format": "qcow2",
"headless": true,
"http_directory": "http",
"iso_checksum": "md5:b710c178eb434d79ce40ce703d30a5f0",
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.1.0-amd64-netinst.iso",
"name": "debian11-{{ user `disk_size`}}G-{{ user `name`}}",
"shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -h now",
"ssh_password": "{{user `password`}}",
"ssh_timeout": "3600s",
"ssh_username": "{{user `user`}}",
"type": "qemu"
}
],
"provisioners": [
{
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts": [
"scripts/update.sh",
"scripts/packages.sh",
"scripts/network-debian.sh",
"scripts/cleanup.sh",
"{{ user `custom_script` }}"
],
"type": "shell"
}
],
"variables": {
"custom_script": "scripts/empty.sh",
"disk_size": "100",
"domain": "",
"name": "image",
"password": "slapos",
"user": "slapos"
}
}
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select fr
d-i time/zone string Europe/Paris
d-i clock-setup/utc boolean true
d-i apt-setup/enable-source-repositories string false
#d-i apt-setup/use_mirror boolean true
d-i auto-install/enable string true
d-i base-installer/install-recommends string false
#d-i debconf/priority string critical
d-i finish-install/reboot_in_progress string note
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
d-i mirror/country string manual
d-i mirror/http/hostname string ftp.fr.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string regular
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/default_filesystem string ext4
d-i passwd/make-user string false
d-i passwd/root-login string false
### Package selection
tasksel tasksel/first multiselect standard, ssh-server
# Individual additional packages to install
# all the packages below are installed through tasksel "standard"
#d-i pkgsel/include string ssh aptitude bwm-ng ca-certificates dbus-user-session debian-goodies dnsutils eatmydata efibootmgr gdb git gnupg host htop iotop linux-cpupower linux-perf lm-sensors lsof man-db ndisc6 netcat-openbsd openssh-server python resolvconf rsync screen smartmontools socat strace sudo systemd-coredump vim wget
### Boot loader installation
# This is fairly safe to set, it makes grub install automatically to the MBR
# if no other operating system is detected on the machine.
d-i grub-installer/only_debian boolean true
# To install to the first device (assuming it is not a USB stick):
d-i grub-installer/bootdev string default
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment