## Install default packages
sudo yum update &&
## Add the official Docker yum repository to get access to the latest Docker versions
sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
## Add the Fedora Extra Packages for Enterprise Linux (EPEL) yum repository
## http://www.rackspace.com/knowledge_center/article/install-epel-and-additional-repositories-on-centos-and-red-hat
sudo yum makecache fast &&
sudo yum install 'epel-release' 'git' 'docker-engine' 'unzip' 'collectd' 'mailx' 'tmux' 'tree' 'htop' 'rsync'
## Create sysop users
sudo useradd 'sanmai' &&
sudo usermod -aG 'wheel' 'sanmai'
sudo useradd 'dietuyt' &&
sudo usermod -aG 'wheel' 'dietuyt'
sudo useradd 'wilelb' &&
sudo usermod -aG 'wheel' 'wilelb'
# TODO: why not let them set their own password, and only upload their SSH public key?
## Set passwords for the users: passwd <user>
sudo -e '/etc/ssh/sshd_config' &&
## Configure sshd in '/etc/ssh/sshd_config'
### No root login
# PermitRootLogin no
### No username/password login
# PasswordAuthentication no
#forward mail from root to sysops@clarin.eu
printf '%s\n' "root: sysops@clarin.eu" | sudo tee -a /etc/aliases &&
sudo newaliases &&
sudo service postfix restart
## Test the configuration
printf '%s\n' 'test' | mail -s "test message from $(hostname)" root
## Enable services
systemctl enable docker