Blame tests/p_ipa-server/2-configure_freeipa.sh
|
James Hogarth |
a5d690 |
#!/bin/bash
|
|
James Hogarth |
a5d690 |
# Author: James Hogarth <james.hogarth@gmail.com>
|
|
James Hogarth |
a5d690 |
#
|
|
James Hogarth |
abe41f |
if (t_GetPkgRel basesystem | grep -qE 'el(6|7)')
|
|
James Hogarth |
acc301 |
then
|
|
James Hogarth |
a5d690 |
|
|
James Hogarth |
af79cd |
t_Log "Running $0 - setting hostname of system"
|
|
James Hogarth |
af79cd |
hostname c6test.c6ipa.local
|
|
James Hogarth |
af79cd |
echo "$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) $(hostname)" >> /etc/hosts
|
|
James Hogarth |
af79cd |
hostname | grep "c6test.c6ipa.local" &> /dev/null
|
|
James Hogarth |
af79cd |
t_CheckExitStatus $?
|
|
James Hogarth |
af79cd |
|
|
James Hogarth |
af79cd |
|
|
Christoph Galuschka |
506131 |
t_Log "Running $0 - Configuring IPA server - this can take some time"
|
|
James Hogarth |
a5d690 |
|
|
James Hogarth |
b59b84 |
ipa-server-install -U --hostname=c6test.c6ipa.local --ip-address=$(ip a s dev eth0 | awk '$0 ~ /scope global eth0/ {print $2}' | cut -d'/' -f 1) -r C6IPA.LOCAL -n c6ipa.local -p p455w0rd -a p455w0rd --ssh-trust-dns --setup-dns --forwarder=$(awk '$0 ~ /nameserver/ {print $2}' /etc/resolv.conf | head -n 1)
|
|
James Hogarth |
a5d690 |
|
|
James Hogarth |
a5d690 |
t_CheckExitStatus $?
|
|
James Hogarth |
b59b84 |
|
|
James Hogarth |
b59b84 |
t_Log "Running $0 - Enabling mkhomedir"
|
|
James Hogarth |
0a8a3f |
authconfig --enablemkhomedir --enablesssd --update
|
|
James Hogarth |
0a8a3f |
t_CheckExitStatus $?
|
|
James Hogarth |
0a8a3f |
|
|
James Hogarth |
0a8a3f |
if /sbin/service sssd status | grep 'is stopped' &> /dev/null
|
|
James Hogarth |
0a8a3f |
then
|
|
James Hogarth |
0a8a3f |
/sbin/service sssd start &> /dev/null
|
|
James Hogarth |
0a8a3f |
fi
|
|
James Hogarth |
a5d690 |
|
|
James Hogarth |
acc301 |
else
|
|
James Hogarth |
acc301 |
echo "Skipped on CentOS 5"
|
|
James Hogarth |
acc301 |
fi
|
|
James Hogarth |
acc301 |
|