I am preparing for the EX294 exam. The Red Hat exams allow usage of the manual pages, but no internet documentation.
When creating an Ansible Inventory file there are loads of possible variables and it would be easy to forget one or make a typo. I know it would be possible to look at an example (e.g. /etc/ansible/hosts), yet this won’t show common variables, like ansible_ssh_private_key_file.
Where can I find the documentation about the inventory file from within controller?
During the EX294 I will most likely have access to multiple VM’s. I expect I will have to configure one of them as a controller by installing the Ansible package.
So my question would be where I can find the documentation about the inventory file on the VM with the Ansible package installed without connectivity to the internet.
I’m unfamiliar with the rules for that exam, TBH. I’d expect that you’d be allowed access to the ansible docs, which are on-line. Certainly there are better docs for other packages But what they supply is what you’ll have to use.
Thanks for your reply. There won’t be any internet documentation.
Luckily I can retrieve all documentation for modules using ansible-doc . Maybe someone else knows where to get the offline documentation about inventory files.
Rein,
Were you able to get the inventory documentation to work via ansible-doc? It seems broken for both my local install and in the KodeKloud instances:
[thor@ansible-controller ~]$ ansible-doc ansible.builtin.ini
[WARNING]: ansible.builtin.ini was not found
[thor@ansible-controller ~]$ ansible-doc ini
[WARNING]: ini was not found
ansible-doc works fine for everything else, such as “ansible-doc replace”, etc.
And, I believe you are correct, during EX294 I believe we only have access to ansible-doc, not the ansible documentation website.
I’m a bit concerned about EX294 asking for some variable be placed in the inventory file and me not being able to remember it.
I actually found an even easier solution. Rather than building a config file myself. I just let Ansible build one for me with all settings disabled. The only thing I had to do is enable the settings I wanted .
I passed with a score of 270/300. It was a very rough and long exam, but well worth studying for.
The command I used to generate the config file was:
That’s great, thanks for sharing how to generate the .cfg, and very glad you passed!
How did that help with the inventory file question you posed (for vars like ansible_ssh_private_key_file)? I’m not seeing that ansible-config init generates any inventory file template.
You won’t have to learn any system variables since they are already present in the config file. The ssh_private_key_file has an equivalent in the config file for example.
So for learning about the inventory file, learn about the basics. Just define the hosts and put them into groups. Also be sure to know how to nest groups.