pre_fabric

by dubenstein
8 deployments · 2 still active · last rev. 5 years ago

Prepare Ubuntu 11.04 for fabric deployment procedure.

Compatible with: No distros currently supported
Includes: lib-system-ubuntu
						#!/bin/bash
# <UDF name="user_name" label="God name" />
# <UDF name="user_password" label="God password" />
# <UDF name="user_sshkey" label="Public Key for God" default="" />
# <UDF name="sshd_permitrootlogin" label="Shall we permit ssh root login?" oneof="No,Yes" default="No" />
# <UDF name="sshd_passwordauth" label="Shall we use ssh password authentication?" oneOf="Yes,No" default="Yes"/>
# <UDF name="sys_hostname" Label="Desired hostname" default="myvps" />

USER_GROUPS=gods

apt-get -y update
apt-get -y install git wget
groupadd -r gods
echo "%gods ALL = NOPASSWD: ALL" > /etc/sudoers.d/gods
chmod 0440 /etc/sudoers.d/gods

source <ssinclude StackScriptID="123"> # lib-system-ubuntu
system_update_locale_en_US_UTF_8
system_update_hostname "$SYS_HOSTNAME"

system_add_user "$USER_NAME" "$USER_PASSWORD" "$USER_GROUPS"
if [ "$USER_SSHKEY" ]; then
    system_user_add_ssh_key "$USER_NAME" "$USER_SSHKEY"
fi

system_sshd_permitrootlogin "$SSHD_PERMITROOTLOGIN"
system_sshd_passwordauthentication "$SSHD_PASSWORDAUTH"
system_sshd_pubkeyauthentication "yes"
service ssh restart
usermod -a -G "$USER_NAME" gods