forked from crowbar/crowbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-prereqs
executable file
·61 lines (55 loc) · 1.86 KB
/
install-prereqs
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
#!/bin/bash
REDHAT_REPOS=("rpm http://rbel.frameos.org/rbel6"
"rpm http://mirrors.servercentral.net/fedora/epel/6/i386/epel-release-6-7.noarch.rpm"
"bare nginx http://nginx.org/packages/rhel/6/x86_64/")
UBUNTU_REPOS=("http://apt.opscode.com precise-0.10 main"
"http://ppa.launchpad.net/nginx/stable/ubuntu precise main")
mkdir -p /opt/dell
[[ -f /opt/dell/.prereq_installed ]] && exit 0
case $1 in
redhat*|centos-*)
reboot=false
if [[ ! -f /etc/modprobe.d/ipv6.conf ]] ; then
echo 'options ipv6 disable=1' >/etc/modprobe.d/ipv6.conf
echo "Need to disable IPv6."
reboot=true
fi
if ! (sestatus |grep -q disabled); then
echo 'SELINUX=disabled' >/etc/selinux/config
echo "Need to disable SELinux."
reboot=true
fi
if [[ $reboot = true ]]; then
echo "Please restart the system and then restart this install"
echo "The installation will fail otherwise"
exit 1
fi
mkdir -p /var/cache
for repo in "${REDHAT_REPOS[@]}"; do
r="${repo##* }"
t="${repo% *}"
case $t in
rpm) curl -o "/var/cache/${r##*/}" -L "$r"
rpm -Uvh "/var/cache/${r##*/}";;
bare) cat >>/etc/yum.repos.d/30-install-crowbar.repo <<EOF
[crowbar-install-${t#* }]
name=Crowbar install ${t#* } packages
baseurl=${r}
gpgcheck=0
EOF
;;
esac
done
yum -y install sudo ruby ruby-devel rubygems curl debootstrap;;
ubuntu-*)
for repo in "${UBUNTU_REPOS[@]}"; do
cat >>/etc/apt/sources.list.d/30-install-crowbar.list <<EOF
deb $repo
deb-src $repo
EOF
done
apt-get -y install ruby ruby-dev rubygems curl debootstrap rpm
;;
esac
gem install json
touch /opt/dell/.prereq_installed