Skip to content

Instantly share code, notes, and snippets.

@dbishop
Forked from isa/README.md
Created February 11, 2014 21:56

Revisions

  1. Isa Goksu revised this gist Jan 18, 2013. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion definition.rb
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    :disk_size => '102400', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
    :os_type_id => 'RedHat_64',
    :iso_file => "rhel-server-6.3-x86_64-boot.iso",
    :iso_src => "http://pkg.its.yale.edu/iso/rhel-server-6.3-x86_64-boot.iso",
    :iso_src => "http://rhnproxy1.uvm.edu/pub/redhat/rhel6-x86_64/isos/rhel-server-6.3-x86_64-boot.iso",
    :iso_md5 => "793c3e3f2ba604fe3f220871345d0956",
    :iso_download_timeout => 1000,
    :boot_wait => "15", :boot_cmd_sequence => [ '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
    2 changes: 1 addition & 1 deletion ks.cfg
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    install
    url --url=http://pkg.its.yale.edu/redhat/6.3/x86_64/
    url --url=http://rhnproxy1.uvm.edu/pub/redhat/rhel6-x86_64/install/
    lang en_US.UTF-8
    keyboard us
    network --bootproto dhcp
  2. @filler filler revised this gist Jul 11, 2012. 1 changed file with 26 additions and 1 deletion.
    27 changes: 26 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,32 @@ Built successfully with `veewee 0.2.3`, `vagrant 1.0.3`, `Virtualbox 4.1.18`.
    ## Use this

    ```
    $ mkdir -p ~/Vagrant/veewee/ ; cd ~/Vagrant/veewee/
    $ git clone git://gist.github.com/3091190.git definitions/RHEL-6.3-x86_64`
    $ vagrant basebox build 'RHEL-6.3-x86_64'
    ```

    ## It works

    ```
    [vagrant@localhost ~]$ chef-solo --version
    Chef: 10.12.0
    [vagrant@localhost ~]$ puppet --version
    2.7.18
    [vagrant@localhost ~]$ cf-agent -V
    @@@
    @@@ cf-agent
    @ @@@ @ CFEngine Core 3.3.4
    @ @@@ @
    @ @@@ @
    @ @
    @@@
    @ @
    @ @
    @ @
    Copyright (C) CFEngine AS 2008-2012
    See Licensing at http://cfengine.com/3rdpartylicenses
    [vagrant@localhost ~]$
    ```
  3. @filler filler revised this gist Jul 11, 2012. 1 changed file with 21 additions and 2 deletions.
    23 changes: 21 additions & 2 deletions postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -21,18 +21,37 @@ EOM
    cat > /etc/yum.repos.d/cfengine.repo << EOM
    [cfengine]
    name=cfengine
    baseurl=http://cfengine.com/pub/yum/\$basearch
    baseurl=http://cfengine.com/pub/yum/
    enabled=0
    gpgcheck=0
    EOM

    cat > /etc/yum.repos.d/rhel.repo << EOM
    [rhel]
    name=rhel
    baseurl=http://pkg.its.yale.edu/redhat/6.3/\$basearch
    enabled=1
    gpgcheck=0
    EOM

    cat > /etc/yum.repos.d/yale.repo << EOM
    [yale]
    name=yale
    baseurl=http://pkg.its.yale.edu/yale/
    enabled=1
    gpgcheck=0
    EOM

    # puppet
    yum -y --enablerepo=epel,puppetlabs install puppet facter ruby-devel rubygems
    yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
    yum -y clean all

    # cfengine
    yum -y --enablerepo=cfengine install cfengine-community
    yum -y clean all

    # chef
    gem install --no-ri --no-rdoc chef

    # Installing vagrant keys
    @@ -57,4 +76,4 @@ dd if=/dev/zero of=/tmp/clean || rm /tmp/clean

    /sbin/chkconfig iptables off

    exit
    exit
  4. @filler filler revised this gist Jul 11, 2012. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,8 @@ Built successfully with `veewee 0.2.3`, `vagrant 1.0.3`, `Virtualbox 4.1.18`.

    ## Use this

    `mkdir -p ~/Vagrant/veewee/ ; cd ~/Vagrant/veewee/`
    `git clone git://gist.github.com/3091190.git definitions/RHEL-6.3-x86_64`
    `vagrant basebox build 'RHEL-6.3-x86_64'`
    ```
    $ mkdir -p ~/Vagrant/veewee/ ; cd ~/Vagrant/veewee/
    $ git clone git://gist.github.com/3091190.git definitions/RHEL-6.3-x86_64`
    $ vagrant basebox build 'RHEL-6.3-x86_64'
    ```
  5. @filler filler revised this gist Jul 11, 2012. 1 changed file with 8 additions and 6 deletions.
    14 changes: 8 additions & 6 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,14 +4,16 @@ These templates can be used to feed to veewee to spin up an el6 basebox for use

    There are some coded values in `definition.rb` and `ks.cfg` which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.

    Built successfully with `veewee 0.2.3`, `vagrant 1.0.3`, `Virtualbox 4.1.18` via:

    ```
    veewee vbox build 'RHEL-6.3-x86_64'
    ```
    Built successfully with `veewee 0.2.3`, `vagrant 1.0.3`, `Virtualbox 4.1.18`.

    ## Config Management

    * chef via gem install
    * puppet via puppetlabs repo
    * cfengine3 via cfengine repo
    * cfengine3 via cfengine repo

    ## Use this

    `mkdir -p ~/Vagrant/veewee/ ; cd ~/Vagrant/veewee/`
    `git clone git://gist.github.com/3091190.git definitions/RHEL-6.3-x86_64`
    `vagrant basebox build 'RHEL-6.3-x86_64'`
  6. @filler filler revised this gist Jul 11, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@

    These templates can be used to feed to veewee to spin up an el6 basebox for use with vagrant.

    There are some coded values in definition.rb and ks.cfg which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.
    There are some coded values in `definition.rb` and `ks.cfg` which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.

    Built successfully with veewee 0.2.3, vagrant 1.0.3, vbox 4.1.18 via:
    Built successfully with `veewee 0.2.3`, `vagrant 1.0.3`, `Virtualbox 4.1.18` via:

    ```
    veewee vbox build 'RHEL-6.3-x86_64'
  7. @filler filler created this gist Jul 11, 2012.
    17 changes: 17 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # RHEL 6.3 veewee templates for vagrant use

    These templates can be used to feed to veewee to spin up an el6 basebox for use with vagrant.

    There are some coded values in definition.rb and ks.cfg which point at Yale-ishness. Amend to point at local RHEL iso/yum repo.

    Built successfully with veewee 0.2.3, vagrant 1.0.3, vbox 4.1.18 via:

    ```
    veewee vbox build 'RHEL-6.3-x86_64'
    ```

    ## Config Management

    * chef via gem install
    * puppet via puppetlabs repo
    * cfengine3 via cfengine repo
    16 changes: 16 additions & 0 deletions definition.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    Veewee::Session.declare({
    :cpu_count => '1', :memory_size=> '512',
    :disk_size => '102400', :disk_format => 'VDI', :hostiocache => 'off', :ioapic => 'on', :pae => 'on',
    :os_type_id => 'RedHat_64',
    :iso_file => "rhel-server-6.3-x86_64-boot.iso",
    :iso_src => "http://pkg.its.yale.edu/iso/rhel-server-6.3-x86_64-boot.iso",
    :iso_md5 => "793c3e3f2ba604fe3f220871345d0956",
    :iso_download_timeout => 1000,
    :boot_wait => "15", :boot_cmd_sequence => [ '<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>' ],
    :kickstart_port => "7122", :kickstart_timeout => 10000, :kickstart_file => "ks.cfg",
    :ssh_login_timeout => "100", :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
    :ssh_host_port => "7222", :ssh_guest_port => "22",
    :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
    :shutdown_cmd => "/sbin/halt -h -p",
    :postinstall_files => [ "postinstall.sh"], :postinstall_timeout => 10000
    })
    45 changes: 45 additions & 0 deletions ks.cfg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    install
    url --url=http://pkg.its.yale.edu/redhat/6.3/x86_64/
    lang en_US.UTF-8
    keyboard us
    network --bootproto dhcp
    rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
    firewall --enabled --trust eth0 --ssh
    authconfig --enableshadow --enablemd5
    selinux --disabled
    timezone America/EST
    bootloader --location=mbr

    text
    skipx
    zerombr

    clearpart --all --initlabel
    autopart

    auth --useshadow --enablemd5
    firstboot --disabled
    reboot

    %packages
    #@ core
    kernel-devel
    gcc
    gcc-c++
    bzip2
    make
    zlib-devel
    openssl-devel
    readline-devel
    sqlite-devel

    -ipw2100-firmware
    -ipw2200-firmware
    -ivtv-firmware

    %post
    /usr/sbin/groupadd vagrant
    /usr/sbin/useradd vagrant -g vagrant -G wheel
    echo "vagrant"|passwd --stdin vagrant
    echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
    chmod 0440 /etc/sudoers.d/vagrant
    60 changes: 60 additions & 0 deletions postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    #http://chrisadams.me.uk/2010/05/10/setting-up-a-centos-base-box-for-development-and-testing-with-vagrant/

    date > /etc/vagrant_box_build_time

    cat > /etc/yum.repos.d/puppetlabs.repo << EOM
    [puppetlabs]
    name=puppetlabs
    baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch
    enabled=0
    gpgcheck=0
    EOM

    cat > /etc/yum.repos.d/epel.repo << EOM
    [epel]
    name=epel
    baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
    enabled=0
    gpgcheck=0
    EOM

    cat > /etc/yum.repos.d/cfengine.repo << EOM
    [cfengine]
    name=cfengine
    baseurl=http://cfengine.com/pub/yum/\$basearch
    enabled=0
    gpgcheck=0
    EOM

    yum -y --enablerepo=epel,puppetlabs install puppet facter ruby-devel rubygems
    yum -y erase wireless-tools gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts
    yum -y clean all

    yum -y --enablerepo=cfengine install cfengine-community
    yum -y clean all

    gem install --no-ri --no-rdoc chef

    # Installing vagrant keys
    mkdir /home/vagrant/.ssh
    chmod 700 /home/vagrant/.ssh
    cd /home/vagrant/.ssh
    wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
    chown -R vagrant /home/vagrant/.ssh

    # Installing the virtualbox guest additions
    VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
    cd /tmp
    wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
    mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
    sh /mnt/VBoxLinuxAdditions.run
    umount /mnt
    rm VBoxGuestAdditions_$VBOX_VERSION.iso

    sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers

    dd if=/dev/zero of=/tmp/clean || rm /tmp/clean

    /sbin/chkconfig iptables off

    exit