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_preference_limit = 0
default_ccache_name = KEYRING:persistent:%{uid}
[realms]
IPADOMAIN.EXAMPLE.COM = {
kdc = server01.ipadomain.example.com:88
master_kdc = server01.ipadomain.example.com:88
admin_server = server01.ipadomain.example.com:749
default_domain = ipadomain.example.com
auth_to_local = RULE:[1:$1@$0](^.*@AD_DOMAIN$)s/@AD_DOMAIN/@ad_domain/
auth_to_local = DEFAULT
pkinit_anchors = FILE:/etc/ipa/ca.crt
}
[domain_realm]
.ipadomain.example.com = IPADOMAIN.EXAMPLE.COM
ipadomain.example.com = IPADOMAIN.EXAMPLE.COM
[dbmodules]
IPADOMAIN.EXAMPLE.COM = {
db_library = ipadb.so
}
EOF
chvt 1
exec </dev/tty1> /dev/tty1
Comments
Post a Comment