"Peer authentication failed for user gis" in Add postgis extension
The role was tested on a VM installed with Debian 10 64-bits.
Ssh connection was enabled between my host machine and the guest machine following the steps described herebelow (for reference)
Then, this playbook was launched:
- hosts:
- vm-debian
roles:
- role: tile-server-role
vars:
osm_carto_version: v5.1.0
with this config in /etc/ansible/hosts
:
vm-debian ansible_port=2222 ansible_host=127.0.0.1 ansible_user=root ansible_ssh_pass=YOURVMROOTPASSWORD ansible_python_interpreter=/usr/bin/python3 ansible_sudo_pass=YOURVMROOTPASSWORD
The error is :
TASK [tile-server-role : Add postgis extension] ***************************************************************************************************************************
fatal: [vm-debian]: FAILED! => {"changed": false, "msg": "unable to connect to database: FATAL: Peer authentication failed for user \"gis\"\n"}
For reference:
1) Set up a VM with VirtualBox
- with 4096 RAM
- with a dynamically allocated disk up to 20 Go (not less!)
- with a Debian 10.3.0
2) Enable SSH connection between host and guest VM
2.1) On the VM (guest)
cfr https://dev.to/yassineselllami/how-to-ssh-into-ubuntu-vm-virtualbox-from-host-machine-1kii & https://linuxhint.com/ssh_virtualbox_guest/
sudo apt install openssh-server ufw
sudo systemctl status ssh
sudo apt install ufw
sudo ufw status
if ufw is inactive:
sudo ufw allow ssh
sudo ufw enable
Open the ssh on the VM
"If you trust your local network, then you can use the less secure method of using your UNIX password, to ssh into your VM. Open up the file /etc/ssh/sshd_config on your VM and replace the line:"
#PasswordAuthentication no
To
PasswordAuthentication yes
"The default setting in Debian (and hence Ubuntu) for OpenSSH Server is to deny password-based login for root and allow only key-based login. Change this line in /etc/ssh/sshd_config:"
PermitRootLogin without-password
to
PermitRootLogin yes
Once that is in place, restart your SSH server.
sudo systemctl restart sshd
2.2) Settings VirtualBox:
◦ network > port forwarding (cfr https://linuxhint.com/ssh_virtualbox_guest/)
▪ rule name = "ssh", "Protocol' = "TCP", "Host port" = 2222, "Guest port" = 22.
To known the guest IP, type “sudo ip a” on the VM:
It was 10.0.2.15