diff --git a/packer/centos7-katello-nightly-stable.json b/packer/centos7-katello-nightly-stable.json deleted file mode 100644 index a48c001d5..000000000 --- a/packer/centos7-katello-nightly-stable.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "variables": { - "user": "vagrant", - "password": "vagrant", - "packer_hostname": "centos7-katello-nightly-stable.example.com" - }, - - "builders": - [ - { - "name": "centos7-katello-nightly-stable", - "type": "qemu", - "format": "qcow2", - "accelerator": "kvm", - "headless": true, - "iso_url": "http://packages.oit.ncsu.edu/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2003.iso", - "iso_checksum_type": "sha256", - "iso_checksum": "659691c28a0e672558b003d223f83938f254b39875ee7559d1a4a14c79173193", - "ssh_username": "{{user `user`}}", - "ssh_password": "{{user `password`}}", - "ssh_wait_timeout": "20m", - "http_directory": "http", - "boot_wait": "2s", - "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", - "qemuargs": [ - [ "-m", "12G" ], - [ "-smp", "4" ] - ], - "boot_command": [ - " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" - ] - } - ], - - "provisioners": [ - { - "type": "shell", - "execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'", - "scripts": [ - "scripts/vagrant.sh", - "scripts/fix_hostname.sh" - ], - "environment_vars": [ "PACKER_HOSTNAME={{user `packer_hostname`}}" ] - - }, - { - "type": "ansible", - "playbook_file": "../playbooks/katello.yml", - "ansible_env_vars": [ "ANSIBLE_CONFIG=../ansible.cfg" ] - } - ], - - "post-processors": [ - { - "type": "vagrant", - "keep_input_artifact": false, - "output": "centos7-katello-nightly-stable.box" - } - ] -} diff --git a/packer/centos7-katello-devel-stable.json b/packer/centos9-katello-devel-stable.json similarity index 66% rename from packer/centos7-katello-devel-stable.json rename to packer/centos9-katello-devel-stable.json index e8e77f2ad..6cf916342 100644 --- a/packer/centos7-katello-devel-stable.json +++ b/packer/centos9-katello-devel-stable.json @@ -1,22 +1,23 @@ { "variables": { - "packer_hostname": "centos7-katello-devel-stable", + "packer_hostname": "centos9-katello-devel-stable", "password": "vagrant", "user": "vagrant", - "ansible_variables": "{}" + "ansible_variables": "{}", + "iso_name": "CentOS-Stream-9-latest-x86_64-boot.iso" }, "builders": [ { "accelerator": "kvm", "boot_command": [ - " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" + " console=tty20 inst.text inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" ], "boot_wait": "2s", "format": "qcow2", "headless": true, "http_directory": "http", - "iso_checksum": "sha256:07b94e6b1a0b0260b94c83d6bb76b26bf7a310dc78d7a9c7432809fb9bc6194a", - "iso_url": "http://packages.oit.ncsu.edu/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso", + "iso_checksum": "sha256:62318426d27ba4e255b509b033e78186ad0fb8b9007650fca73d226ceb2eda6f", + "iso_url": "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-boot.iso", "name": "{{ user `packer_hostname` }}.example.com", "qemuargs": [ [ @@ -26,6 +27,10 @@ [ "-smp", "4" + ], + [ + "-cpu", + "host" ] ], "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", @@ -58,7 +63,7 @@ "ansible_env_vars": [ "ANSIBLE_CONFIG=../ansible.cfg" ], - "extra_arguments": ["--extra-vars", "{{ user `ansible_variables` }}"], + "extra_arguments": ["--extra-vars", "katello_repositories_version=nightly foreman_repositories_version=nightly {{ user `ansible_variables` }}"], "playbook_file": "../playbooks/katello_devel.yml", "type": "ansible" } diff --git a/packer/http/ks.cfg b/packer/http/ks.cfg index 034b32254..68a4058f6 100644 --- a/packer/http/ks.cfg +++ b/packer/http/ks.cfg @@ -1,46 +1,60 @@ -install -cdrom +# Version=EL9 +# Partition clearing information +clearpart --all --initlabel +autopart --type=lvm +# Use network installation +url --url https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/ +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language lang en_US.UTF-8 -keyboard us -unsupported_hardware -network --bootproto=dhcp --device=eth0 --onboot=on --hostname=centos7-katello-devel-stable.example.com -rootpw vagrant +# Create vagrant user +user --name=vagrant --groups=wheel --password vagrant --plaintext +# Network information +network --bootproto=dhcp --device=enp0s3 --activate --hostname=centos9-katello-devel-stable.example.com firewall --disabled +# Set SELinux to permissive selinux --permissive -timezone UTC -unsupported_hardware -bootloader --location=mbr -text -skipx -zerombr -clearpart --all --initlabel -autopart -auth --enableshadow --passalgo=sha512 --kickstart +# Root password +rootpw vagrant +# Do not run the Setup Agent on first boot and agree to the EULA firstboot --disabled eula --agreed +# Do not configure the X Window System +cmdline +skipx +# System services services --enabled=NetworkManager,sshd +# System timezone +timezone UTC reboot -user --name=vagrant --plaintext --password vagrant --groups=vagrant,wheel -%packages --ignoremissing --excludedocs -@Base -@Core -openssh-clients +%packages --excludedocs sudo -openssl-devel -readline-devel -vim -wget curl +vim +openssl +kexec-tools +openssh-clients +openssl-devel %end -%post -yum update -y +# Disable kdump +%addon com_redhat_kdump --disable +%end -# sudo -yum install -y sudo +%post +exec < /dev/tty3 > /dev/tty3 +chvt 3 +echo +echo "################################" +echo "# Running Post Configuration #" +echo "################################" +( echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers -yum clean all +) 2>&1 | /usr/bin/tee /var/log/post_install.log +chvt 1 + %end