This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbroker-broker-app.sh
61 lines (51 loc) · 2.23 KB
/
broker-broker-app.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
#!/bin/bash
# Setup dhcp client and hostname
# setup variables
source ./oo-install.conf
# install software
yum -y install openshift-origin-broker openshift-origin-broker-util rubygem-openshift-origin-auth-remote-user rubygem-openshift-origin-msg-broker-mcollective rubygem-openshift-origin-dns-bind
# Modifying the broker proxy server name
sed -i -e "s/ServerName .*$/ServerName ${BROKERHOSTNAME}/" /etc/httpd/conf.d/000002_openshift_origin_broker_servername.conf
# Setup and start service
/usr/bin/systemctl enable httpd.service
/usr/bin/systemctl enable ntpd.service
/usr/bin/systemctl enable sshd.service
# Setup Firewall
firewall-cmd --add-service=ssh
firewall-cmd --add-service=http
firewall-cmd --add-service=https
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --list-all
# Generate access key
openssl genrsa -out /etc/openshift/server_priv.pem 2048
openssl rsa -in /etc/openshift/server_priv.pem -pubout > /etc/openshift/server_pub.pem
ssh-keygen -t rsa -b 2048 -f ~/.ssh/rsync_id_rsa -N ""
cp -v ~/.ssh/rsync_id_rsa* /etc/openshift/
# Setup selinux boolean variables and set file contexts
setsebool -P httpd_unified=on httpd_can_network_connect=on httpd_can_network_relay=on httpd_run_stickshift=on named_write_master_zones=on
fixfiles -R rubygem-passenger restore
fixfiles -R mod_passenger restore
restorecon -rv /var/run
restorecon -rv /usr/share/gems/gems/passenger-*
# Tweak broker config, if needed
#echo ""
#echo "Tweak broker config file"
#echo " Might not have to do anything but make sure you have the following lines"
#echo " CLOUD_DOMAIN=\"${DOMAIN}\""
#echo " VALID_GEAR_SIZES=\"small,medium\""
#read tempkey
#vi /etc/openshift/broker.conf
if grep -q "VALID_GEAR_SIZES=\"small,medium\"" /etc/openshift/broker.conf ; then
echo " VALID_GEAR_SIZES are correct"
else
echo " Fixing up VALID_GEAR_SIZES"
sed -i -e 's|VALID_GEAR_SIZES=.*$|VALID_GEAR_SIZES=\"small,medium\"|g' /etc/openshift/broker.conf
fi
if grep -q "CLOUD_DOMAIN=\"${DOMAIN}\"" /etc/openshift/broker.conf ; then
echo " CLOUD_DOMAIN is correct"
else
echo " Fixing up CLOUD_DOMAIN"
sed -i -e "s|CLOUD_DOMAIN=.*$|CLOUD_DOMAIN=\"${DOMAIN}\"|g" /etc/openshift/broker.conf
fi