Posts

Showing posts with the label kickstart

Script to ask Network configuration via kickstart

%pre #!/bin/bash echo -n "Enter FQDN Hostname: " > /dev/tty1 read HOSTN echo -n "Enter IP Address:" > /dev/tty1 read IP echo -n "Enter the Netmask:" > /dev/tty1 read MASK echo -n "Enter Gateway:" > /dev/tty1 read GW echo -n "Enter Nameserver:" > /dev/tty1 read DNS echo "network --device eth0 --bootproto=static --ip=${IP} --netmask=${MASK} --gateway=${GW} --nameserver=${DNS} --hostname=${HOSTN}" > /tmp/network.txt %post --noroot #!/bin/bash # bring in hostname collected from %pre, then source it ###### cp -Rvf /etc/sysconfig/network /mnt/sysimage/etc/sysconfig/network cp -Rvf /etc/sysconfig/resolv.conf /mnt/sysimage/etc/resolv.conf # Set-up eth0 with hostname cp /etc/sysconfig/network-scripts/ifcfg-eth0  /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0 # force hostname change /mnt/sysimage/bin/hostname $HOSTNAME rhn-profile-sync

Kickstar script to join linux machine to FreeIPA

First create the host on IPA Server and provide one time password in this example the password is "secret" # Get the hostname to set as the host principal chvt 3 exec </dev/tty3> /dev/tty3 clear /bin/hostname > /tmp/hostname.txt # Run the client install script echo Installing IPA Client sleep 5 /usr/sbin/ipa-client-install --domain=ipdomain.example.com --enable-dns-updates --mkhomedir -w secret --realm=IPADOMAIN.EXAMPLE.COM --server=server01.ipdomain.example.com --unattended rm -f /etc/krb5.conf cat > /etc/krb5.conf << "EOF" includedir /var/lib/sss/pubconf/krb5.include.d/ [logging]  default = FILE:/var/log/krb5libs.log  kdc = FILE:/var/log/krb5kdc.log  admin_server = FILE:/var/log/kadmind.log [libdefaults]  default_realm = IPADOMAIN.EXAMPLE.COM  dns_lookup_realm = false  dns_lookup_kdc = true  rdns = false  ticket_lifetime = 24h  forwardable = yes  udp_preferen...