summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config/manifests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-05-21 23:28:20 +0200
committervarac <varacanero@zeromail.org>2017-05-23 11:35:13 +0200
commit61252fe74c8ec3668af551fb0b0b91f1bfa4705a (patch)
tree42ceb26cd317c8c567d49654b316e38ad612f3be /puppet/modules/site_config/manifests
parent26be1f84de9efabf5fec1278401ae0c5538454d9 (diff)
[vagrant] Use eth1 on vagrant if present
Virtualbox adds eth1 as second interface when private networking is enabled. - Related: #7769
Diffstat (limited to 'puppet/modules/site_config/manifests')
-rw-r--r--puppet/modules/site_config/manifests/params.pp13
1 files changed, 11 insertions, 2 deletions
diff --git a/puppet/modules/site_config/manifests/params.pp b/puppet/modules/site_config/manifests/params.pp
index 012b3ce0..4627515a 100644
--- a/puppet/modules/site_config/manifests/params.pp
+++ b/puppet/modules/site_config/manifests/params.pp
@@ -1,3 +1,4 @@
+# Default parameters
class site_config::params {
$ip_address = hiera('ip_address')
@@ -6,8 +7,16 @@ class site_config::params {
$environment = hiera('environment', undef)
- if $environment == 'local' {
- $interface = 'eth1'
+ if $::vagrant {
+ # Depending on the backend hypervisor networking is setup differently.
+ if $::interfaces =~ /eth1/ {
+ # Virtualbox: Private networking creates a second interface eth1
+ $interface = 'eth1'
+ }
+ else {
+ # KVM/Libvirt: Private networking is done by defauly on first interface
+ $interface = 'eth0'
+ }
include site_config::packages::build_essential
}
elsif hiera('interface','') != '' {