Skip to content

Commit

Permalink
Merge pull request #1782 from marcosgdf/vagrant
Browse files Browse the repository at this point in the history
Updated Vagrant Puphpet box
  • Loading branch information
eldy committed Jul 30, 2014
2 parents 141895b + 0b31bfc commit d5db0ee
Show file tree
Hide file tree
Showing 119 changed files with 2,719 additions and 369 deletions.
57 changes: 56 additions & 1 deletion dev/vagrant/dolibarrdev/Vagrantfile
Expand Up @@ -23,6 +23,47 @@ Vagrant.configure("2") do |config|
end
end

if Vagrant.has_plugin?('vagrant-hostsupdater')
hosts = Array.new()

if !configValues['apache']['install'].nil? &&
configValues['apache']['install'].to_i == 1 &&
configValues['apache']['vhosts'].is_a?(Hash)
configValues['apache']['vhosts'].each do |i, vhost|
hosts.push(vhost['servername'])

if vhost['serveraliases'].is_a?(Array)
vhost['serveraliases'].each do |vhost_alias|
hosts.push(vhost_alias)
end
end
end
elsif !configValues['nginx']['install'].nil? &&
configValues['nginx']['install'].to_i == 1 &&
configValues['nginx']['vhosts'].is_a?(Hash)
configValues['nginx']['vhosts'].each do |i, vhost|
hosts.push(vhost['server_name'])

if vhost['server_aliases'].is_a?(Array)
vhost['server_aliases'].each do |x, vhost_alias|
hosts.push(vhost_alias)
end
end
end
end

if hosts.any?
contents = File.open("#{dir}/puphpet/shell/hostsupdater-notice.txt", 'r'){ |file| file.read }
puts "\n\033[34m#{contents}\033[0m\n"

if config.vm.hostname.to_s.strip.length == 0
config.vm.hostname = 'puphpet-dev-machine'
end

config.hostsupdater.aliases = hosts
end
end

data['vm']['synced_folder'].each do |i, folder|
if folder['source'] != '' && folder['target'] != ''
if folder['sync_type'] == 'nfs'
Expand Down Expand Up @@ -53,6 +94,9 @@ Vagrant.configure("2") do |config|
if key == "memory"
next
end
if key == "cpus"
next
end

if key == "natdnshostresolver1"
value = value ? "on" : "off"
Expand All @@ -62,6 +106,7 @@ Vagrant.configure("2") do |config|
end

virtualbox.customize ["modifyvm", :id, "--memory", "#{data['vm']['memory']}"]
virtualbox.customize ["modifyvm", :id, "--cpus", "#{data['vm']['cpus']}"]

if data['vm']['hostname'].to_s.strip.length != 0
virtualbox.customize ["modifyvm", :id, "--name", config.vm.hostname]
Expand All @@ -77,11 +122,15 @@ Vagrant.configure("2") do |config|
if key == "memsize"
next
end
if key == "cpus"
next
end

v.vmx["#{key}"] = "#{value}"
end

v.vmx["memsize"] = "#{data['vm']['memory']}"
v.vmx["numvcpus"] = "#{data['vm']['cpus']}"

if data['vm']['hostname'].to_s.strip.length != 0
v.vmx["displayName"] = config.vm.hostname
Expand All @@ -97,11 +146,15 @@ Vagrant.configure("2") do |config|
if key == "memsize"
next
end
if key == "cpus"
next
end

v.customize ["set", :id, "--#{key}", "#{value}"]
end

v.memory = "#{data['vm']['memory']}"
v.cpus = "#{data['vm']['cpus']}"

if data['vm']['hostname'].to_s.strip.length != 0
v.name = config.vm.hostname
Expand All @@ -119,7 +172,8 @@ Vagrant.configure("2") do |config|
kg.path = "puphpet/shell/ssh-keygen.sh"
kg.args = "#{ssh_username}"
end
config.vm.provision :shell, :path => "puphpet/shell/update-puppet.sh"
config.vm.provision :shell, :path => "puphpet/shell/install-ruby.sh"
config.vm.provision :shell, :path => "puphpet/shell/install-puppet.sh"

config.vm.provision :puppet do |puppet|
puppet.facter = {
Expand Down Expand Up @@ -183,3 +237,4 @@ Vagrant.configure("2") do |config|

end


7 changes: 1 addition & 6 deletions dev/vagrant/dolibarrdev/puphpet/.gitattributes
Expand Up @@ -2,9 +2,4 @@
* text=auto

# Force the following filetypes to have unix eols, so Windows does not break them
*.pp text eol=lf
*.sh text eol=lf
*.yaml text eol=lf
Puppetfile text eol=lf
.bash_aliases text eol=lf
.vimrc text eol=lf
*.* text eol=lf
16 changes: 10 additions & 6 deletions dev/vagrant/dolibarrdev/puphpet/config.yaml
Expand Up @@ -5,6 +5,7 @@ vagrantfile-local:
box_url: puphpet/debian75-x64
hostname: null
memory: '512'
cpus: '1'
chosen_provider: virtualbox
network:
private_network: 192.168.42.101
Expand All @@ -29,7 +30,7 @@ vagrantfile-local:
- '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
- '--parser future'
synced_folder:
jopH6005bn96:
w6GqzzS2a7lu:
source: ../../../
target: /var/www/dolibarr
sync_type: default
Expand Down Expand Up @@ -63,8 +64,7 @@ mailcatcher:
smtp_port: 1025
http_ip: 0.0.0.0
http_port: '1080'
mailcatcher_path: /usr/local/bin
log_path: /var/log/mailcatcher/mailcatcher.log
mailcatcher_path: /usr/local/rvm/wrappers/default
firewall:
install: '1'
rules: null
Expand All @@ -81,7 +81,7 @@ apache:
- php
- rewrite
vhosts:
b2tOrs1TMtoF:
syTi8VestVdG:
servername: dev.dolibarr.org
docroot: /var/www/dolibarr/htdocs
port: '80'
Expand All @@ -98,8 +98,12 @@ apache:
mod_spdy: 0
nginx:
install: 0
settings:
default_vhost: 1
proxy_buffer_size: 128k
proxy_buffers: '4 256k'
vhosts:
0dU5luf5AnIe:
kZiLLcLAIVAF:
server_name: awesome.dev
server_aliases:
- www.awesome.dev
Expand Down Expand Up @@ -154,7 +158,7 @@ mysql:
root_password: root
adminer: 0
databases:
V6H3W2FVB7Yq:
HHTBm64g1siG:
grant:
- ALTER
- CREATE
Expand Down

0 comments on commit d5db0ee

Please sign in to comment.