I have a bare-bones Ansible playbook that I’m trying to run for all hosts in an inventory group, but it doesn’t seem to be working correctly. It always seems to work for at least one host, sometimes two, but never for all of them. I’ve also noticed that, when I try to run it on the group (or a list of hosts), it pauses after the first host until I hit enter, then shows the others as unreachable (permission denied).
If I replace the group name with any of the individual hosts it runs fine, but trying to run more than one causes the problem. I can also ssh into all of them with the key I’m using.
My inventory file looks something like this:
dev:
hosts:
host1:
ansible_host: 1.2.3.4
host2:
ansible_host: 1.2.3.5
host3:
ansible_host: 1.2.3.6
host4:
ansible_host: 1.2.4.4
east:
hosts:
host1:
host2:
host3:
vars:
ansible_ssh_private_key_file: "/path/to/key"
ansible_user: auser
and this is the playbook I’m trying to run to test with:
---
- name: Test
hosts:
east
tasks:
- name: Ping
ansible.builtin.ping: