Unattended Install of a FreeIPA Server

As a developer, I install and uninstall the application I’m working on all the time. Back when I was working on FreeIPA full time, I had a couple of functions that I used to do an unattended install with some simple defaults. I recently cleaned them up a little. Since a few people have asked me for them, I’m posting them here.

I have another set of bash functions that manages my set of developer machines. One of the sets the $DEVSERVER variable in my environment.

#The Kerberos REALM generated by this is the domain segment of the
#fully qualified domain name (FQDN) converted to uppercase.    
#If you were running it on local host, you could use `hostname -d` 
#but that doesn't work for a remote system.
    IPAREALM=$( echo $DEVSERVER  | cut -f2- -d. |tr '[:lower:]' '[:upper:]' )
    echo $IPAREALM

#The forwarder for DNS can be defined as the existing set of
#nameservers from /etc/resolv.conf.
     ssh $DEVSERVER " cat /etc/resolv.conf" | awk '/nameserver/ {print $2}'

    echo  ipa-server-install  -U -r $(ipa-gen-realm) -p FreeIPA4All \
          -a FreeIPA4All --setup-dns --forwarder $( ipa-gen-resolver)

One thought on “Unattended Install of a FreeIPA Server

Leave a Reply

Your email address will not be published. Required fields are marked *