I am looking to create a inventory YAML file specifying localhost.
I have tried
all:
hosts:
localhost:
ansible_connection: local
all:
hosts:
localhost
but I get an error about using ssh
I found the following command ansible-inventory -i inventory.ini -y --list > inventory.yaml that converts ini files to yaml. I created an ini file with:
localhost ansible_connection=local
ran the command and got the following output that worked when I ran my playbook
all:
children:
ungrouped:
hosts:
localhost:
ansible_connection: local
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With