Skip to content
This repository was archived by the owner on Oct 25, 2018. It is now read-only.

Commit 5ff3c2c

Browse files
author
Giuseppe Morelli
committed
Merge branch 'release/1.2.0'
2 parents b10bfd6 + 429d3ff commit 5ff3c2c

File tree

4 files changed

+82
-17
lines changed

4 files changed

+82
-17
lines changed

CHANGELOG.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
# GMdotnet - Vagrant Multi Machine Virtualbox
22

3-
## 1.1.0
4-
- [dev] add nfs share
5-
- [dev] add options for rsync folders
6-
- [imp] readme and instruction to use
3+
Follow guideline of [Keep a Changelog](http://keepachangelog.com) from 1.11.5
74

8-
## 1.0.0
9-
- [dev] stable version
5+
## [1.2.0]
106

11-
## 0.0.1
12-
- [dev] init from gmdotnet/vagrant-lamp project
7+
### Added
8+
- rsync folder: add possibility to choose user and group owner
9+
- possibility to add extra hard disk
10+
- add permament script path
11+
12+
### Changed
13+
- edit readme
14+
- fix sample file
15+
16+
## [1.1.0]
17+
18+
### Added
19+
- add nfs share
20+
- add options for rsync folders
21+
22+
### Changed
23+
- readme and instruction to use
24+
25+
## [1.0.0]
26+
stable version
27+
28+
## [0.0.1]
29+
init from gmdotnet/vagrant-lamp project

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![stable version](https://img.shields.io/badge/stable%20version-1.1.0-green.svg?style=flat-square)](https://github.com/gmdotnet/vagrant-multi-machine-virtualbox/releases/tag/1.1.0)
1+
[![stable version](https://img.shields.io/badge/stable%20version-1.2.0-green.svg?style=flat-square)](https://github.com/gmdotnet/vagrant-multi-machine-virtualbox/releases/tag/1.2.0)
22
[![develop](https://img.shields.io/badge/beta%20version-branch%20develop-oran.svg?style=flat-square)](https://github.com/gmdotnet/vagrant-multi-machine-virtualbox/tree/develop)
33
[![license](https://img.shields.io/badge/license-OSL--3-blue.svg?style=flat-square)](https://github.com/gmdotnet/vagrant-multi-machine-virtualbox/blob/master/LICENSE.txt)
44
[![gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/GMdotnet/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
@@ -55,18 +55,23 @@ Tab indent: 4 spaces or tab
5555
| box > check_update | boolean | Check for update of your box | |
5656
| | | | |
5757
| private_ip | ipv4 | Internal ipv4 of the machine | Don't use same subnet of your computer |
58-
| ram | int | Amout of ram to allocate | |
58+
| ram | int | Amount of ram to allocate | |
59+
| cpu | int | Amount of cpu to use | |
60+
| **extra_hard_disk** | | | |
61+
| extra_hard_disk > create | boolean | Flag to create new extra hard disk | |
62+
| extra_hard_disk > filepath | string | Relative or absolute path for new extra hard disk | |
63+
| extra_hard_disk > size | int | Size in GB | |
5964
| | | | |
6065
| **provision** | | | |
6166
| provision > ansible > enable | boolean | Enable Ansible provisioning | |
6267
| provision > ansible > playbook_path | string | Relative path from Vagrantfile of your Ansible Playbook | |
6368
| provision > script > enable | boolean | Enable script provisioning | |
6469
| provision > script > path | string | Relative path from Vagrantfile of your script | |
6570
| | | | |
66-
| **plugin** | | | |
67-
| plugin > hostsupdater > enable | boolean | Enable or not hostsupdater plugin | https://github.com/cogitatio/vagrant-hostsupdater |
68-
| plugin > hostsupdater > permanent | boolean | Your changes to /etc/hosts will be permanent | Only if you destroy the machine, entries in /etc/hosts will be removed |
69-
| plugin > hostsupdater > aliases | array | domain aliases for the same ip | Leave blank for no aliases |
71+
| **plugins** | | | |
72+
| plugins > hostsupdater > enable | boolean | Enable or not hostsupdater plugin | https://github.com/cogitatio/vagrant-hostsupdater |
73+
| plugins > hostsupdater > permanent | boolean | Your changes to /etc/hosts will be permanent | Only if you destroy the machine, entries in /etc/hosts will be removed |
74+
| plugins > hostsupdater > aliases | array | domain aliases for the same ip | Leave blank for no aliases |
7075
| | | | |
7176
| **share** | | | |
7277
| share > folder | group field | Group of shared folder via virtualbox system | https://www.vagrantup.com/docs/synced-folders/basic_usage.html |
@@ -79,6 +84,8 @@ Tab indent: 4 spaces or tab
7984
| rsync > folder | group field | Group of sync folder via rsync | |
8085
| rsync > folder > host_folder | string | Path of the folder on your machine | |
8186
| rsync > folder > vagrant_folder | string | Path of the folder inside vagrant machine | |
87+
| rsync > folder > owner | string | Change owner folder inside vagrant machine | Default: vagrant |
88+
| rsync > folder > group | string | Change owner folder inside vagrant machine | Default: vagrant |
8289
| rsync > folder > options | group field | Rsync parameters. One per line | https://www.vagrantup.com/docs/synced-folders/rsync.html |
8390
| rsync > folder > exclude | group field | Exclude folders from rsync | https://www.vagrantup.com/docs/synced-folders/rsync.html#rsync__exclude |
8491
| | | | |

Vagrantfile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## ##
66
## GMdotnet ##
77
## Vagrant Multi Machine Virtualbox ##
8-
## Version 1.1.0 ##
8+
## Version 1.2.0 ##
99
## ##
1010
#######################################
1111

@@ -79,6 +79,15 @@ Vagrant.configure("2") do |config|
7979
host['rsync'].each do |rsync|
8080
rsyncoptions = []
8181
rsyncexclude = []
82+
# rsync folders - owner
83+
owner = "vagrant"
84+
group = "vagrant"
85+
if rsync['folder']['owner'] != nil
86+
owner = rsync['folder']['owner']
87+
end
88+
if rsync['folder']['group'] != nil
89+
group = rsync['folder']['group']
90+
end
8291
rsync['folder']['options'].each do |options|
8392
rsyncoptions.push(options)
8493
end
@@ -89,7 +98,9 @@ Vagrant.configure("2") do |config|
8998
end
9099
vmhost.vm.synced_folder rsync['folder']['host_folder'], rsync['folder']['vagrant_folder'], type: "rsync",
91100
rsync__args: rsyncoptions,
92-
rsync__exclude: rsyncexclude
101+
rsync__exclude: rsyncexclude,
102+
owner: owner,
103+
group: group
93104
end
94105
end
95106
## -*- end rsync folders -*-
@@ -113,13 +124,29 @@ Vagrant.configure("2") do |config|
113124
vmhost.vm.provider "virtualbox" do |vb|
114125
# RAM
115126
vb.memory = host['ram']
127+
# CPUS
128+
vb.cpus = host['cpu']
129+
# Extra Hard disk
130+
if host['extra_hard_disk']['create'] == true
131+
unless File.exist?(host['extra_hard_disk']['filepath'])
132+
vb.customize ['createhd', '--filename', host['extra_hard_disk']['filepath'], '--variant', 'Fixed', '--size', host['extra_hard_disk']['size'] * 1024]
133+
end
134+
135+
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', host['extra_hard_disk']['filepath']]
136+
end
116137
end
117138

118139
# Shell provision
119140
if host['provision']['script']['enable'] == true
120141
vmhost.vm.provision "shell", path: host['provision']['script']['path']
121142
end
122143

144+
# Permanent Shell provision
145+
if host['provision']['permanent_script']['enable'] == true
146+
vmhost.vm.provision "shell", path: host['provision']['permanent_script']['path'],
147+
run: 'always'
148+
end
149+
123150
# Ansible provision
124151
if host['provision']['ansible']['enable'] == true
125152
vmhost.vm.provision "ansible_local" do |ansible|

config/config.yaml.sample

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## ##
33
## GMdotnet ##
44
## Vagrant Multi Machine Virtualbox ##
5-
## Version 1.1.0 ##
5+
## Version 1.2.0 ##
66
## ##
77
## Config file ##
88
#######################################
@@ -19,6 +19,11 @@ gmdotnet:
1919
check_update: yes
2020
private_ip: 192.168.250.10
2121
ram: 1024
22+
cpu: 1
23+
extra_hard_disk:
24+
create: yes
25+
filepath: .vagrant/extradisk.vdi
26+
size: 30 # size in GB
2227
# PROVISION
2328
provision:
2429
ansible:
@@ -27,6 +32,9 @@ gmdotnet:
2732
script:
2833
enable: no
2934
path: "script/backup_database.sh"
35+
permanent_script:
36+
enable: no
37+
path: "script/backup_database.sh"
3038
# PLUGINS
3139
plugins:
3240
hostsupdater:
@@ -50,15 +58,21 @@ gmdotnet:
5058
# - folder:
5159
# host_folder: /mnt/mysync
5260
# vagrant_folder: /mnt/rsyncfolder
61+
# owner: vagrant
62+
# group: vagrant
5363
# options:
5464
# - "-a"
5565
# - "-r"
5666
# - "-v"
5767
# - "-z"
5868
# - "--delete"
69+
# exclude:
70+
# - ""
5971
# - folder:
6072
# host_folder: /mnt/extra/rsync2
6173
# vagrant_folder: /mnt/extra/rsync2
74+
# owner: vagrant
75+
# group: vagrant
6276
# options:
6377
# - "-a"
6478
# - "-r"

0 commit comments

Comments
 (0)