#cloud-config
bootcmd:
 - echo nameserver {nameserver} | tee /etc/resolv.conf
 - echo search {lab_domain} | tee -a /etc/resolv.conf
 - sed -ie 's/PEERDNS="yes"/PEERDNS="no"/' /etc/sysconfig/network-scripts/ifcfg-*
 - ( curl --silent http://169.254.169.254/2009-04-04/meta-data/hostname | sed -e 's/[\.-].*//' ; eval printf "%03d%03d%03d%03d.{lab_domain}" $(curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4 | tr . ' ' ) ) | tee /etc/hostname
 - hostname $(cat /etc/hostname)
 - yum install -y yum-utils && yum-config-manager --add-repo https://dl.fedoraproject.org/pub/epel/6/x86_64/ && yum install --nogpgcheck -y epel-release && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 && rm /etc/yum.repos.d/dl.fedoraproject.org*
 - ( echo ; echo "MaxSessions 1000" ) >> /etc/ssh/sshd_config
 - ( echo 'Defaults !requiretty' ; echo 'Defaults visiblepw' ) | tee /etc/sudoers.d/cephlab_sudo
preserve_hostname: true
system_info:
  default_user:
    name: {username}
packages:
 - python
 - wget
 - git
 - ntp
 - dracut-modules-growroot
runcmd:
 - mkinitrd --force /boot/initramfs-2.6.32-573.3.1.el6.x86_64.img 2.6.32-573.3.1.el6.x86_64
 - reboot
final_message: "{up}, after $UPTIME seconds"
