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
/
broker-plugins-accounts.sh
53 lines (43 loc) · 1.83 KB
/
broker-plugins-accounts.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
#!/bin/bash
# Setup dhcp client and hostname
# setup variables
source ./oo-install.conf
# install software
# rubygem-psych requirement might go away
if [ "$DISTRO" == "fedora18" ] ; then
yum -y install rubygem-mocha rubygem-mongoid ruby-devel
else
yum -y install rubygem-psych rubygem-mocha rubygem-mongoid
fi
# Create config files from examples
cp /usr/share/gems/gems/openshift-origin-auth-remote-user-*/conf/openshift-origin- auth-remote-user.conf.example /etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf
cp /etc/openshift/plugins.d/openshift-origin-msg-broker-mcollective.conf.example /etc/openshift/plugins.d/openshift-origin-msg-broker-mcollective.conf
# Config the DNS profile
cd /var/named/
KEY="$(grep Key: K${DOMAIN}*.private | cut -d ' ' -f 2)"
cat <<EOF > /etc/openshift/plugins.d/openshift-origin-dns-bind.conf
BIND_SERVER="127.0.0.1"
BIND_PORT=53
BIND_KEYNAME="${DOMAIN}"
BIND_KEYVALUE="${KEY}"
BIND_ZONE="${DOMAIN}"
EOF
# Configure authentication plugin and add a user
cp -v /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user-basic.conf.sample /var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf
htpasswd -c -b -s /etc/openshift/htpasswd $OPENSHIFT_USER1 $OPENSHIFT_PASSWORD1
# Add Mongodb account
grep MONGO /etc/openshift/broker.conf
mongo openshift_broker_dev --eval 'db.addUser("$MONGODB_BROKER_USER", "$MONGODB_BROKER_PASSWORD")'
# Bundle broker gems
cd /var/www/openshift/broker
if [ "$DISTRO" == "fedora18" ] ; then
gem install psych
sed -i -e "s/gem 'minitest', '3.2.0'/gem 'minitest'/" Gemfile
fi
bundle --local
# Setup and start service
/usr/bin/systemctl enable httpd.service
/usr/bin/systemctl enable openshift-broker.service
/usr/bin/systemctl start httpd.service
/usr/bin/systemctl start openshift-broker.service
/usr/bin/systemctl status openshift-broker.service