marvel-nccr / ansible-role-aiida

An ansible role that installs and configures AiiDA on Ubuntu.
Other
2 stars 5 forks source link

set up postgres db for user without sudo privileges #10

Closed ltalirz closed 4 years ago

ltalirz commented 6 years ago

Problem

Currently, the aiida role sets up the database using the postgres user https://github.com/marvel-nccr/quantum-mobile/blob/1a23171c38fa421653093ef29fc9e03112ef270f/roles/aiida/tasks/aiida-core.yml#L19-L31

This doesn't work, if the user regularuser that ansible takes for provisioning does not have sudo privileges.

Possible solutions

  1. Set the password of the postgres user and provide it to the role via a variable (should work) The problem: regularuser won't be able to make any changes to the DB!

  2. Install DB using regularuser - after all, it's really more of a per-user DB than a system-wide DB.

@giovannipizzi What do you say?

giovannipizzi commented 4 years ago

Not sure... Is there an easy way to support both behaviours and choose them with a config flag?

ltalirz commented 4 years ago

Many roles anyhow require sudo access currently (the aiida role as well). So, I'm not sure this is really an issue at the moment. I'm going to close.