Skip to content

Instantly share code, notes, and snippets.

@jcpowermac
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save jcpowermac/e8e72c1b6a551f75c5cf to your computer and use it in GitHub Desktop.

Select an option

Save jcpowermac/e8e72c1b6a551f75c5cf to your computer and use it in GitHub Desktop.

Revisions

  1. jcpowermac revised this gist Jun 11, 2014. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -181,10 +181,9 @@ vi /opt/hanlon/web/conf/hanlon_server.conf
    vi /opt/hanlon/cli/conf/hanlon_client.conf
    ```

    Change the trinidad start script "--addresss 192.168.109.5" to "--address 0.0.0.0", then run
    Execute the run-tri.sh script
    ```bash
    cd /opt/hanlon/script
    vi run-tri.sh
    ./run-tri.sh
    ```

  2. jcpowermac revised this gist Jun 11, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -221,6 +221,7 @@ diff -rupN org_ipxe/src/config/general.h ipxe/src/config/general.h
    //#define IMAGE_EFI /* EFI image support */
    //#define IMAGE_SDI /* SDI image support */
    //#define IMAGE_PNM /* PNM image support */
    EOF
    ```
    And finally patch.
    ```bash
  3. jcpowermac revised this gist Jun 11, 2014. 1 changed file with 29 additions and 0 deletions.
    29 changes: 29 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -201,6 +201,32 @@ And again run bundler
    bundle install
    ```

    If you have a requirement to install ESXi you will need to build iPXE with different configuration options, see https://github.com/csc/Hanlon/issues/46 for more details.

    ```bash
    git clone git://git.ipxe.org/ipxe.git
    ```
    Create the patch file...
    ```bash
    cat > image_comboot.patch << EOF
    diff -rupN org_ipxe/src/config/general.h ipxe/src/config/general.h
    --- org_ipxe/src/config/general.h 2014-06-11 08:07:39.193081793 -0400
    +++ ipxe/src/config/general.h 2014-06-10 15:15:30.628188405 -0400
    @@ -111,7 +111,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
    //#define IMAGE_PXE /* PXE image support */
    //#define IMAGE_SCRIPT /* iPXE script image support */
    //#define IMAGE_BZIMAGE /* Linux bzImage image support */
    -//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
    +#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
    //#define IMAGE_EFI /* EFI image support */
    //#define IMAGE_SDI /* SDI image support */
    //#define IMAGE_PNM /* PNM image support */
    ```
    And finally patch.
    ```bash
    patch -p0 < image_comboot.patch
    ```

    We will need the Hanlon microkernel to get started...

    ```bash
    @@ -262,6 +288,9 @@ Image Added:
    ```





    Create a model for a CentOS deployment...
    ```bash
    ./cli/hanlon model add -t centos_6 -l centos65-model -i K3v2suiIkSYNEdx1CTKqs
  4. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -141,7 +141,7 @@ subnet 192.168.66.0 netmask 255.255.255.0 {

    option hanlon_server 192.168.66.254;
    option hanlon_port 8026;
    option hanlon_base_uri "/hanlon/v1";
    option hanlon_base_uri "/hanlon/api/v1";

    if exists user-class and option user-class = "iPXE" {
    filename "hanlon.ipxe";
  5. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -140,7 +140,7 @@ subnet 192.168.66.0 netmask 255.255.255.0 {
    max-lease-time 7200;

    option hanlon_server 192.168.66.254;
    option hanlon_port 8036;
    option hanlon_port 8026;
    option hanlon_base_uri "/hanlon/v1";

    if exists user-class and option user-class = "iPXE" {
  6. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -237,7 +237,7 @@ Image Added:

    Create the hanlon ipxe script.
    ```bash
    ./cli/hanlon config > /tftpboot/hanlon.ipxe
    ./cli/hanlon config ipxe > /tftpboot/hanlon.ipxe
    ```
    Lets install CentOS

  7. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -235,6 +235,10 @@ Image Added:

    ```

    Create the hanlon ipxe script.
    ```bash
    ./cli/hanlon config > /tftpboot/hanlon.ipxe
    ```
    Lets install CentOS

    Download the CentOS ISO...
  8. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -207,7 +207,7 @@ We will need the Hanlon microkernel to get started...
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```

    Ignore the bson_ext warning, do not upgrade...
    Add the microkernel and ignore the bson_ext warning, _do_not_install_ bson_ext...

    ```bash
    ./cli/hanlon image add -t mk -p hnl_mk_prod-image.1.0.iso
  9. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 28 additions and 0 deletions.
    28 changes: 28 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -207,6 +207,34 @@ We will need the Hanlon microkernel to get started...
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```

    Ignore the bson_ext warning, do not upgrade...

    ```bash
    ./cli/hanlon image add -t mk -p hnl_mk_prod-image.1.0.iso
    ** Notice: The native BSON extension was not loaded. **

    For optimal performance, use of the BSON extension is recommended.

    To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
    and run the following command:

    gem install bson_ext

    If you continue to receive this message after installing, make sure that
    the bson_ext gem is in your load path.

    Attempting to add, please wait...
    Image Added:
    UUID => j2B1BswDUNPvGDQ1NXVaM
    Type => MicroKernel Image
    ISO Filename => hnl_mk_prod-image.1.0.iso
    Path => /opt/hanlon/image/mk/j2B1BswDUNPvGDQ1NXVaM
    Status => Valid
    Version => 1.0
    Built Time => 2014-05-21 21:37:12 -0400

    ```

    Lets install CentOS

    Download the CentOS ISO...
  10. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -183,7 +183,7 @@ vi /opt/hanlon/cli/conf/hanlon_client.conf

    Change the trinidad start script "--addresss 192.168.109.5" to "--address 0.0.0.0", then run
    ```bash
    cd script
    cd /opt/hanlon/script
    vi run-tri.sh
    ./run-tri.sh
    ```
  11. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -174,9 +174,18 @@ Install the prerequisite gems
    bundle install
    ```

    And finally start trinidad
    Run hanlon_init and modify the configuration files
    ```bash
    trinidad -c /occam/api -d . -p 8026 --address 0.0.0.0
    ./hanlon_init
    vi /opt/hanlon/web/conf/hanlon_server.conf
    vi /opt/hanlon/cli/conf/hanlon_client.conf
    ```

    Change the trinidad start script "--addresss 192.168.109.5" to "--address 0.0.0.0", then run
    ```bash
    cd script
    vi run-tri.sh
    ./run-tri.sh
    ```

    You can use ./cli/hanlon now with JRuby but it is incredibly slow so lets add Ruby.
  12. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -158,13 +158,11 @@ I am using RVM to get JRuby and Ruby:
    \curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
    source /usr/local/rvm/scripts/rvm
    ```
    ```bash
    gem install bundler
    ```
    Since we are getting this up as quick as possible lets just use trinidad for now:
    ```bash
    gem install trinidad
    gem install bundler trinidad
    ```

    Once that is complete clone the git repository locally
    ```bash
    mkdir /opt/hanlon
  13. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -158,6 +158,9 @@ I am using RVM to get JRuby and Ruby:
    \curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
    source /usr/local/rvm/scripts/rvm
    ```
    ```bash
    gem install bundler
    ```
    Since we are getting this up as quick as possible lets just use trinidad for now:
    ```bash
    gem install trinidad
  14. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 15 additions and 13 deletions.
    28 changes: 15 additions & 13 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -155,38 +155,40 @@ EOF

    I am using RVM to get JRuby and Ruby:
    ```bash
    root@hanlon:/# \curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    \curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
    source /usr/local/rvm/scripts/rvm
    ```
    Since we are getting this up as quick as possible lets just use trinidad for now:
    ```bash
    root@hanlon:/# gem install trinidad
    gem install trinidad
    ```
    Once that is complete clone the git repository locally
    ```bash
    root@hanlon:/# mkdir /opt/hanlon
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# git clone https://github.com/csc/Hanlon.git .
    mkdir /opt/hanlon
    cd /opt/hanlon
    git clone https://github.com/csc/Hanlon.git .
    ```
    Install the prerequisite gems
    ```bash
    root@hanlon:/opt/hanlon# bundle install
    bundle install
    ```

    And finally start trinidad
    ```bash
    root@hanlon:/opt/hanlon# trinidad -c /occam/api -d . -p 8026 --address 0.0.0.0
    trinidad -c /occam/api -d . -p 8026 --address 0.0.0.0
    ```

    You can use ./cli/hanlon now with JRuby but it is incredibly slow so lets add Ruby.
    Open a new terminal or SSH connection and run:
    ```bash
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# rvm install 1.9.3
    root@hanlon:/opt/hanlon# rvm use ruby-1.9.3
    source /usr/local/rvm/scripts/rvm
    cd /opt/hanlon
    rvm install 1.9.3
    rvm use ruby-1.9.3
    ```
    And again run bundler
    ```bash
    root@hanlon:/opt/hanlon# bundle install
    bundle install
    ```

    We will need the Hanlon microkernel to get started...
  15. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ This guide is for individuals just want to get Hanlon installed and running quic

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    ```bash
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd curl
    ```

    For Windows testing only
  16. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -16,10 +16,7 @@ mkdir /tftpboot
    chmod -R 777 /tftpboot
    chown -R nobody /tftpboot
    ```
    Copy ipxe files to tftpboot
    ```bash
    cp /usr/lib/ipxe/* /tftpboot
    ```


    Create TFTP server configuration
    ```bash
    @@ -39,6 +36,10 @@ EOF
    service xinetd reload
    ```

    Copy ipxe files to tftpboot
    ```bash
    cp /usr/lib/ipxe/* /tftpboot
    ```
    To get pxelinux we can download it here:
    ```bash
    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz
  17. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ is

    For Windows testing only
    ```bash
    apt-get install samba samba-tools apache2 -y
    apt-get install samba apache2 -y
    ```

    Configure tftpd
  18. jcpowermac revised this gist Jun 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -235,7 +235,7 @@ Model Created:
    ```


    ### BEGIN WINDOWS ###
    ### BEGIN WINDOWS TESTING ###

    cat > /etc/samba/smb.conf <<EOF
    [hanlon]
  19. jcpowermac revised this gist Jun 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -235,7 +235,7 @@ Model Created:
    ```


    # BEGIN WINDOWS
    ### BEGIN WINDOWS ###

    cat > /etc/samba/smb.conf <<EOF
    [hanlon]
  20. jcpowermac revised this gist Jun 6, 2014. 1 changed file with 12 additions and 4 deletions.
    16 changes: 12 additions & 4 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -194,13 +194,15 @@ We will need the Hanlon microkernel to get started...
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```

    Lets install CentOS





    Download the CentOS ISO...
    ```bash
    wget http://reflector.westga.edu/repos/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso
    ```

    Add CentOS image to hanlon...
    ```bash
    ./cli/hanlon image add -t os -p CentOS-6.5-x86_64-minimal.iso -n CentOS65 -v 6.5

    Attempting to add, please wait...
    @@ -212,8 +214,11 @@ Image Added:
    Status => Valid
    OS Name => CentOS65
    OS Version => 6.5
    ```


    Create a model for a CentOS deployment...
    ```bash
    ./cli/hanlon model add -t centos_6 -l centos65-model -i K3v2suiIkSYNEdx1CTKqs

    Model Created:
    @@ -222,9 +227,12 @@ Model Created:
    Description => CentOS 6 Model
    UUID => 2J5Vb2ztkks9pz1iLrCxks
    Image UUID => K3v2suiIkSYNEdx1CTKqs
    ```


    ```bash
    ./cli/hanlon policy add --template=linux_deploy -l centos65-policy -m 2J5Vb2ztkks9pz1iLrCxks -t memsize_1GiB --enabled true
    ```


    # BEGIN WINDOWS
  21. jcpowermac revised this gist Jun 6, 2014. 1 changed file with 30 additions and 25 deletions.
    55 changes: 30 additions & 25 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -39,6 +39,35 @@ EOF
    service xinetd reload
    ```

    To get pxelinux we can download it here:
    ```bash
    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz

    tar -zxvf syslinux-6.02.tar.gz --strip-components 3 -C /tftpboot syslinux-6.02/bios/core/pxelinux.0
    tar -zxvf syslinux-6.02.tar.gz --strip-components 4 -C /tftpboot syslinux-6.02/bios/com32/menu/menu.c32

    mkdir /tftpboot/pxelinux.cfg

    cat > /tftpboot/pxelinux.cfg/default <<EOF
    default menu.c32
    prompt 0
    menu title Hanlon Boot Menu

    timeout 50
    f1 help.txt
    f2 version.txt

    label hanlon-boot
    menu label Automatic hanlon Node Boot
    kernel ipxe.lkrn
    append initrd=hanlon.ipxe

    label boot-else
    menu label Bypass hanlon
    localboot 1
    EOF
    ```

    Configure DHCPd, remember to change based on your specific network...

    ```bash
    @@ -151,7 +180,7 @@ Open a new terminal or SSH connection and run:
    ```bash
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# cd rvm install 1.9.3
    root@hanlon:/opt/hanlon# rvm install 1.9.3
    root@hanlon:/opt/hanlon# rvm use ruby-1.9.3
    ```
    And again run bundler
    @@ -165,31 +194,7 @@ We will need the Hanlon microkernel to get started...
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```

    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz

    tar -zxvf syslinux-6.02.tar.gz --strip-components 3 -C /tftpboot syslinux-6.02/bios/core/pxelinux.0
    tar -zxvf syslinux-6.02.tar.gz --strip-components 4 -C /tftpboot syslinux-6.02/bios/com32/menu/menu.c32

    mkdir /tftpboot/pxelinux.cfg

    cat > /tftpboot/pxelinux.cfg/default <<EOF
    default menu.c32
    prompt 0
    menu title Hanlon Boot Menu

    timeout 50
    f1 help.txt
    f2 version.txt

    label hanlon-boot
    menu label Automatic hanlon Node Boot
    kernel ipxe.lkrn
    append initrd=hanlon.ipxe

    label boot-else
    menu label Bypass hanlon
    localboot 1
    EOF



  22. jcpowermac revised this gist Jun 6, 2014. 1 changed file with 50 additions and 56 deletions.
    106 changes: 50 additions & 56 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,28 @@
    *** How to is a mess, but most the commands are OK ***

    This guide is for individuals just want to get Hanlon installed and running quickly. We are using Ubuntu LTS 14.04 but should also work with previous releases.

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    ```bash
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd samba samba-tools apache2
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd
    ```

    For Windows testing only
    ```bash
    apt-get install samba samba-tools apache2 -y
    ```

    Configure tftpd
    ```bash
    mkdir /tftpboot
    chmod -R 777 /tftpboot
    chown -R nobody /tftpboot
    ```
    Copy ipxe files to tftpboot
    ```bash
    cp /usr/lib/ipxe/* /tftpboot
    ```

    Create TFTP server configuration
    ```bash
    cat > /etc/xinetd.d/tftp << EOF
    service tftp
    {
    @@ -29,7 +39,7 @@ EOF
    service xinetd reload
    ```

    Configure dhcpd:
    Configure DHCPd, remember to change based on your specific network...

    ```bash
    cat > /etc/dhcp/dhcpd.conf << EOF
    @@ -103,8 +113,6 @@ option hanlon_server 192.168.66.254;
    option hanlon_port 8036;
    option hanlon_base_uri "/hanlon/v1";



    if exists user-class and option user-class = "iPXE" {
    filename "hanlon.ipxe";
    } else {
    @@ -143,26 +151,16 @@ Open a new terminal or SSH connection and run:
    ```bash
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# rvm install 2.1.1
    ```
    Confirm that ruby is current:
    ```bash
    root@hanlon:/opt/hanlon/bin# rvm list

    rvm rubies

    * jruby-1.7.12 [ x86_64 ]
    => ruby-2.1.1 [ x86_64 ]

    # => - current
    # =* - current && default
    # * - default
    root@hanlon:/opt/hanlon# cd rvm install 1.9.3
    root@hanlon:/opt/hanlon# rvm use ruby-1.9.3
    ```
    And again run bundle
    And again run bundler
    ```bash
    root@hanlon:/opt/hanlon# bundle install
    ```

    We will need the Hanlon microkernel to get started...

    ```bash
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```
    @@ -193,11 +191,39 @@ label boot-else
    localboot 1
    EOF

    cp /usr/lib/ipxe/* /tftpboot

    *** For Windows ***


    wget http://reflector.westga.edu/repos/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso

    ./cli/hanlon image add -t os -p CentOS-6.5-x86_64-minimal.iso -n CentOS65 -v 6.5

    Attempting to add, please wait...
    Image Added:
    UUID => K3v2suiIkSYNEdx1CTKqs
    Type => OS Install
    ISO Filename => CentOS-6.5-x86_64-minimal.iso
    Path => /opt/hanlon/image/os/K3v2suiIkSYNEdx1CTKqs
    Status => Valid
    OS Name => CentOS65
    OS Version => 6.5


    ./cli/hanlon model add -t centos_6 -l centos65-model -i K3v2suiIkSYNEdx1CTKqs

    Model Created:
    Label => centos65-model
    Template => linux_deploy
    Description => CentOS 6 Model
    UUID => 2J5Vb2ztkks9pz1iLrCxks
    Image UUID => K3v2suiIkSYNEdx1CTKqs


    ./cli/hanlon policy add --template=linux_deploy -l centos65-policy -m 2J5Vb2ztkks9pz1iLrCxks -t memsize_1GiB --enabled true


    # BEGIN WINDOWS

    cat > /etc/samba/smb.conf <<EOF
    [hanlon]
    browsable = true
    @@ -206,13 +232,10 @@ guest ok = yes
    path = /opt/hanlon_cifs_share
    EOF


    cd /var/www/html
    wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip
    unzip -p wimboot-latest.zip wimboot-1.0.5/wimboot > wimboot

    # This below is temporary testing for windows

    cat > /var/www/html/wimboot.ipxe <<EOF
    #!ipxe

    @@ -228,34 +251,5 @@ cat > /var/www/html/wimboot.ipxe <<EOF
    boot
    EOF

    wget http://reflector.westga.edu/repos/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso

    rvm install 1.9.3
    rvm list



    ./cli/hanlon image add -t os -p CentOS-6.5-x86_64-minimal.iso -n CentOS65 -v 6.5

    Attempting to add, please wait...
    Image Added:
    UUID => K3v2suiIkSYNEdx1CTKqs
    Type => OS Install
    ISO Filename => CentOS-6.5-x86_64-minimal.iso
    Path => /opt/hanlon/image/os/K3v2suiIkSYNEdx1CTKqs
    Status => Valid
    OS Name => CentOS65
    OS Version => 6.5


    ./cli/hanlon model add -t centos_6 -l centos65-model -i K3v2suiIkSYNEdx1CTKqs
    ### END WINDOWS ###

    Model Created:
    Label => centos65-model
    Template => linux_deploy
    Description => CentOS 6 Model
    UUID => 2J5Vb2ztkks9pz1iLrCxks
    Image UUID => K3v2suiIkSYNEdx1CTKqs


    ./cli/hanlon policy add --template=linux_deploy -l centos65-policy -m 2J5Vb2ztkks9pz1iLrCxks -t memsize_1GiB --enabled true
  23. jcpowermac revised this gist Jun 2, 2014. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    *** How to is a mess, but most the commands are OK ***

    This guide is for individuals just want to get Hanlon installed and running quickly. We are using Ubuntu LTS 14.04 but should also work with previous releases.

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    @@ -228,6 +230,10 @@ EOF

    wget http://reflector.westga.edu/repos/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso

    rvm install 1.9.3
    rvm list



    ./cli/hanlon image add -t os -p CentOS-6.5-x86_64-minimal.iso -n CentOS65 -v 6.5

  24. jcpowermac revised this gist Jun 2, 2014. 1 changed file with 28 additions and 0 deletions.
    28 changes: 28 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -225,3 +225,31 @@ cat > /var/www/html/wimboot.ipxe <<EOF
    initrd boot.wim boot.wim
    boot
    EOF

    wget http://reflector.westga.edu/repos/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso


    ./cli/hanlon image add -t os -p CentOS-6.5-x86_64-minimal.iso -n CentOS65 -v 6.5

    Attempting to add, please wait...
    Image Added:
    UUID => K3v2suiIkSYNEdx1CTKqs
    Type => OS Install
    ISO Filename => CentOS-6.5-x86_64-minimal.iso
    Path => /opt/hanlon/image/os/K3v2suiIkSYNEdx1CTKqs
    Status => Valid
    OS Name => CentOS65
    OS Version => 6.5


    ./cli/hanlon model add -t centos_6 -l centos65-model -i K3v2suiIkSYNEdx1CTKqs

    Model Created:
    Label => centos65-model
    Template => linux_deploy
    Description => CentOS 6 Model
    UUID => 2J5Vb2ztkks9pz1iLrCxks
    Image UUID => K3v2suiIkSYNEdx1CTKqs


    ./cli/hanlon policy add --template=linux_deploy -l centos65-policy -m 2J5Vb2ztkks9pz1iLrCxks -t memsize_1GiB --enabled true
  25. jcpowermac revised this gist May 30, 2014. 1 changed file with 21 additions and 2 deletions.
    23 changes: 21 additions & 2 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ This guide is for individuals just want to get Hanlon installed and running quic

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    ```bash
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd samba samba-tools
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd samba samba-tools apache2
    ```

    Configure tftpd
    @@ -201,8 +201,27 @@ cat > /etc/samba/smb.conf <<EOF
    browsable = true
    read only = no
    guest ok = yes
    path = /opt/hanlon_Cifs_share
    path = /opt/hanlon_cifs_share
    EOF


    cd /var/www/html
    wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip
    unzip -p wimboot-latest.zip wimboot-1.0.5/wimboot > wimboot

    # This below is temporary testing for windows

    cat > /var/www/html/wimboot.ipxe <<EOF
    #!ipxe

    kernel wimboot
    initrd media/bootmgr bootmgr
    initrd media/Boot/BCD BCD
    initrd media/Boot/Fonts/segmono_boot.ttf segmono_boot.ttf
    initrd media/Boot/Fonts/segoe_slboot.ttf segoe_slboot.ttf
    initrd media/Boot/Fonts/segoen_slboot.ttf segoen_slboot.ttf
    initrd media/Boot/Fonts/wgl4_boot.ttf wgl4_boot.ttf
    initrd media/Boot/boot.sdi boot.sdi
    initrd boot.wim boot.wim
    boot
    EOF
  26. jcpowermac revised this gist May 30, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -82,6 +82,11 @@ option ipxe.nfs code 41 = unsigned integer 8;

    option ipxe.no-pxedhcp 1;

    option hanlon_server code 224 = ip-address;
    option hanlon_port code 225 = unsigned integer 16;
    option hanlon_base_uri code 226 = text;


    subnet 192.168.66.0 netmask 255.255.255.0 {
    range 192.168.66.200 192.168.66.210;
    option domain-name "virtomation.com";
    @@ -92,6 +97,11 @@ subnet 192.168.66.0 netmask 255.255.255.0 {
    default-lease-time 600;
    max-lease-time 7200;

    option hanlon_server 192.168.66.254;
    option hanlon_port 8036;
    option hanlon_base_uri "/hanlon/v1";



    if exists user-class and option user-class = "iPXE" {
    filename "hanlon.ipxe";
  27. jcpowermac revised this gist May 30, 2014. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion hanlon_install
    Original file line number Diff line number Diff line change
    @@ -181,4 +181,18 @@ label boot-else
    localboot 1
    EOF

    cp /usr/lib/ipxe/* /tftpboot
    cp /usr/lib/ipxe/* /tftpboot

    *** For Windows ***


    cat > /etc/samba/smb.conf <<EOF
    [hanlon]
    browsable = true
    read only = no
    guest ok = yes
    path = /opt/hanlon_Cifs_share
    EOF



  28. jcpowermac revised this gist May 30, 2014. 1 changed file with 5 additions and 8 deletions.
    13 changes: 5 additions & 8 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ This guide is for individuals just want to get Hanlon installed and running quic

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    ```bash
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd samba samba-tools
    ```

    Configure tftpd
    @@ -80,7 +80,6 @@ option ipxe.menu code 39 = unsigned integer 8;
    option ipxe.sdi code 40 = unsigned integer 8;
    option ipxe.nfs code 41 = unsigned integer 8;


    option ipxe.no-pxedhcp 1;

    subnet 192.168.66.0 netmask 255.255.255.0 {
    @@ -95,7 +94,7 @@ subnet 192.168.66.0 netmask 255.255.255.0 {


    if exists user-class and option user-class = "iPXE" {
    filename "http://10.53.251.70/boot.ipxe";
    filename "hanlon.ipxe";
    } else {
    filename "undionly.kpxe";
    }
    @@ -156,10 +155,6 @@ root@hanlon:/opt/hanlon# bundle install
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```





    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz

    tar -zxvf syslinux-6.02.tar.gz --strip-components 3 -C /tftpboot syslinux-6.02/bios/core/pxelinux.0
    @@ -184,4 +179,6 @@ label hanlon-boot
    label boot-else
    menu label Bypass hanlon
    localboot 1
    EOF
    EOF

    cp /usr/lib/ipxe/* /tftpboot
  29. jcpowermac revised this gist May 24, 2014. 1 changed file with 162 additions and 0 deletions.
    162 changes: 162 additions & 0 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,165 @@
    This guide is for individuals just want to get Hanlon installed and running quickly. We are using Ubuntu LTS 14.04 but should also work with previous releases.

    Lets first install git, mongodb, dhcpd, tftpd, ipxe installed:
    ```bash
    root@hanlon:/# apt-get install -y git make mongodb openjdk-7-jre-headless g++ isc-dhcp-server ipxe tftp tftpd
    ```

    Configure tftpd
    ```bash
    mkdir /tftpboot
    chmod -R 777 /tftpboot
    chown -R nobody /tftpboot

    cat > /etc/xinetd.d/tftp << EOF
    service tftp
    {
    protocol = udp
    port = 69
    socket_type = dgram
    wait = yes
    user = nobody
    server = /usr/sbin/in.tftpd
    server_args = /tftpboot
    disable = no
    }
    EOF
    service xinetd reload
    ```

    Configure dhcpd:

    ```bash
    cat > /etc/dhcp/dhcpd.conf << EOF
    ddns-update-style none;
    default-lease-time 600;
    max-lease-time 7200;
    log-facility local7;

    authorative;

    option space ipxe;
    option ipxe-encap-opts code 175 = encapsulate ipxe;
    option ipxe.priority code 1 = signed integer 8;
    option ipxe.keep-san code 8 = unsigned integer 8;
    option ipxe.skip-san-boot code 9 = unsigned integer 8;
    option ipxe.syslogs code 85 = string;
    option ipxe.cert code 91 = string;
    option ipxe.privkey code 92 = string;
    option ipxe.crosscert code 93 = string;
    option ipxe.no-pxedhcp code 176 = unsigned integer 8;
    option ipxe.bus-id code 177 = string;
    option ipxe.bios-drive code 189 = unsigned integer 8;
    option ipxe.username code 190 = string;
    option ipxe.password code 191 = string;
    option ipxe.reverse-username code 192 = string;
    option ipxe.reverse-password code 193 = string;
    option ipxe.version code 235 = string;
    option iscsi-initiator-iqn code 203 = string;

    option ipxe.pxeext code 16 = unsigned integer 8;
    option ipxe.iscsi code 17 = unsigned integer 8;
    option ipxe.aoe code 18 = unsigned integer 8;
    option ipxe.http code 19 = unsigned integer 8;
    option ipxe.https code 20 = unsigned integer 8;
    option ipxe.tftp code 21 = unsigned integer 8;
    option ipxe.ftp code 22 = unsigned integer 8;
    option ipxe.dns code 23 = unsigned integer 8;
    option ipxe.bzimage code 24 = unsigned integer 8;
    option ipxe.multiboot code 25 = unsigned integer 8;
    option ipxe.slam code 26 = unsigned integer 8;
    option ipxe.srp code 27 = unsigned integer 8;
    option ipxe.nbi code 32 = unsigned integer 8;
    option ipxe.pxe code 33 = unsigned integer 8;
    option ipxe.elf code 34 = unsigned integer 8;
    option ipxe.comboot code 35 = unsigned integer 8;
    option ipxe.efi code 36 = unsigned integer 8;
    option ipxe.fcoe code 37 = unsigned integer 8;
    option ipxe.vlan code 38 = unsigned integer 8;
    option ipxe.menu code 39 = unsigned integer 8;
    option ipxe.sdi code 40 = unsigned integer 8;
    option ipxe.nfs code 41 = unsigned integer 8;


    option ipxe.no-pxedhcp 1;

    subnet 192.168.66.0 netmask 255.255.255.0 {
    range 192.168.66.200 192.168.66.210;
    option domain-name "virtomation.com";
    option routers 192.168.66.1;
    next-server 192.168.66.254;
    option tftp-server-name "192.168.66.254";
    option domain-name-servers 192.168.66.1;
    default-lease-time 600;
    max-lease-time 7200;


    if exists user-class and option user-class = "iPXE" {
    filename "http://10.53.251.70/boot.ipxe";
    } else {
    filename "undionly.kpxe";
    }

    }
    EOF


    I am using RVM to get JRuby and Ruby:
    ```bash
    root@hanlon:/# \curl -sSL https://get.rvm.io | bash -s stable --ruby=jruby
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    ```
    Since we are getting this up as quick as possible lets just use trinidad for now:
    ```bash
    root@hanlon:/# gem install trinidad
    ```
    Once that is complete clone the git repository locally
    ```bash
    root@hanlon:/# mkdir /opt/hanlon
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# git clone https://github.com/csc/Hanlon.git .
    ```
    Install the prerequisite gems
    ```bash
    root@hanlon:/opt/hanlon# bundle install
    ```
    And finally start trinidad
    ```bash
    root@hanlon:/opt/hanlon# trinidad -c /occam/api -d . -p 8026 --address 0.0.0.0
    ```
    You can use ./cli/hanlon now with JRuby but it is incredibly slow so lets add Ruby.
    Open a new terminal or SSH connection and run:
    ```bash
    root@hanlon:/# source /usr/local/rvm/scripts/rvm
    root@hanlon:/# cd /opt/hanlon
    root@hanlon:/opt/hanlon# rvm install 2.1.1
    ```
    Confirm that ruby is current:
    ```bash
    root@hanlon:/opt/hanlon/bin# rvm list

    rvm rubies

    * jruby-1.7.12 [ x86_64 ]
    => ruby-2.1.1 [ x86_64 ]

    # => - current
    # =* - current && default
    # * - default
    ```
    And again run bundle
    ```bash
    root@hanlon:/opt/hanlon# bundle install
    ```

    ```bash
    wget https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/hnl_mk_prod-image.1.0.iso
    ```





    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz

    tar -zxvf syslinux-6.02.tar.gz --strip-components 3 -C /tftpboot syslinux-6.02/bios/core/pxelinux.0
  30. jcpowermac revised this gist May 24, 2014. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions hanlon_install
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.gz

    mkdir /tftpboot/pxe
    tar -zxvf syslinux-6.02.tar.gz --strip-components 3 -C /tftpboot syslinux-6.02/bios/core/pxelinux.0
    tar -zxvf syslinux-6.02.tar.gz --strip-components 4 -C /tftpboot syslinux-6.02/bios/com32/menu/menu.c32

    mkdir /tftpboot/pxelinux.cfg

    cat > /tftpboot/pxelinux.cfg/default <<EOF
    default menu.c32
    prompt 0
    menu title Hanlon Boot Menu
    @@ -16,4 +21,5 @@ label hanlon-boot

    label boot-else
    menu label Bypass hanlon
    localboot 1
    localboot 1
    EOF