3 # Used environment variables:
7 # - DirectoryManagerPassword
11 # - ProvisioningCIDR: If set, it adds the given CIDR to the provisioning
12 # interface (which is hardcoded to eth1)
16 if [ -f "~/freeipa-setup.env" ]; then
17 source ~/freeipa-setup.env
18 elif [ -f "/tmp/freeipa-setup.env" ]; then
19 source /tmp/freeipa-setup.env
22 if [ -n "$ProvisioningCIDR" ]; then
23 # Add address to provisioning network interface
24 ip link set dev eth1 up
25 ip addr add $ProvisioningCIDR dev eth1
29 echo "nameserver 8.8.8.8" >> /etc/resolv.conf
30 echo "nameserver 8.8.4.4" >> /etc/resolv.conf
32 yum -q -y remove openstack-dashboard
34 # Install the needed packages
35 yum -q install -y ipa-server ipa-server-dns epel-release rng-tools mod_nss git
36 yum -q install -y haveged
39 hostnamectl set-hostname --static $Hostname
41 echo $FreeIPAIP `hostname` | tee -a /etc/hosts
44 cat << EOF > freeipa-iptables-rules.txt
45 # Firewall configuration written by system-config-firewall
46 # Manual customization of this file is not recommended.
51 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
52 -A INPUT -p icmp -j ACCEPT
53 -A INPUT -i lo -j ACCEPT
54 -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
55 #TCP ports for FreeIPA
56 -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
57 -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
58 -A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT
59 -A INPUT -m state --state NEW -m tcp -p tcp --dport 636 -j ACCEPT
60 -A INPUT -m state --state NEW -m tcp -p tcp --dport 88 -j ACCEPT
61 -A INPUT -m state --state NEW -m tcp -p tcp --dport 464 -j ACCEPT
62 -A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
63 #UDP ports for FreeIPA
64 -A INPUT -m state --state NEW -m udp -p udp --dport 88 -j ACCEPT
65 -A INPUT -m state --state NEW -m udp -p udp --dport 464 -j ACCEPT
66 -A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
67 -A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
68 -A INPUT -j REJECT --reject-with icmp-host-prohibited
69 -A FORWARD -j REJECT --reject-with icmp-host-prohibited
73 iptables-restore < freeipa-iptables-rules.txt
75 # Entropy generation; otherwise, ipa-server-install will lag.
77 systemctl start haveged
79 # Remove conflicting httpd configuration
80 rm -f /etc/httpd/conf.d/ssl.conf
83 ipa-server-install -U -r `hostname -d|tr "[a-z]" "[A-Z]"` \
84 -p $DirectoryManagerPassword -a $AdminPassword \
85 --hostname `hostname -f`
88 echo $AdminPassword | kinit admin
93 if [ "$?" = '1' ]; then
97 # Create undercloud host
98 ipa host-add $UndercloudFQDN --password=$HostsSecret --force
100 # Create overcloud nodes and services
101 git clone https://github.com/JAORMX/freeipa-tripleo-incubator.git
102 cd freeipa-tripleo-incubator
103 python create_ipa_tripleo_host_setup.py -w $HostsSecret -d $(hostname -d) \
104 --controller-count 1 --compute-count 1