-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-dns.sh
65 lines (45 loc) · 2.11 KB
/
setup-dns.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# This is "DNS" Installation script
echo 'nameserver 8.8.8.8' | sudo tee --append /etc/resolv.conf
# Install packages
sudo yum install -y yum-utils bind bind-utils rpcbind nfs-server nfs-lock nfs-idmap git wget unzip zip
sudo yum -y install wget git net-tools bind-utils iptables-services bridge-utils pythonvirtualenv gcc bash-completion
sudo systemctl enable named
sudo systemctl start named
# Download (clone) openshift-aws from github
mkdir -p /home/ec2-user/aws-in-openshift
git clone https://github.com/prasenforu/openshift-aws.git /home/ec2-user/aws-in-openshift/
# Setting and configuring DNS
sudo cp /home/ec2-user/aws-in-openshift/cloudapps.cloud-cafe.in.db /var/named/dynamic/cloudapps.cloud-cafe.in.db
sudo cp /home/ec2-user/aws-in-openshift/cloud-cafe.in.db /var/named/dynamic/cloud-cafe.in.db
sudo rm /etc/named.conf
sudo cp /home/ec2-user/aws-in-openshift/named.conf /etc/named.conf
sudo chgrp named -R /var/named
sudo chown named -R /var/named/dynamic
sudo restorecon -R /var/named
sudo chown root:named /etc/named.conf
sudo restorecon /etc/named.conf
sudo systemctl status named
sudo systemctl restart named
sudo systemctl status named
# Setting Network for hostname change
echo 'preserve_hostname: true' | sudo tee --append /etc/cloud/cloud.cfg
sudo rm /etc/hostname
sudo touch /etc/hostname
echo 'ns1.cloud-cafe.in' | sudo tee --append /etc/hostname
echo 'HOSTNAME=ns1.cloud-cafe.in' | sudo tee --append /etc/sysconfig/network
# Setting passwordless login
echo 'StrictHostKeyChecking no' | sudo tee --append /etc/ssh/ssh_config
sudo ssh-keygen -f /root/.ssh/id_rsa -N ''
# Setting up yum repo for openshift
sudo cp /home/ec2-user/aws-in-openshift/open.repo /etc/yum.repos.d/open.repo
sudo yum clean all
sudo yum repolist
sudo yum -y update
# Install Docker and Docker-compose
sudo yum -y install docker
sudo systemctl enable docker
sudo systemctl start docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo cat /home/ec2-user/aws-in-openshift/hostfile >> /etc/hosts