BryanDavis has uploaded a new change for review.
https://gerrit.wikimedia.org/r/232531
Change subject: Add provider based hiera settings and use with LXC
......................................................................
Add provider based hiera settings and use with LXC
Add a new 'provider' level of hiera lookup that allows setting different
hiera settings based on the Vagrant provider used to create the VM. The
first concrete use case for this is disabling cachefilesd inside the VM
when the provider is LXC.
Also allow specifying the 'environment' hiera level via a 'MWV_ENVIRONMENT'
environment variable. This will allow the Puppet configuration for
running MediaWiki-Vagrant in the Wikimedia Labs environment to switch
the environment similarly to the way that the `labs-vagrant` command
does.
Bug: T107146
Change-Id: I36a0c7af1cd4125e4b699933c5d5bb5fb766ba12
---
M Vagrantfile
M puppet/hiera.yaml
A puppet/hieradata/provider/lxc.yaml
3 files changed, 21 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
refs/changes/31/232531/1
diff --git a/Vagrantfile b/Vagrantfile
index e09d61e..9028f6b 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -66,6 +66,9 @@
override.vm.box_download_insecure = true
override.vm.network :private_network, ip: settings[:static_ip]
+
+ # https://github.com/mitchellh/vagrant/issues/1867
+ settings[:provider] = 'virtualbox'
end
# VMWare Fusion provider. Enable with `--provider=vmware_fusion`
@@ -73,6 +76,9 @@
override.vm.box = 'puppetlabs/ubuntu-14.04-64-puppet'
override.vm.network :private_network, ip: settings[:static_ip]
+
+ # https://github.com/mitchellh/vagrant/issues/1867
+ settings[:provider] = 'vmware_fusion'
end
# Microsoft Hyper-V provider. Enable with `--provider=hyperv`
@@ -89,12 +95,18 @@
override.vm.box = 'cirex/ubuntu-14.04'
override.vm.network :private_network, ip: settings[:static_ip]
+
+ # https://github.com/mitchellh/vagrant/issues/1867
+ settings[:provider] = 'hyperv'
end
# LXC provider. Enable wtih `--provider=lxc`
# Requires vagrant-lxc plugin and Vagrant 1.7+
config.vm.provider :lxc do |lxc, override|
override.vm.box = 'Wikimedia/trusty64-puppet-lxc'
+
+ # https://github.com/mitchellh/vagrant/issues/1867
+ settings[:provider] = 'lxc'
end
# Parallels provider. Enable with `--provider=parallels`
@@ -114,6 +126,9 @@
override.puppet_install.puppet_version = '3.7.4'
override.vm.network :private_network, ip: settings[:static_ip]
+
+ # https://github.com/mitchellh/vagrant/issues/1867
+ settings[:provider] = 'parallels'
end
config.vm.network :forwarded_port,
@@ -219,7 +234,8 @@
'git_user' => settings[:git_user],
'forwarded_port' => settings[:http_port],
'shared_apt_cache' => '/vagrant/cache/apt/',
- 'environment' => 'vagrant',
+ 'environment' => ENV['MWV_ENVIRONMENT'] || 'vagrant',
+ 'provider' => settings[:provider],
}
if settings[:http_port] != 80
diff --git a/puppet/hiera.yaml b/puppet/hiera.yaml
index 974c96f..f04bcad 100644
--- a/puppet/hiera.yaml
+++ b/puppet/hiera.yaml
@@ -7,5 +7,6 @@
- local
- vagrant-managed
- "environment/%{::environment}"
+ - "provider/%{::provider}"
- common
:logger: console
diff --git a/puppet/hieradata/provider/lxc.yaml
b/puppet/hieradata/provider/lxc.yaml
new file mode 100644
index 0000000..67fc3ef
--- /dev/null
+++ b/puppet/hieradata/provider/lxc.yaml
@@ -0,0 +1,3 @@
+---
+# Disable cachefilesd usage
+mwv::enable_cachefilesd: false
--
To view, visit https://gerrit.wikimedia.org/r/232531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I36a0c7af1cd4125e4b699933c5d5bb5fb766ba12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits