libre-ops / metabase

Ansible role for provisioning Metabase
https://galaxy.ansible.com/libre_ops/metabase
GNU General Public License v3.0
14 stars 7 forks source link

Use `metabase_host` var when doing api calls #6

Open sck-v opened 4 years ago

sck-v commented 4 years ago

I case when metabase_host is different than localhost, api calls fail

Matt-Yorkley commented 4 years ago

Hi @sck-v, what kind of setup are you using?

I tend to use nginx as a reverse proxy, with metabase running on localhost:3000 (on the remote server), then incoming requests to (for example) https://mymetabasehost.com get internally directed to the metabase instance. In this configuration, when Ansible runs the API call via SSH on the remote, Metabase is on http://localhost (from Ansible's position). It also means nginx can cleanly handle things like TLS certificates with Letsencrypt.

I'd be reluctant to merge this as it is, but maybe we could add a new variable metabase_api_host that defaults to localhost, and use that in the API tasks. Then you could override it as needed. How does that sound?

sck-v commented 4 years ago

Hey, @Matt-Yorkley

In the configuration i'm using, there is a local network and metabase is bound to ansible's local_address. Saying there are two hosts: 192.168.0.10 and 192.168.0.20

There is a nginx on 192.168.0.10 as a reverse proxy and a metabase on 192.168.0.20. I'm binding metabase to 192.168.0.20 to be available to nginx. That's why requests to localhosts are failing for me