In my journey of learning ansible, I come across playbooks written to target localhost - and I am trying to figure out how to run such playbooks against the inventory file /etc/ansible/hosts.
One example here: https://github.com/ReinerNippes/nextcloud/tree/nextcloud-reloaded
I have tried changing the host in the host groups defined in the inventory file to my target host like:
ansible_host=192.168.50.130 # my target test node
This gives the error:
fatal: [ansible_host=192.168.50.130]: FAILED! =>
msg: ‘’‘ansible_pkg_mgr’’ is undefined. ‘‘ansible_pkg_mgr’’ is undefined’
If I try to run it against my inventory with the -i switch, I get:
[WARNING]: Could not match supplied host pattern, ignoring: nc
Anyone know the correct way to target the default inventory file? Or at least define the target host so it doesn’t run on my ansible node? The example playbook above runs fine, as long as I run it from within the target node. But would like to run them remotely against test containers. I usually just write small plays, so I am quite green with playbooks with many roles.
Thanks!