diff --git a/http_directory/anaconda-ks.cfg b/http_directory/anaconda-ks.cfg index 9685783..54ae328 100644 --- a/http_directory/anaconda-ks.cfg +++ b/http_directory/anaconda-ks.cfg @@ -41,17 +41,17 @@ logvol swap --name=lv_swap --vgname=VolGroup --grow --size=2016 --maxsize=2016 part /boot --fstype=ext4 --size=500 # Location of the package data -url --url http://mirrors.usinternet.com/centos/6.4/os/x86_64/ +url --url http://mirrors.usinternet.com/centos/6.5/os/x86_64/ repo --name=epel --baseurl=http://download.fedoraproject.org/pub/epel/6/x86_64/ -repo --name=updates --baseurl=http://mirrors.usinternet.com/centos/6.4/updates/x86_64/ +repo --name=updates --baseurl=http://mirrors.usinternet.com/centos/6.5/updates/x86_64/ %packages --nobase @core # For the virtualbox additions kernel-devel - kernel-headers - make + kernel-headers + make dkms bzip2 openssh-clients @@ -155,12 +155,12 @@ repo --name=updates --baseurl=http://mirrors.usinternet.com/centos/6.4/updates/x ####################################################### # Remove ruby build libs yum -y remove zlib-devel openssl-devel readline-devel - + # Cleanup other files we do not need yum -y groupremove "Dialup Networking Support" Editors "Printing Support" "Additional Development" "E-mail server" ####################################################### - # The system can now be packaged with + # The system can now be packaged with # `vagrant package VMNAME` ####################################################### echo 'You can now package this box with `vagrant package VMNAME`' @@ -172,4 +172,4 @@ repo --name=updates --baseurl=http://mirrors.usinternet.com/centos/6.4/updates/x %end -reboot \ No newline at end of file +reboot diff --git a/packer-virtualbox-centos-6_4-64.json b/packer-virtualbox-centos-6_4-64.json deleted file mode 100644 index 0bf767e..0000000 --- a/packer-virtualbox-centos-6_4-64.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "builders": [ - { - "boot_command": [ - "", - "linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/anaconda-ks.cfg" - ], - "boot_wait": "5s", - "disk_size": 40000, - "guest_os_type": "RedHat_64", - "headless": true, - "http_directory": "./http_directory", - "iso_checksum": "bb9af2aea1344597e11070abe6b1fcd3", - "iso_checksum_type": "md5", - "iso_url": "http://mirrors.usinternet.com/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-netinstall.iso", - "ssh_password": "vagrant", - "ssh_username": "root", - "ssh_wait_timeout": "20m", - "type": "virtualbox", - "vboxmanage": [ - ["modifyvm", "{{.Name}}", "--memory", "1024"], - ["modifyvm", "{{.Name}}", "--cpus", "2"] - ], - "vm_name": "packer-centos-6_4-64" - } - ], - "provisioners": [ - { - "type": "shell", - "script": "provisioners/install-virtualbox-guest-additions.sh" - }, - { - "type": "shell", - "script": "provisioners/clean-empty-space.sh" - } - ], - "post-processors": [ - { - "type": "vagrant", - "output": "centos-6_4-64_virtualbox.box" - } - ] -} diff --git a/packer-virtualbox-centos-6_5-64.json b/packer-virtualbox-centos-6_5-64.json new file mode 100644 index 0000000..80cc51c --- /dev/null +++ b/packer-virtualbox-centos-6_5-64.json @@ -0,0 +1,59 @@ +{ + "builders": [ + { + "boot_command": [ + "", + "linux ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/anaconda-ks.cfg" + ], + "boot_wait": "5s", + "disk_size": 40000, + "guest_os_type": "RedHat_64", + "headless": true, + "http_directory": "./http_directory", + "iso_checksum": "0d9dc37b5dd4befa1c440d2174e88a87", + "iso_checksum_type": "md5", + "iso_url": "http://mirror.its.sfu.ca/mirror/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso", + "ssh_password": "vagrant", + "ssh_username": "root", + "ssh_wait_timeout": "40m", + "shutdown_command": "echo 'packer' | sudo -S shutdown -P now", + "type": "virtualbox-iso", + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--memory", + "1024" + ], + [ + "modifyvm", + "{{.Name}}", + "--cpus", + "2" + ] + ], + "vm_name": "packer-centos-6_5-64" + } + ], + "post-processors": [ + { + "output": "centos-6_5-64_virtualbox.box", + "type": "vagrant" + } + ], + "provisioners": [ + { + "override": { + "virtualbox-iso": { + "scripts": [ + "provisioners/base-provision.sh", + "provisioners/install-virtualbox-guest-additions.sh", + "provisioners/clean-empty-space.sh" + ] + } + }, + "type": "shell" + } + ] +} + diff --git a/provisioners/base-provision.sh b/provisioners/base-provision.sh index 0f206d3..90ef601 100644 --- a/provisioners/base-provision.sh +++ b/provisioners/base-provision.sh @@ -1,36 +1,36 @@ #!/bin/bash -yum install -y make bzip2 openssh-clients nano htop wget automake gcc cpp glibc-devel glibc-headers \ -glibc-kernheaders glibc glibc-common libgcc zlib-devel openssl-devel readline-devel +yum install -y make bzip2 openssh-clients htop wget automake gcc cpp \ + glibc-devel glibc-headers glibc-kernheaders glibc glibc-common libgcc \ + zlib-devel openssl-devel readline-devel gcc-c++ patch readline \ + readline-devel zlib libyaml-devel libffi-devel \ + autoconf libtool bison + +####################################################### +# Fix sudo requiring tty under Vagrant +####################################################### +sed --in-place=".BAK" 's/Defaults\(.*\)requiretty/Defaults\1!requiretty/' /etc/sudoers ####################################################### # Build Ruby ####################################################### +echo "?? Building Ruby 1.9" # Keep it clean mkdir /tmp/ruby cd /tmp/ruby -# autoconf 2.60 is required to build ruby -wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz -tar -xzf autoconf-2.60.tar.gz -cd autoconf-2.60 -./configure --prefix=/usr && make && make install +# install yaml +wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz +tar xzvf yaml-0.1.4.tar.gz +cd yaml-0.1.4 && ./configure --prefix=/usr && make && make install cd /tmp/ruby -# build ruby-1.8.7-p358 -wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.bz2 -tar -xjf ruby-1.8.7-p358.tar.bz2 -cd ruby-1.8.7-p358 -autoconf +# build ruby-1.9.3-p484 +wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.bz2 +tar -xjf ruby-1.9.3-p484.tar.bz2 +cd ruby-1.9.3-p484 ./configure --prefix=/usr && make && make install -cd /tmp/ruby - -# install ruby-gems 1.8.10 -wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz -tar -xzf rubygems-1.8.10.tgz -cd rubygems-1.8.10 -/usr/bin/ruby setup.rb # clean up cd / @@ -39,11 +39,20 @@ rm -rf /tmp/ruby ####################################################### # Install Puppet ####################################################### +echo "?? Installing Puppet" gem install puppet --no-rdoc --no-ri # add the puppet group groupadd puppet + +####################################################### +# Install Chef +####################################################### +echo "?? Installing chef" +curl -L https://www.opscode.com/chef/install.sh | bash + + ####################################################### # Turn off un-needed services ####################################################### @@ -66,4 +75,4 @@ yum -y groupremove "Dialup Networking Support" Editors "Printing Support" "Addit yum clean all # Clean out all of the caching dirs -rm -rf /var/cache/* /usr/share/doc/* \ No newline at end of file +rm -rf /var/cache/* /usr/share/doc/*