RVM System Wide Install

by sutto
42 deployments · 8 still active · last rev. 9 years ago

Installs RVM on a system-wide basis and sets up a single administrator account (including sudo access).

Please allow a few minutes post-first-boot for it to set itself up.

Admin code is based off of https://www.linode.com/stackscripts/view/?StackScriptID=308

Compatible with: No distros currently supported
# <udf name="admin_login" label="Admin Login" />
# <udf name="admin_password" label="Admin Password" />
# <udf name="group_name" label="RVM Group name" default="rvm" />
source <ssinclude StackScriptID="1">

hostname `get_rdns_primary_ip`

aptitude -y install sudo
groupadd wheel
cp /etc/sudoers /etc/sudoers.tmp
chmod 0640 /etc/sudoers.tmp
echo "%wheel ALL = (ALL) ALL" >> /etc/sudoers.tmp
chmod 0440 /etc/sudoers.tmp
mv /etc/sudoers.tmp /etc/sudoers

useradd -m -s /bin/bash -G wheel "$ADMIN_LOGIN"
echo "${ADMIN_LOGIN}:${ADMIN_PASSWORD}" | chpasswd

export rvm_group_name="$GROUP_NAME"
aptitude -y install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev git-core
bash < <( curl -L http://bit.ly/rvm-install-system-wide )

usermod -a -G "$GROUP_NAME" "$ADMIN_LOGIN"