-
-
Save sbecker/1049862 to your computer and use it in GitHub Desktop.
Installing CentOS 5.5 & Puppet on Vagrant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
* Installing CentOS 5.5 & Puppet | |
** Notes | |
** Download install iso: http://mirrors.kernel.org/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-bin-DVD-1of2.iso | |
** Create a new VirtualBox machine | |
- Name: vagrant-centos | |
- Operating System: Linux | |
- Version: Red Hat | |
- Base Memory Size: 360 MB | |
- Create new hard disk | |
- Dynamically expanding storage | |
- 40 GB | |
- Disable Audio | |
- Disable USB | |
- Make sure network is set to NAT | |
- Attach the net install ISO to the CDROM | |
- Run it | |
** Run through install procedure | |
- (mode: linux text) | |
- Installation Method: HTTP | |
- Disable IPv6, leave IPv4 enabled with DHCP | |
- HTTP Setup: | |
- Web site name: mirrors.kernel.org | |
- CentOS directory: /centos/5.4/os/i386 | |
- Use text mode | |
- Initialize drive and erase data: yes | |
- Configure network: yes | |
- Set hostname to vagrant-centos | |
- Root password: vagrant | |
- Customize software installation: | |
- Unselect: | |
- Dial-up networking | |
- Editors | |
- Text-based internet | |
- Base | |
- Remove CDRom media | |
- Reboot | |
- Disable firewall | |
$ service iptables save | |
$ service iptables stop | |
$ chkconfig iptables off | |
$ service ip6tables save | |
$ service ip6tables stop | |
$ chkconfig ip6tables off | |
** Add stuff | |
- Upgrade Kernel | |
$ yum upgrade kernel | |
- useful | |
$ yum install curl ftp rsync sudo time wget which vixie-cron | |
- for building Virtualbox Additions | |
$ yum install gcc bzip2 make kernel-devel | |
** Remove stuff | |
$ yum erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts | |
** VirtualBox Additions | |
- Devices -> Install Guest Additions... | |
$ sudo mount -o ro -t iso9660 /dev/cdrom /mnt | |
$ sudo sh /mnt/VBoxLinuxAdditions.run | |
- Error about Xwindows install - should be okay (?) | |
** vagrant user | |
- groupadd admin | |
- useradd -G admin vagrant | |
- passwd vagrant | |
# choose "vagrant" as the password | |
# set up sudo permissions: | |
$ visudo | |
- Add the following lines at the bottom: | |
# Vagrant user should be able to sudo | |
%admin ALL=NOPASSWD: ALL | |
- Comment out the following line: | |
# Defaults requiretty # (otherwise ssh <command> doesn't work) | |
# Add the variable "PATH" to the "Defaults env_keep" list. | |
# (otherwise sudo cleans the path, and loses ruby, which ohai needs) | |
# (See http://stackoverflow.com/questions/257616) | |
# Add the /usr/sbin and /sbin to the path: | |
echo 'export PATH=$PATH:/usr/sbin:/sbin' >> ~vagrant/.bashrc | |
** Log out as root, log in as vagrant | |
** Install epel, elff, ius, pgdg (as vagrant user) | |
sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL | |
sudo rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm | |
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ELFF | |
sudo rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm | |
sudo rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY | |
# Install puppet | |
sudo yum -y install rubygems | |
sudo gem install puppet --no-ri --no-rdoc --version=2.6.4 # optionally specify version needed | |
# update everything | |
sudo yum -y update | |
** Add Vagrant's "insecure" public key | |
mkdir .ssh | |
chmod 755 .ssh | |
curl https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub > .ssh/authorized_keys | |
chmod 644 .ssh/authorized_keys | |
** Fiddle with MAC addres | |
- sudo /sbin/ifconfig | |
- write down MAC address of eth0 (eg. 08:00:27:AE:D9:11 ) | |
sudo yum clean headers packages dbcache expire-cache | |
- shut down vm | |
sudo shutdown -P now | |
** Export and package | |
Follow instructions on http://vagrantup.com/docs/base_boxes.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment