Skip to content

Instantly share code, notes, and snippets.

@ryancragun
Created March 24, 2014 17:18
Show Gist options
  • Save ryancragun/9744804 to your computer and use it in GitHub Desktop.
Save ryancragun/9744804 to your computer and use it in GitHub Desktop.
Amazon Linux RightLink install
#!/usr/bin/env sh
# import RightScale key
curl -Ss 'https://s3.amazonaws.com/rightscale_key_pub/rightscale_key.pub' > /etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
# add Epel repo
cat >/etc/yum.repos.d/Epel.repo<<-'EOF'
[epel-mirror]
name = Epel Mirror
baseurl = http://cf-mirror.rightscale.com/epel/6/$basearch/archive/latest/
failovermethod=priority
gpgcheck=1
enabled=1
priority=10
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
EOF
# add RightScale-epel repo
cat >/etc/yum.repos.d/RightScale-epel.repo<<-'EOF'
[rightscale-epel]
name=RightScale Software
baseurl=http://cf-mirror.rightscale.com/rightscale_software/epel/6/$basearch/archive/latest/
gpgcheck=1
enabled=1
priority=10
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
EOF
# add Rightlink-Beta repo
cat >/etc/yum.repos.d/RightLink-Beta.repo<<-'EOF'
[rightlink]
name=RightScale RightLink Beta
baseurl=https://rightlink-staging.s3.amazonaws.com/yum/1/el/6/$basearch/
enabled=1
gpgcheck=1
priority=10
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rightscale
EOF
# create lsb_release shim to mock CentOS
cat >/usr/local/sbin/lsb_release<<-'EOF'
#!/usr/bin/env ruby
case ARGV[0]
when '-is'
puts "CentOS"
when '-rs'
puts "rolling"
end
EOF
chmod +x /usr/local/sbin/lsb_release
# install RightLink
rightlink_rpms='/var/cache/yum/x86_64/latest/rightlink/packages/*.rpm'
yum install -y rightlink-cloud-ec2 || yum install -y libarchive && rpm -ivh --replacefiles "${rightlink_rpms}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment