Skip to content
This repository has been archived by the owner on May 3, 2018. It is now read-only.

Commit

Permalink
[dev] Vagrantfile (#6)
Browse files Browse the repository at this point in the history
- add options for HostsUpdater plugin
  • Loading branch information
Giuseppe Morelli authored Oct 21, 2016
1 parent 239dce7 commit c31e50a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![stable version](https://img.shields.io/badge/stable%20version-1.1.0-green.svg?style=flat-square)](https://github.com/gmdotnet/Vagrant-LAMP/releases/tag/1.1.0)
[![stable version](https://img.shields.io/badge/stable%20version-1.1.1-green.svg?style=flat-square)](https://github.com/gmdotnet/Vagrant-LAMP/releases/tag/1.1.1)
[![develop](https://img.shields.io/badge/beta%20version-branch%20develop-oran.svg?style=flat-square)](https://github.com/gmdotnet/Vagrant-LAMP/tree/develop)
[![license](https://img.shields.io/badge/license-OSL--3-blue.svg?style=flat-square)](https://github.com/gmdotnet/Vagrant-LAMP/blob/master/LICENSE.txt)

Expand Down Expand Up @@ -26,6 +26,8 @@ This is a DEV LAMP debian based box. Use it for a basic PHP development.

- virtualbox 5.x
- vagrant >1.8.4
- vagrant HostsUpdater plugin: https://github.com/cogitatio/vagrant-hostsupdater
install with `vagrant plugin install vagrant-hostsupdater`
- (in case of error of shared folder mount errors) vagrant vagrant-vbguest plugin (install with the command `vagrant plugin install vagrant-vbguest`)

## How to use
Expand Down
15 changes: 13 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,22 @@ Vagrant.configure("2") do |config|

config.vm.define machine['host']['vagrantbox_name'] do |vmhost|
# Machine info
vmhost.vm.box = machine['host']['box']
vmhost.vm.box = machine['host']['box']['name']
vmhost.vm.box_check_update = machine['host']['box']['check_update']
vmhost.vm.hostname = machine['host']['hostname']

# Hostsupdater plugin
if machine['host']['hostsupdate']['permanent'] == true
vmhost.hostsupdater.remove_on_suspend = false
end

enable_hostupdate = true
if machine['host']['hostsupdate']['enable'] == false
enable_hostupdate = "skip"
end

## Private IP Network
vmhost.vm.network "private_network", ip: machine['host']['private_ip']
vmhost.vm.network "private_network", ip: machine['host']['private_ip'], hostsupdater: enable_hostupdate

## Shared folders
if machine['host']['share'] != nil
Expand Down
29 changes: 23 additions & 6 deletions config/config.yaml.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
##################################
## ##
## GMdotnet Vagrant LAMP Stack ##
## Version 1.1.0 ##
## Version 1.1.1 ##
## ##
## Vagrant config file ##
##################################
Expand All @@ -10,19 +10,26 @@ gmdotnet:
- host:
vagrantbox_name: gmweb
hostname: gmweb
hostsupdate:
enable: yes # enable hostsupdater plugin
permanent: no # your changes to /etc/hosts will be permanent
private_ip: 192.168.250.10
ram: 1024
box: giuseppemorelli/lamp-stack
box:
name: giuseppemorelli/lamp-stack
check_update: yes
provision:
ansible: yes
script: yes
script: no
# SHARED FOLDERS
share:
# - folder:
# host_folder: /var/www/myproject.com
# vagrant_folder: /var/www/myproject.com
# - folder:
# host_folder: /mnt/archive
# vagrant_folder: /mnt/archive
# RSYNC FOLDERS
rsync:
# - folder:
# host_folder: /mnt/extra/rsync
Expand All @@ -44,9 +51,14 @@ gmdotnet:
- host:
vagrantbox_name: gmdb
hostname: gmdb
hostsupdate:
enable: yes
permanent: no
private_ip: 192.168.250.11
ram: 1024
box: giuseppemorelli/lamp-stack
box:
name: giuseppemorelli/lamp-stack
check_update: yes
provision:
ansible: no
script: yes
Expand Down Expand Up @@ -77,10 +89,15 @@ gmdotnet:
# - "-z"
- host:
vagrantbox_name: gmredis
hostname: gmdredis
hostname: gmredis
hostsupdate:
enable: yes
permanent: no
private_ip: 192.168.250.12
ram: 1024
box: giuseppemorelli/lamp-stack
box:
name: giuseppemorelli/lamp-stack
check_update: yes
provision:
ansible: no
script: no
Expand Down

0 comments on commit c31e50a

Please sign in to comment.