Skip to content

Commit

Permalink
Add aliases and always run options (#342)
Browse files Browse the repository at this point in the history
* Add option to run commands always on startup

Add option to run commands always on startup, not just pre/post provision.

* Allow alias definition

Allow users to define multiple domains with hostsupdater aliases. Especially useful for WordPress multisite.
  • Loading branch information
hegemanjr authored and miya0001 committed Mar 31, 2019
1 parent 79a773b commit 73e1d64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Vagrant.configure(2) do |config|
SharedFoldersEnableSymlinksCreate: false

if Vagrant.has_plugin?('vagrant-hostsupdater')
config.hostsupdater.aliases = _conf['hostname_aliases']
config.hostsupdater.remove_on_suspend = true
end

Expand Down Expand Up @@ -115,4 +116,8 @@ Vagrant.configure(2) do |config|
if File.exists?(File.join(File.dirname(__FILE__), 'provision-post.sh')) then
config.vm.provision :shell, :privileged => false, :path => File.join( File.dirname(__FILE__), 'provision-post.sh' )
end

if File.exists?(File.join(File.dirname(__FILE__), 'run-always.sh')) then
config.vm.provision :shell, :path => File.join( File.dirname(__FILE__), 'run-always.sh' ), run: 'always'
end
end
8 changes: 8 additions & 0 deletions provision/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ cpus: 1
hostname: vccw.test
ip: 192.168.33.10

#
# Vagrant Hostsupdater Aliases
# Manage additional entries in the /etc/hosts file using vagrant-hostsupdater
#
hostname_aliases:
- www.vccw.test
# - some.subdomain.vccw.test

#
# WordPress Settings
#
Expand Down

0 comments on commit 73e1d64

Please sign in to comment.