Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH fail during node_exporter installation #179

Open
lykholat opened this issue Aug 2, 2023 · 4 comments
Open

SSH fail during node_exporter installation #179

lykholat opened this issue Aug 2, 2023 · 4 comments

Comments

@lykholat
Copy link

lykholat commented Aug 2, 2023

Hello the node exporter installation is failing during this part:
TASK [prometheus.prometheus.node_exporter : Download node_exporter binary to local folder] ************************
fatal: [...*]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ubuntu@localhost: Permission denied (publickey).", "unreachable": true}

I tried this line and no errors were obtained but the installation ended up being moved to the provisioning machine and not in the target:
ansible-playbook nodeexp.yml -i inventory --connection=local

I'm using the simplest example of playbook and all the other tasks executed fine

  • hosts: targets
    become: true
    roles:
    • prometheus.prometheus.node_exporter
@lykholat
Copy link
Author

lykholat commented Aug 8, 2023

Issue solved by modifying the install.yml file. I removed all lines that say "delegate_to: localhost"

@gardar
Copy link
Member

gardar commented Aug 16, 2023

Do you have the hostname "localhost" in your ansible inventory? Ansible should default to a local connection and not ssh for localhost.

Passing --connection=local to ansible-playbook is not ideal as it will attempt to use the local connection for all of the targets.
instead, you could do something like this in your inventory:

localhost ansible_connection=local

@Ezzahhh
Copy link

Ezzahhh commented Sep 6, 2023

Also ran into this and rolled back to 0.5.1 for now. I don't have any localhost in inventory as far as I can see
Maybe we could have a PR to add connection: local to those steps?

@N07070
Copy link

N07070 commented Oct 12, 2023

I'm having the same issue, with the following inventory:

server:
  hosts:
    server.example.com:
  children:
    gitea:
    nextcloud:
    transmission:
    status:

other:
  hosts:
    localhost:

localhost:
  ansible_connection: local

# What --------------------

status:
  hosts:
    status.example.com:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants