Giter Site home page Giter Site logo

kickstart's Introduction

Kickstart files for creating CentOS machines in the cloud or in virtual environment

This script will setup your machine for rebooting into a kickstart automated install with VNC support.

Use the bash script below to Kickstart install CentOS.

To Use

Deploy a CentOS 7 linux machine via cloud image or VM template and copy script below making changes to inst.ks= and any other boot options as needed.

See this site for additional boot options and their descriptions https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-anaconda-boot-options

Note: that using vnc will cause the system to wait for a connection before continuing to load and run installer. Simply remove comment out vnc and text lines at the begining of the kickstart file if you have access to the console or wish to have it fully automated. It may take a long time for installation and before your system reboots into a usable state.

If DHCP is not available change ip=dhcp to something like ip=<ip>::<gateway>:<netmask>::<interface>:none

Bash Script

#!/bin/bash
# Make sure wget is installed
yum install wget -y

# Download linux installer ram images for booting into installer kernel
cd /boot
wget http://mirror.centos.org/centos/7/os/x86_64/isolinux/vmlinuz -O vmlinuz-7
wget http://mirror.centos.org/centos/7/os/x86_64/isolinux/initrd.img -O initrd-7.img

# Create grub menu entry
cat >> /etc/grub.d/40_custom <<EOF
menuentry 'NetInstall' {
  insmod gzio
  insmod part_msdos
  insmod ext2
  insmod xfs
  set root='hd0,msdos1'
  linux16 /vmlinuz-7 inst.ks=https://raw.githubusercontent.com/Stromweld/kickstart/master/azure_centos.ks ip=dhcp
  initrd16 /initrd-7.img
}
EOF

# Make sure we only boot into our custom menu entry once
sed -i 's/GRUB_DEFAULT=0/GRUB_DEFAULT=saved/g' /etc/default/grub

# Rebuild the grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg

# List available menu entry
awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

# boot our new menu entry for the next reboot. 
# We just need to use the menu entry title.
grub2-reboot NetInstall

# verify the default menu entry.
# you can use grub2-set-default 'MenuEntry' 
# to change the default boot
grub2-editenv list

# Reboot machine to start install
reboot

Disclaimer

I built this script based off of information gathered from http://www.danpros.com/2016/02/how-to-install-centos-7-remotely-using-vnc and https://www.andrewklau.com/roll-your-own-centos-6-5-hvm-ami-in-less-than-15-minutes/

For additional kickstart file options reference https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-kickstart-syntax#sect-kickstart-commands

kickstart's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.