= Default CentOS 7 host provisioning {{{ #!sh ## 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 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 }}} == Docker storage configuration: [http://www.projectatomic.io/blog/2015/06/notes-on-fedora-centos-and-docker-storage-drivers/ 1] [https://access.redhat.com/articles/1492923 2] [https://forums.docker.com/t/docker-storage-config-on-centos-7-1/3164 3] == Install Packer & recursive_packer_build {{{ #!sh ## Packer sudo mkdir -p /opt/Packer/0.8.6/ && cd /opt/Packer/0.8.6/ && sudo curl -O 'https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip' && sudo unzip 'packer_0.8.6_linux_amd64.zip' && printf '%s\n' '#!/bin/sh -x' "pathmunge '/opt/Packer/0.8.6/'" | sudo tee '/etc/profile.d/Packer_PATH.sh' && sudo chmod +x '/etc/profile.d/Packer_PATH.sh' && ## recursive_packer_build cd /srv/ && git clone 'https://github.com/sanmai-NL/recursive_packer_build' && printf '%s\n' '#!/bin/sh -x' ". '/srv/recursive_packer_build/recursive_packer_build.sh'" | sudo tee '/etc/profile.d/recursive_packer_build_source.sh' && sudo chmod +x '/etc/profile.d/recursive_packer_build_source.sh' }}} == Install [wiki:collectd]