diff options
author | kwadronaut <kwadronaut@leap.se> | 2017-05-23 16:20:26 +0200 |
---|---|---|
committer | kwadronaut <kwadronaut@leap.se> | 2017-05-23 16:20:55 +0200 |
commit | 0e09968d8ed3f245a238306de43a037d0749fd5a (patch) | |
tree | 165d49dfb17d115dbb649ffe669064f2042bb527 /puppet/modules/site_config/manifests/params.pp | |
parent | 26be1f84de9efabf5fec1278401ae0c5538454d9 (diff) | |
parent | 40f7b49003594a1be8c0540a92292d7cfb63eb61 (diff) |
Merge branch 'varac/platform-vagrant_private_networking'
Diffstat (limited to 'puppet/modules/site_config/manifests/params.pp')
-rw-r--r-- | puppet/modules/site_config/manifests/params.pp | 13 |
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','') != '' { |