Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #72 from goldsmcb/master
Browse files Browse the repository at this point in the history
Appliance Automator
  • Loading branch information
StevenStrand committed May 12, 2016
2 parents 5607a39 + b152a1a commit 03fc4d5
Show file tree
Hide file tree
Showing 9 changed files with 212 additions and 10 deletions.
14 changes: 6 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
.svn

NetSUSLPInstaller.run
.name
compiler.xml
misc.xml
modules.xml
NetSUS.iml
vcs.xml
workspace.xml
.idea
profiles_settings.xml
cgolds.xml
.sudo_as_admin_successful
motd.legal-displayed
packer_cache
output-virtualbox-iso

90 changes: 90 additions & 0 deletions appliance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Creating the NetSUSLP Appliance

### This guide is for project administrators of the NetSUSLP application.

The following instructions describe how to use VirtualBox and Packer (utilizing the files contained in the 'appliance' directory) to create an appliance (ova file) of the NetSUSLP application.

The purpose of the appliance file is to give users an easy to setup virtual machine that already has the NetSUSLP application installed. With the appliance the user can simply import the ova file into their preferred virtualization software and have a running NetSUSLP server.

## Requirements

**All requirements are open source and free to use for the purposes of this guide.**

* VirtualBox
* Packer

## Installation

There are several options for installing VirtualBox and Packer. You can either download the installers found below or use various command line options. On a Windows or Redhat host machine it is best to use the downloaded installers.

