Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/local/bin/gxadmin: line 332: psql: command not found #3

Open
lecorguille opened this issue Mar 19, 2020 · 1 comment
Open

/usr/local/bin/gxadmin: line 332: psql: command not found #3

lecorguille opened this issue Mar 19, 2020 · 1 comment

Comments

@lecorguille
Copy link
Member

On your side, how do you use gxadmin?
As the galaxy user or as root?

Because psql isn't install for root. So should we make this role install the postgresql-client?

Plus, it could be cool to set this file ~/.pgpass, since if the role is integrated with the main galaxy one, we have all the necessary variable to fill it.

@hexylena
Copy link
Member

Hey @lecorguille

As the galaxy user or as root?

We use it as the galaxy and telegraf users.

Because psql isn't install for root

In that case, I guess just set the path so psql is available?

So should we make this role install the postgresql-client?

I've been avoiding doing that, because of all the different names per OS and not wanting to deal with that, leaving it up to the choice of the admin a bit.

~/.pgpass

yeah! I tried doing that before but hadn't found a great solution to it? E.g. in this custom role here https://github.com/usegalaxy-eu/infrastructure-playbook/blob/4714cdcca7ddae3257bca61c198e69bc0fcd1689/roles/hxr.postgres-connection/tasks/main.yml but I'm not happy with it for other users, what if I overwrite their pgpass file? I don't know.

kysrpex added a commit to kysrpex/usegalaxy-eu-ansible that referenced this issue Dec 15, 2023
…rently

It is a time sink and very annoying to have to re-run playbooks until no more "command not found" errors appear because of forgetting to install role dependencies (meaning system packages, not other roles). See issue galaxyproject/ansible-gxadmin#3 for an example of someone complaining about this recurring problem.

I thought of creating a role called "usegalaxy_eu.packages" that alleviates this problem. The idea is to define a list of the packages each role depends on in group_vars/all.yml (see the example below), then have the role check what other roles are imported in a play and install the corresponding dependencies.

```yaml
# Ansible role package dependencies (managed by usegalaxy_eu.packages)
packages:
  usegalaxy_eu.handy.os_setup:
    - findutils
  galaxyproject.gxadmin:
    - git
    - make
    - "postgresql{{ '-client' if ansible_os_family == 'Debian' }}"
  usegalaxy-eu.bashrc:
    - python3-psycopg2
    - python3-pyyaml
```

The idea to create this role stems just from stumbling upon the problem. See galaxyproject/ansible-gxadmin#11 for an additional discussion on the topic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants