diff options
author | varac <varacanero@zeromail.org> | 2017-05-23 13:28:54 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2017-05-23 14:19:50 +0200 |
commit | 85c0f8a67188902c36558d97651c2801849112f1 (patch) | |
tree | bc02723bb4a695c138b1e55b7ed53a9d9cac36a7 /tests/example-provider/vagrant/configure-leap.sh | |
parent | d2dc27738a26b824f42da3fdea527be072867678 (diff) |
[vagrant] Use private networking IP from eth1 if present
Diffstat (limited to 'tests/example-provider/vagrant/configure-leap.sh')
-rwxr-xr-x | tests/example-provider/vagrant/configure-leap.sh | 11 |
1 files changed, 10 insertions, 1 deletions
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 |