Skip to content

Commit

Permalink
Merge pull request #1339 from ramereth/centos-stream-8
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Feb 18, 2021
2 parents c79a9b7 + 3deb3e9 commit 6a1a2ed
Show file tree
Hide file tree
Showing 3 changed files with 253 additions and 0 deletions.
1 change: 1 addition & 0 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public:
- 'centos-6.10'
- 'centos-7.9'
- 'centos-8.3'
- 'centos-stream-8'
- 'debian-9.13-i386'
- 'debian-9.13'
- 'debian-10.8-i386'
Expand Down
176 changes: 176 additions & 0 deletions packer_templates/centos/centos-stream-8-x86_64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"builders": [
{
"boot_command": "{{ user `boot_command` }}",
"boot_wait": "5s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{user `disk_size`}}",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"guest_additions_url": "{{ user `guest_additions_url` }}",
"guest_os_type": "RedHat_64",
"hard_drive_interface": "sata",
"headless": "{{ user `headless` }}",
"http_directory": "{{user `http_directory`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-virtualbox",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "10000s",
"ssh_username": "vagrant",
"type": "virtualbox-iso",
"virtualbox_version_file": ".vbox_version",
"vm_name": "{{ user `template` }}"
},
{
"boot_command": "{{ user `boot_command` }}",
"boot_wait": "5s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{user `disk_size`}}",
"guest_os_type": "centos-64",
"headless": "{{ user `headless` }}",
"http_directory": "{{user `http_directory`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-vmware",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "10000s",
"ssh_username": "vagrant",
"tools_upload_flavor": "linux",
"type": "vmware-iso",
"vm_name": "{{ user `template` }}",
"vmx_data": {
"cpuid.coresPerSocket": "1"
},
"vmx_remove_ethernet_interfaces": true
},
{
"boot_command": "{{user `boot_command`}}",
"boot_wait": "5s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{user `disk_size`}}",
"guest_os_type": "centos",
"http_directory": "{{user `http_directory`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-parallels",
"parallels_tools_flavor": "lin",
"prlctl_version_file": ".prlctl_version",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "10000s",
"ssh_username": "vagrant",
"type": "parallels-iso",
"vm_name": "{{ user `template` }}"
},
{
"boot_command": [
"<wait5><up><wait5><tab> text ks=hd:fd0:/ks.cfg<enter><wait5><esc>"
],
"boot_wait": "5s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{user `disk_size`}}",
"floppy_files": [
"{{user `http_directory`}}/{{user `ks_path`}}"
],
"generation": "{{user `hyperv_generation`}}",
"guest_additions_mode": "disable",
"http_directory": "{{user `http_directory`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-hyperv",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "10000s",
"ssh_username": "vagrant",
"switch_name": "{{ user `hyperv_switch`}}",
"type": "hyperv-iso",
"vm_name": "{{ user `template` }}"
},
{
"boot_command": "{{ user `boot_command` }}",
"boot_wait": "5s",
"cpus": "{{ user `cpus` }}",
"disk_size": "{{user `disk_size`}}",
"headless": "{{ user `headless` }}",
"http_directory": "{{user `http_directory`}}",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
"memory": "{{ user `memory` }}",
"output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-qemu",
"shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_timeout": "10000s",
"ssh_username": "vagrant",
"type": "qemu",
"vm_name": "{{ user `template` }}"
}
],
"post-processors": [
{
"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
"type": "vagrant"
}
],
"provisioners": [
{
"environment_vars": [
"HOME_DIR=/home/vagrant",
"http_proxy={{user `http_proxy`}}",
"https_proxy={{user `https_proxy`}}",
"no_proxy={{user `no_proxy`}}"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
"expect_disconnect": true,
"scripts": [
"{{template_dir}}/scripts/update.sh",
"{{template_dir}}/../_common/motd.sh",
"{{template_dir}}/../_common/sshd.sh",
"{{template_dir}}/scripts/networking.sh",
"{{template_dir}}/../_common/vagrant.sh",
"{{template_dir}}/../_common/virtualbox.sh",
"{{template_dir}}/../_common/vmware.sh",
"{{template_dir}}/../_common/parallels.sh",
"{{template_dir}}/scripts/cleanup.sh",
"{{template_dir}}/../_common/minimize.sh"
],
"type": "shell"
}
],
"variables": {
"box_basename": "centos-stream-8",
"build_directory": "../../builds",
"build_timestamp": "{{isotime \"2019102650405\"}}",
"cpus": "2",
"disk_size": "65536",
"git_revision": "__unknown_git_revision__",
"guest_additions_url": "",
"headless": "",
"http_directory": "{{template_dir}}/http",
"http_proxy": "{{env `http_proxy`}}",
"https_proxy": "{{env `https_proxy`}}",
"hyperv_generation": "1",
"hyperv_switch": "bento",
"iso_checksum": "b693d501987d7d450e926696d48a98987b648f167a93b5c4dad2d843385f90d2",
"iso_name": "CentOS-Stream-8-x86_64-20210215-dvd1.iso",
"ks_path": "8-stream/ks.cfg",
"memory": "1024",
"mirror": "http://mirrors.kernel.org/centos",
"mirror_directory": "8-stream/isos/x86_64",
"name": "centos-stream-8",
"no_proxy": "{{env `no_proxy`}}",
"template": "centos-stream-8-x86_64",
"boot_command": "<up><wait><tab> inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `ks_path`}}<enter><wait>",
"version": "TIMESTAMP"
}
}
76 changes: 76 additions & 0 deletions packer_templates/centos/http/8-stream/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp --noipv6 --onboot=on --device=eth0
rootpw --plaintext vagrant
firewall --disabled
selinux --permissive
timezone UTC
bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0"
text
skipx
zerombr
clearpart --all --initlabel
autopart --nohome --nolvm --noboot
firstboot --disabled
reboot --eject
user --name=vagrant --plaintext --password vagrant

%packages --ignoremissing --excludedocs --instLangs=en_US.utf8
# vagrant needs this to copy initial files via scp
openssh-clients
sudo
selinux-policy-devel
wget
nfs-utils
net-tools
tar
bzip2
deltarpm
rsync
dnf-utils
redhat-lsb-core
elfutils-libelf-devel
network-scripts
-fprintd-pam
-intltool
-iwl*-firmware
-microcode_ctl
%end

%post
# sudo
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant
echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant
chmod 440 /etc/sudoers.d/vagrant

# Enable hyper-v daemons only if using hyper-v virtualization
if [ $(virt-what) == "hyperv" ]; then
dnf -y install hyperv-daemons cifs-utils
systemctl enable hypervvssd
systemctl enable hypervkvpd
fi

# Since we disable consistent network naming, we need to make sure the eth0
# configuration file is in place so it will come up.
# Delete other network configuration first because RHEL/C7 networking will not
# restart successfully if there are configuration files for devices that do not
# exist.
rm -f /etc/sysconfig/network-scripts/ifcfg-e*
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << _EOF_
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
DEVICE=eth0
ONBOOT=yes
_EOF_
%end

0 comments on commit 6a1a2ed

Please sign in to comment.