System Description
I am building a custom QEMU image (Ubuntu 24.04 LTS) which has ansible and ansible-runner.
I have a testing logic where I use pytest
and I use fixtures as small runner projects that I wish to execute in order to conduct tests.
I have two use-cases:
- Single Instance (
localhost
) - Multiple Devices
My test playbooks need to be diverse in the sense that they need to be executed on a single host (localhost
) as well as multiple devices.
For that reason, I have hosts: all
and no connection: local
. During my test fixtures I create an inventory e.g.inventory/hosts
file and the content for single device is localhost
.
However, I keep getting the error:
failed to connect to the host via SSH: admin@localhost: Permission Denied (publickey, password).'
What would be an optimal way to make my testing playbook more versatile in order to use it for localhost and multiple devices without changing the playbook content.