Commit 021ba070 authored by Francois Le Corre's avatar Francois Le Corre

Add CentOS 8

parent 1e97cea2
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
- { 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 }}' centos-8.json >> log/centos8-{{ item.name }}.log - shell: PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' centos-8.json >> log/centos8-{{ item.name }}.log
# args: args:
# creates: output-centos8-{{ item.size }}G-{{ item.name }} creates: output-centos8-{{ item.size }}G-{{ item.name }}
# with_items: with_items:
# - { name: "vm-bootstrap", size: "200", script: "scripts/vm-bootstrap.sh"} - { name: "vm-bootstrap", size: "200", script: "scripts/vm-bootstrap.sh"}
# - { 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 }}' centos-7.json >> log/centos7-{{ item.name }}.log - shell: PATH=$PATH:/opt/packer/ packer build -var 'disk_size={{ item.size }}' -var 'name={{ item.name }}' -var 'custom_script={{ item.script }}' centos-7.json >> log/centos7-{{ item.name }}.log
args: args:
......
{
"variables": {
"user": "slapos",
"password": "slapos",
"domain": "",
"disk_size": "100",
"name": "image",
"custom_script": "scripts/empty.sh"
},
"builders":
[
{
"name": "centos8-{{ user `disk_size`}}G-{{ user `name`}}",
"type": "qemu",
"format": "qcow2",
"accelerator": "kvm",
"disk_size": "{{ user `disk_size`}}000",
"iso_url": "http://mirrors.ircam.fr/pub/CentOS/8.1.1911/isos/x86_64/CentOS-8.1.1911-x86_64-dvd1.iso",
"iso_checksum": "3ee3f4ea1538e026fff763e2b284a6f20b259d91d1ad5688f5783a67d279423b",
"iso_checksum_type": "sha256",
"http_directory": "http",
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"ssh_wait_timeout": "1800s",
"shutdown_command": "sudo poweroff",
"headless": true,
"boot_wait": "2s",
"boot_command": [
"<tab>",
"linux ks=http://{{.HTTPIP}}:{{.HTTPPort}}/centos7-anaconda-ks.cfg biosdevname=0 net.ifnames=0",
"<enter>",
"<wait>"
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts": [
"scripts/update-centos.sh",
"scripts/packages-centos.sh",
"scripts/cleanup-centos.sh",
"scripts/centos7-install-base.sh",
"{{ user `custom_script` }}"
]
}
]
}
install
text
reboot
url --mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
lang en_US.UTF-8
keyboard fr
timezone --utc Etc/UTC
rootpw --plaintext slapos
user --name=slapos --groups=slapos --password=slapos --plaintext
zerombr
clearpart --all --initlabel
autopart --type=plain
bootloader --timeout=1
%packages
@core
which
# mandatory packages in the @core group
-btrfs-progs
-iprutils
-kexec-tools
-plymouth
# default packages in the @core group
-*-firmware
-dracut-config-rescue
-kernel-tools
-libsysfs
-microcode_ctl
-NetworkManager*
-postfix
-rdma
%end
%post --erroronfail
yum -y update
cat <<EOF > /etc/sudoers.d/slapos
Defaults:slapos !requiretty
slapos ALL=(ALL) NOPASSWD: ALL
EOF
chmod 440 /etc/sudoers.d/slapos
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
EOF
%end
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