- enable_passwordless_sudo: - exec_in: | sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers echo "$$user_name ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers - set_root_password: - exec_in: echo -n 'root:$$user_name' | chpasswd - install_vbox_guest_additions: - exec_in: echo "VirtualBox Guest Additions..." - exec_in: | wget --progress=bar:force http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso 2>&1 - exec_in: mkdir /media/VBoxGuestAdditions - exec_in: mount -o loop VBoxGuestAdditions_4.3.8.iso /media/VBoxGuestAdditions - exec_in: yes|sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run --nox11 || true 2>&1 - exec_in: rm -f VBoxGuestAdditions_4.3.8.iso - exec_in: umount /media/VBoxGuestAdditions - exec_in: rmdir /media/VBoxGuestAdditions - install_puppet: - exec_in: - write_in: - /etc/yum.repos.d/puppetlabs.repo - | [puppetlabs-dependencies] name=puppetlabdsdependencies baseurl=http://yum.puppetlabs.com/el/6/dependencies/\$basearch enabled=1 gpgcheck=0 [puppetlabs] name=puppetlabs baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch enabled=1 gpgcheck=0 - exec_in: echo "Installing puppet..." - exec_in: yum -y install puppet facter ruby-shadow 2>&1 - install_chef: - exec_in: curl -L https://www.opscode.com/chef/install.sh -k | bash - copy_insecure_sshkey: - exec_in: mkdir -pm 700 /home/$$user_name/.ssh/ - exec_in: | wget --progress=bar:force https://raw.github.com/mitchellh/vagrant/master/keys/vagrant -O /home/$$user_name/.ssh/id_rsa 2>&1 wget --progress=bar:force https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/$$user_name/.ssh/id_rsa.pub 2>&1 - exec_in: cp /home/$$user_name/.ssh/id_rsa.pub /home/$$user_name/.ssh/authorized_keys - exec_in: chmod 0600 /home/$$user_name/.ssh/* - config_ssh: - exec_in: echo "UseDNS no" >> /etc/ssh/sshd_config - write_in: - /home/$$user_name/.ssh/config - | Host * ForwardX11 no StrictHostKeyChecking no PasswordAuthentication no AddressFamily inet - exec_in: chmod 0600 /home/$$user_name/.ssh/config - exec_in: rsync -ah /home/$$user_name/.ssh/ /root/.ssh/ - exec_in: chown "$$user_name:$$user_name" -R /home/$$user_name - customize_motd: - exec_in: echo 'Welcome to your Vagrant-built virtual machine.' > /etc/motd - cleanup: - exec_in: rm -rf /tmp/* || true - exec_in: rm -rf /var/tmp/* || true - exec_in: echo "cleaning up dhcp leases" - exec_in: rm -f /etc/udev/rules.d/70-persistent-net.rules - nullify_freespace: - exec_in: | echo "Nullify freespace..." dd if=/dev/zero of=/bigemptyfile bs=1M 2>&1 >/dev/null || true rm -f /bigemptyfile