3 # Used environment variables:
7 # - DirectoryManagerPassword
14 if [ -f "~/freeipa-setup.env" ]; then
15 source ~/freeipa-setup.env
19 echo "nameserver 8.8.8.8" >> /etc/resolv.conf
20 echo "nameserver 8.8.4.4" >> /etc/resolv.conf
22 yum -q -y remove openstack-dashboard
24 # Install the needed packages
25 yum -q install -y ipa-server ipa-server-dns epel-release rng-tools mod_nss
26 yum -q install -y haveged
29 hostnamectl set-hostname --static $Hostname
31 echo $FreeIPAIP `hostname` | tee -a /etc/hosts
34 cat << EOF > freeipa-iptables-rules.txt
35 # Firewall configuration written by system-config-firewall
36 # Manual customization of this file is not recommended.
41 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
42 -A INPUT -p icmp -j ACCEPT
43 -A INPUT -i lo -j ACCEPT
44 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
45 #TCP ports for FreeIPA
46 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
47 -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
48 -A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT
49 -A INPUT -m state --state NEW -m tcp -p tcp --dport 636 -j ACCEPT
50 -A INPUT -m state --state NEW -m tcp -p tcp --dport 88 -j ACCEPT
51 -A INPUT -m state --state NEW -m tcp -p tcp --dport 464 -j ACCEPT
52 -A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
53 #UDP ports for FreeIPA
54 -A INPUT -m state --state NEW -m udp -p udp --dport 88 -j ACCEPT
55 -A INPUT -m state --state NEW -m udp -p udp --dport 464 -j ACCEPT
56 -A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
57 -A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
58 -A INPUT -j REJECT --reject-with icmp-host-prohibited
59 -A FORWARD -j REJECT --reject-with icmp-host-prohibited
63 iptables-restore < freeipa-iptables-rules.txt
65 # Entropy generation; otherwise, ipa-server-install will lag.
67 systemctl start haveged
69 # Remove conflicting httpd configuration
70 rm -f /etc/httpd/conf.d/ssl.conf
73 ipa-server-install -U -r `hostname -d|tr "[a-z]" "[A-Z]"` \
74 -p $DirectoryManagerPassword -a $AdminPassword \
75 --hostname `hostname -f`
78 echo $AdminPassword | kinit admin
83 if [ "$?" = '1' ]; then
87 # Create undercloud host
88 ipa host-add $UndercloudFQDN --password=$HostsSecret --force
90 # Create overcloud nodes and services
91 git clone https://github.com/JAORMX/freeipa-tripleo-incubator.git
92 cd freeipa-tripleo-incubator
93 python create_ipa_tripleo_host_setup.py -w $HostsSecret -d $(hostname -d) \
94 --controller-count 1 --compute-count 1