geerlingguy / ansible-role-drupal

Ansible Role - Drupal
https://galaxy.ansible.com/geerlingguy/drupal/
MIT License
92 stars 51 forks source link

Site install only supports a local PostgreSQL database #46

Closed yock closed 4 years ago

yock commented 7 years ago

https://github.com/geerlingguy/ansible-role-drupal/blob/master/tasks/install-site.yml#L11-L19

A remote instance would require a hostname and credentials to be passed to the psql command. The playbook currently becomes the Postgres user, which seems ideal for local database servers. I can think of two possible ways to support both local and remote PostgreSQL servers, though there may be more.

geerlingguy commented 7 years ago

Pass credentials to psql for local instances.

I'd rather not do that if possible, just because it can have some weird side-effects and also might break more frequently than using a become_user.

I would be okay with switching between two tasks, though—if Postgres is on a separate server, run a task that requires user/pass, but if it's on the same server, become the user.

We'd need to document this in the README of course. Good catch, though! So far, I haven't built any clusters with Postgres (only MySQL), that's why I haven't run into this bug myself yet.

yock commented 7 years ago

What do you think would be the definitive test for local vs remote? Is a check of the value set in drupal_db_host sufficient? Is there a more robust test? Or maybe a boolean that the user would set?

geerlingguy commented 7 years ago

@yock - If there's not something simple, I'd say maybe a boolean the user controls (the person using the role should know if they need to connect to a local instance or remote).

jonathangreen commented 7 years ago

+1

Just wanted to chime in that I am also having this problem with remote psql instances. I think the the Boolean option probably makes sense to let the user choose what they want.

stale[bot] commented 4 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 4 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.