How to solve public key error when running Ansible playbook

Ask Ubuntu Asked by frank din on August 25, 2020

I’m using ubuntu 18 on GCP and I’m trying to run an ansible playbook. I’ve already successfully pinged my remote host but I get a connection error when trying to run the ansible playbook.

dinthebeatmaker@mastervmproj:~$ ansible-playbook project.yml --check            
PLAY [Hosts] *******************************************************************

TASK [Gathering Facts] *********************************************************
fatal: []: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: [email protected]: Permission denied (publickey).", "unreachable": true}

PLAY RECAP *********************************************************************                : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

Here’s the playbook

- hosts: Hosts
  become: yes
  - name: install java
     name: openjdk-8-jdk
     state: present
  - name: copy chromedriver
     src: /home/dinthebeatmaker
     dest: /home/dinthebeatmaker
     remote_src: yes
  - name: install chromium browser
     name: chromium-browser
     state: present

Add your own answers!

Related Questions

Teamviewer 11 won’t work on Ubuntu 20 Login Screen

1  Asked on November 23, 2021 by nikola-tepavac


Network interfaces not enabled at boot

1  Asked on November 23, 2021 by alexander-trauzzi


Clear swap on every shutdown

0  Asked on November 23, 2021 by corrupt_disk1


How to setup my Scarlett 2i2?

1  Asked on November 21, 2021 by bebel


GRUB not responding to keyboard

17  Asked on November 21, 2021 by brianw


Arrow Keys not working in GRUB

9  Asked on November 21, 2021 by user218937


Abort class-pclzip.php : Missing zlib extensions

2  Asked on November 21, 2021 by zkvvoob


Unattended-Upgrade::Automatic-Reboot default value

3  Asked on November 21, 2021 by stringer


Usb wifi dropped out / rtl8192eu-linux-driver on Ubuntu 16.04

1  Asked on November 21, 2021 by steve-mcgarry


Install mercusys wifi adapter in Ubuntu 20.04

1  Asked on November 21, 2021 by frostfox


Has ‘Ubuntu Software’ been renamed to ‘Snap Store’?

5  Asked on November 21, 2021 by mekacher-anis


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP