I've got 50+ machines running either CentOS 6.4 or 6.8. I wish to re-install these machines with CentOS 7 using a configuration script (for example using the "basic server" template and setting hostname/static IP based on hardware ID), using installation media sitting on a public NFS and/or CIFS share on my local network. Later on, I intend to remote control these machines with Ansible, so I would want to run a post-installation script as well.
How can I remotely (via SSH) trigger this re-installation?
Based on Iain's answer and doing some googling, here's how to perform this kind of installation from CentOS 7:
Download vmlinuz and initrd.img into boot:
sudo curl -o /boot/vmlinuz http://mirror.zetup.net/CentOS/7/os/x86_64/isolinux/vmlinuz
sudo curl -o /boot/initrd.img http://mirror.zetup.net/CentOS/7/os/x86_64/isolinux/initrd.img
Add a custom menu entry into /etc/grub.d/40_custom
:
menuentry "My custom boot entry" {
set root=(hd0,1)
linux /vmlinuz ks=http://my-server/ks.cfg
initrd /initrd.img
}
Add any additional options on the linux
line above.
Make the custom entry the default choice in /etc/default/grub
:
GRUB_DEFAULT="My custom boot entry"
Then run:
grub2-mkconfig --output=/boot/grub2/grub.cfg
Grab a cup of coffe and reboot:
reboot