2
2
set -x
3
3
4
4
source common.sh
5
+
6
+
5
7
: ${DNS_SERVER_1:= 1.1.1.1}
6
- : ${DNS_SERVER_2:= 8.8.8.8}
7
8
9
+ # run CoreDns container (host-net), Neutron upstream-dns will point to this server and CoreDns will point to external DNS server
10
+ sed -i " s/DNS_SERVER_1/$DNS_SERVER_1 /g" coredns_cfg/Corefile
11
+ sudo docker run -d -m 128m --restart=" unless-stopped" --net host --cap-add=NET_ADMIN -v " $PWD " /coredns_cfg:/etc/coredns --name coredns coredns/coredns:latest -conf /etc/coredns/Corefile
12
+
13
+
14
+ function verify_dns {
15
+
16
+ ips=($( dig +short -t srv _etcd-server-ssl._tcp.ostest.shiftstack.com. @" ${LOCAL_IP} " ) )
17
+ if [[ " $? " -eq 0 && " ${# ips[@]} " -ne 0 ]]; then
18
+ echo " DNS resolve SRV record _etcd-server-ssl._tcp.ostest.shiftstack.com. - Success"
19
+ else
20
+ return 1
21
+ fi
22
+
23
+ ips=($( dig +short google.com @" ${LOCAL_IP} " ) )
24
+ echo $ips
25
+ if [[ " $? " -eq 0 && " ${# ips[@]} " -ne 0 ]]; then
26
+ echo " DNS resolve google.com - success"
27
+ else
28
+ return 1
29
+ fi
30
+ return 0
31
+ }
32
+ set +x
33
+ if verify_dns; then
34
+ echo " Pre tripleo deployment - DNS is working!" ;
35
+ else
36
+ echo -e " Pre tripleo deployment -DNS can not resolve SRV record, google.com\\ nplease ***fix it*** (Docker service enabled? IPtables??)" ;
37
+ exit
38
+ fi
39
+ set -x
8
40
openstack tripleo container image prepare default \
9
41
--output-env-file $SCRIPTDIR /containers-prepare-parameters.yaml
10
42
@@ -19,11 +51,9 @@ parameter_defaults:
19
51
Debug: true
20
52
DeploymentUser: $USER
21
53
DnsServers:
22
- - $DNS_SERVER_1
23
- - $DNS_SERVER_2
54
+ - $LOCAL_IP
24
55
NeutronDhcpAgentDnsmasqDnsServers:
25
- - $DNS_SERVER_1
26
- - $DNS_SERVER_2
56
+ - $LOCAL_IP
27
57
# needed for vip & pacemaker
28
58
KernelIpNonLocalBind: 1
29
59
DockerInsecureRegistryAddress:
@@ -64,3 +94,13 @@ sudo openstack tripleo deploy \
64
94
sudo chown -R $USER :$USER ~ /.config/openstack
65
95
sed -i.bak ' s/cloud:/#cloud:/' ~ /.config/openstack/clouds.yaml
66
96
sed -i.bak ' 4i\ domain_name: default' ~ /.config/openstack/clouds.yaml
97
+
98
+ # Enable DNS port and verify that DNS still working after tripleo deployment
99
+ sudo iptables -I INPUT 2 -p udp --dport 53 -j ACCEPT
100
+ sudo iptables -I INPUT 3 -p udp --sport 53 -j ACCEPT
101
+ set +x
102
+ if verify_dns; then
103
+ echo " Post tripleo deployment - DNS is working!" ;
104
+ else
105
+ echo -e " Post tripleo deployment -DNS can not resolve SRV record, google.com (IPtables??)\\ nplease ****Fix it**** before running next step!" ;
106
+ fi
0 commit comments