* VirtualBox [Download Installer Here](https://www.virtualbox.org/wiki/Downloads)
* Packer [Download Installer Here](https://www.packer.io/downloads.html)

On a OSX host machine using homebrew

$ brew cask install virtualbox
$ brew install packer

On a Debian host machine (Ubuntu). For packer you will need to use the downloaded installer

$ sudo apt-get install virtualbox

## 1. Create the Base VM with Packer

1. Make sure any changes made to the NetSUSLP codebase are finalized and tested. If you do not have the current repository on your host machine, you will need to clone it.

$ git clone https://github.com/jamf/NetSUS.git
2. You will now create the installer for NetSUSLP. Running the CreateNetSUSInstaller.sh script will create a NetSUSLPInstaller.run file. In the base directory of your NetSUS project run the command:

$ sudo ./CreateNetSUSInstaller.sh
3. You will now utilize packer to create a base VM with the necessary virtual hardware specifications. The created VM will not have NetSUSLP installed nor have the correct network settings. This process will take some time as it is downloading an iso image of Ubuntu and installing it onto a VM. You can observe the installation by starting VirtualBox and opening the 'NetSUSLP_Setup' VM. Packer will take care of the input necessary to install Ubuntu. To proceed run this command in the `NetSUS/appliance/` directory:

$ packer build setup.json
## 2. Install NetSUSLP on the Base VM

1. Once the packer build is finished the created ovf file will be located in `NetSUS/appliance/output-virtualbox-iso/`

2. Open VirtualBox and import the created ovf file located in the directory above. To import an ovf file select `File -> Import Appliance -> select file` in the VirtualBox manager page.

3. Before you spin up the imported VM you will want to add some network settings that will allow the VM to gain access to the internet. You can access the settings by right clicking on the NetSUSLP_Setup VM and selecting 'Settings', then enter the 'Network' tab. The settings that will depend on your host machine's hardware and network environment are 'Attach' and 'Name'. The 'Advanced' section must be set as depicted here:

<img src="../docs/images/attachments/vbox_network.png" width="400">

4. You can now start the VM with the new network settings. The default username and password will be `username: shelluser, password: shelluser`. Before installing NetSUSLP you will want to verify that your VM has internet access. Run a command such as `$ ping google.com` and ensure you receive a response.

5. Now you must restart the VM. It is important to make sure the VM gets fully powered off before running the NetSUSLP installer. Run this command:

$ sudo shutdown -P now
6. Start the VM again through VirtualBox. The installer for NetSUSLP is located in the shelluser home directory. To make the installer runnable, run this command:

$ chmod +x NetSUSLPInstaller.run
7. Now you must run the installer with sudo permission. Answer 'yes' for any input the installer asks for. Run this command:

$ sudo ./NetSUSLPInstaller.run
## 3. Export the VM as an OVA File

1. Now you will export the VM with NetSUSLP installed. After verifying that the application is working correctly on the VM, power it down.

2. In VirtualBox manager, select `File -> Export Appliance -> NetSUSLP_Setup -> Continue`

3. Now select a location to put the exported ova file. Be sure to name the the file `NetSUSLP_<release_version> and select the OVF 2.0 format.

<img src="../docs/images/attachments/vbox_export.png" width="400">

4. When finished make sure no iso, ova, or ovf file is included in the repository.









39 changes: 39 additions & 0 deletions appliance/http/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
choose-mirror-bin mirror/http/proxy string
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc boolean true
d-i clock-setup/utc-auto boolean true
d-i finish-install/reboot_in_progress note
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select atomic
d-i partman-auto/method string lvm
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm_write_new_label boolean true
d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select full-upgrade
d-i time/zone string UTC
tasksel tasksel/first multiselect standard, ubuntu-server

d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/modelcode string pc105
d-i debian-installer/locale string en_US

# Create shelluser user account.
d-i passwd/user-fullname string shelluser
d-i passwd/username string shelluser
d-i passwd/user-password password shelluser
d-i passwd/user-password-again password shelluser
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
d-i passwd/user-default-groups shelluser sudo
d-i passwd/user-uid string 900
74 changes: 74 additions & 0 deletions appliance/setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"variables": {
"ssh_name": "shelluser",
"ssh_pass": "shelluser"
},
"provisioners": [
{
"type": "file",
"source": "../NetSUSLPInstaller.run",
"destination": "/home/shelluser/NetSUSLPInstaller.run"
}
],
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu_64",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz",
" netcfg/get_domain=vm<wait>",
" netcfg/get_hostname=NetSUSLP<wait>",
" auto=true",
" priority=critical",
" initrd=/install/initrd.gz",
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
" -- ",
"<enter>"
],
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--vram",
"12"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"2"
],
[
"modifyvm",
"{{.Name}}",
"--memory",
"2048"
],
[
"modifyvm",
"{{.Name}}",
"--nic1",
"nat"
]
],
"vm_name": "NetSUSLP_Setup",
"format": "ovf",
"headless": true,
"disk_size": 307200,
"guest_additions_mode": "disable",
"iso_url": "http://releases.ubuntu.com/trusty/ubuntu-14.04.4-server-amd64.iso",
"iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a",
"iso_checksum_type": "md5",
"http_directory": "http",
"http_port_min": 9001,
"http_port_max": 9001,
"ssh_username": "{{user `ssh_name`}}",
"ssh_password": "{{user `ssh_pass`}}",
"ssh_wait_timeout": "10000s",
"shutdown_command": "echo {{user `ssh_pass`}} | sudo -S shutdown -P now"
}
]
}
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* [LDAP Proxy](ldap_proxy.md) - how to set up an LDAP proxy
* [Accounts](accounts.md) - how to change all assoicated account credentials
* [Settings](settings.md) - walkthroughs of each additional option found in the settings page
* [Create Appliance](../appliance/README.md) - for application administrators to create the ova appliance file

## Still have Questions?

* GitHub issues are the primary way for communicating about specific proposed changes to this project.

* There is a discussion board located on [JAMF Nation](https://jamfnation.jamfsoftware.com/viewProduct.html?id=180&view=discussions). You are welcome to create an account and contribute to the discussion by asking questions, discussing bugs, or answering questions you may have knowledge about.
* There is a discussion board located on [JAMF Nation](https://jamfnation.jamfsoftware.com/viewProduct.html?id=180&view=discussions). You are welcome to create an account and contribute to the discussion by asking questions, discussing bugs, or answering questions you may have knowledge about.
Binary file modified docs/images/attachments/dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/attachments/vbox_export.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/attachments/vbox_network.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion webadmin/var/www/webadmin/inc/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a id="version-number-text" class="navbar-brand text-muted">NetSUS 4.0.0</a>
<a id="version-number-text" class="navbar-brand text-muted">NetSUS 4.1.0</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
Expand Down

0 comments on commit 03fc4d5

Please sign in to comment.