From 85c0f8a67188902c36558d97651c2801849112f1 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 23 May 2017 13:28:54 +0200 Subject: [vagrant] Use private networking IP from eth1 if present --- tests/example-provider/vagrant/configure-leap.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/example-provider/vagrant/configure-leap.sh b/tests/example-provider/vagrant/configure-leap.sh index 2ea2f178..7a1efc71 100755 --- a/tests/example-provider/vagrant/configure-leap.sh +++ b/tests/example-provider/vagrant/configure-leap.sh @@ -33,7 +33,16 @@ chown "${USER}:${USER}" "${PROVIDERDIR}/files/nodes/${NODE}/${NODE}_ssh.pub" $LEAP add-user --self $LEAP cert ca $LEAP cert csr -$LEAP node add "$NODE" ip_address:"$(facter ipaddress)" couch.mode:plain services:"${services:?}" tags:production + +# Try to see if there's a private IP for eth1 +# Otherwise take eth0 +# (virtualbox and libvirt backends behave differenently setting up +# direct accessible private networks. +# see https://www.vagrantup.com/docs/networking/private_network.html +IP="$(facter ipaddress_eth1)" +[ "$IP" = '' ] && IP="$(facter ipaddress_eth0)" +$LEAP node add "$NODE" ip_address:"${IP}" couch.mode:plain services:"${services:?}" tags:production + echo '{ "webapp": { "admins": ["testadmin"] } }' > services/webapp.json $LEAP compile -- cgit v1.2.3