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.

[email protected]:~$ 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

When I use the Universal USB trouble

1  Asked on January 6, 2022 by seth-audet


Cannot install virtualbox 5.1 on Ubuntu 17.04

2  Asked on January 6, 2022 by an-unknown-developer


Updated my system, now VMWare can’t update its kernel modules

1  Asked on January 6, 2022 by will-matheson


I broke MySQL and can’t figure out what’s wrong

0  Asked on January 6, 2022 by abdul-hakeem


Fix root permission

1  Asked on January 6, 2022


How to substitue Calibri Regular with Calibri ligth

1  Asked on January 6, 2022 by martien-lubberink


Ask a Question

Get help from others!

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