Closed acdoussan closed 1 year ago
Turns out I did several things wrong here.
First, I was trying to use a non-existent inventory file (I was running ansible-playbook site.yml -i inventory/my-cluster/hosts.ini
, no my-cluster folder exists, not sure how I ended up with that, maybe something wrong with tab completion).
Second, the ansible-inventory --list
reads the ansible.cfg
file, which is configured by default with ./hosts.ini
, which doesn't exist.
Might be good to update the ansible.cfg to point to the sample hosts.ini, but otherwise I think this can be closed, this was just an operator error.
It seems like you partially followed the docs :) All good! I will close this https://docs.technotim.live/posts/k3s-etcd-ansible/
When running the ansible playbook, either with the default hosts.ini or one modified to have the right ips, I get the following.
hosts.ini contains:
Expected Behavior
the provided example should work
Current Behavior
The provided example does not work.
Steps to Reproduce
ansible-inventory --list
Context (variables)
Operating system: MacOS 12.6 Montery
Ansible version:
Hardware: N/A
Variables Used
all.yml
Hosts
host.ini
Possible Solution
I tried running
chmod 744
on the hosts.ini file, no difference. ref: https://bobcares.com/blog/ansible-unable-to-parse-as-an-inventory-source/