I'm using vagrant to setup a new Ubuntu machine. With provisioning I'm in the need to create a new postgres user. Currently I'm using:
sudo su postgres
createuser -P myuser
Unfortunately provisioning fails because a prompt needs to be filled with password (-P
flag).
Is there a way to pass the password to createuser
like createuser myuser --password test
or echo test | createuser -P myuser
?
sudo -u postgres
psql -c "create role NewRole with login password 'secret';"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With