summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config/manifests/params.pp
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/site_config/manifests/params.pp')
-rw-r--r--puppet/modules/site_config/manifests/params.pp14
1 files changed, 11 insertions, 3 deletions
diff --git a/puppet/modules/site_config/manifests/params.pp b/puppet/modules/site_config/manifests/params.pp
index 012b3ce0..2c9687a3 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')
@@ -5,9 +6,16 @@ class site_config::params {
$ec2_local_ipv4_interface = getvar("interface_${::ec2_local_ipv4}")
$environment = hiera('environment', undef)
-
- if $environment == 'local' {
- $interface = 'eth1'
+ if str2bool("$::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','') != '' {