Skip to content

Commit

Permalink
Ubuntu Bionic Beaver 18.04 support (#5687)
Browse files Browse the repository at this point in the history
* bionic box

* bionic beaver support
  • Loading branch information
tiagom62 authored and snipe committed Jun 9, 2018
1 parent 968d7d1 commit d204eeb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ SNIPEIT_SH_URL= "https://raw.githubusercontent.com/snipe/snipe-it/master/snipeit
NETWORK_BRIDGE= "en0: Wi-Fi (AirPort)"

Vagrant.configure("2") do |config|
config.vm.define "bionic" do |bionic|
bionic.vm.box = "ubuntu/bionic64"
bionic.vm.hostname = 'bionic'
bionic.vm.network "public_network", bridge: NETWORK_BRIDGE
bionic.vm.provision :shell, :inline => "wget #{SNIPEIT_SH_URL}"
bionic.vm.provision :shell, :inline => "chmod 755 snipeit.sh"
end

config.vm.define "xenial" do |xenial|
xenial.vm.box = "ubuntu/xenial64"
xenial.vm.hostname = 'xenial'
Expand Down
38 changes: 36 additions & 2 deletions snipeit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,41 @@ case $distro in
fi
;;
ubuntu)
if [[ "$version" =~ 16.04 ]]; then
if [ "$version" == "18.04" ]; then
# Install for Ubuntu 18.04
webdir=/var/www
ownergroup=www-data:www-data
tzone=$(cat /etc/timezone)
apachefile=/etc/apache2/sites-available/$name.conf

echo -n "* Updating installed packages."
log "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y upgrade" & pid=$!
progress

echo "* Installing Apache httpd, PHP, MariaDB and other requirements."
PACKAGES="mariadb-server mariadb-client apache2 libapache2-mod-php php php-mcrypt php-curl php-mysql php-gd php-ldap php-zip php-mbstring php-xml php-bcmath curl git unzip"
install_packages

echo "* Configuring Apache."
create_virtualhost
log "phpenmod mcrypt"
log "phpenmod mbstring"
log "a2enmod rewrite"
log "a2ensite $name.conf"

set_hosts

echo "* Starting MariaDB."
log "systemctl start mariadb.service"

echo "* Securing MariaDB."
/usr/bin/mysql_secure_installation

install_snipeit

echo "* Restarting Apache httpd."
log "systemctl restart apache2"
elif [ "$version" == "16.04" ]; then
# Install for Ubuntu 16.04
webdir=/var/www
ownergroup=www-data:www-data
Expand Down Expand Up @@ -421,7 +455,7 @@ case $distro in

echo "* Restarting Apache httpd."
log "service apache2 restart"
elif [[ "$version" =~ 14.04 ]]; then
elif [ "$version" == "14.04" ]; then
# Install for Ubuntu 14.04
webdir=/var/www
ownergroup=www-data:www-data
Expand Down

0 comments on commit d204eeb

Please sign in to comment.