Last active
August 29, 2015 14:00
-
-
Save timonwong/11129757 to your computer and use it in GitHub Desktop.
CentOS provision (EPEL, Gem chinese mirror, ansible, toolchain)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Change yum mirror | |
sed -i.backup 's/^enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf | |
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup | |
wget -O /etc/yum.repos.d/CentOS-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo | |
yum makecache | |
yum update | |
# Install ruby dependencies | |
yum -y install ruby rubygems ruby-devel | |
# Use taobao repo for ruby gems | |
gem sources -a http://ruby.taobao.org/ | |
# Remove origin repo from ruby gems | |
gem sources --remove http://rubygems.org/ | |
# Install fpm | |
gem install fpm | |
# Install EPEL repository | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm | |
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm | |
# Install ansible | |
yum -y install ansible | |
# Install build toolchain | |
yum -y groupinstall "Development tools" | |
yum -y install openssl-devel readline-devel bzip2-devel sqlite-devel zlib-devel ncurses-devel db4-devel expat-devel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment