Hello everyone,
I'm preparing for the exam. And using the command "ansible-navigator doc ansible.builtin.lineinfile" to search for the documentation of the lineinfile module, I would like to search for the examples in the doc, but I see that you can't use the shortcut '/examples' or '/EXAMPLES', as you can use the other command "ansible-doc".
Inside 'ansible-navigator doc' and then ':help' I see that you can use a filter, like ':f examples' but it doesn't find anything, it's like it doesn't execute anything.
Could someone tell me how to search for a word in the documentation in "ansible-navigator doc"?
Thanks!
you have a couple of options:
1. use the stdout mode for ansible-navigator (-m stdout). This will bring up the documentation in your preferred pager app. You can then use normal search methods like / to find keywords.
2. generally the examples are at or near the end of the pages. if not using stdout go to the bottom for the examples; as is the case with lineinfile you mentioned.
I personally prefer the ansible-navigator doc -m stdout as it allows you to use your preferred pager and familiar with its functions already.
Hello.
I have already found the solution ! and it is a really good one
To go directly to the examples at the bottom of ansible-navigator interface we can use this:
:{{ examples }} and then press [ENTER]
I hope this helps you.
Regards,
Roberto
you have a couple of options:
1. use the stdout mode for ansible-navigator (-m stdout). This will bring up the documentation in your preferred pager app. You can then use normal search methods like / to find keywords.
2. generally the examples are at or near the end of the pages. if not using stdout go to the bottom for the examples; as is the case with lineinfile you mentioned.
I personally prefer the ansible-navigator doc -m stdout as it allows you to use your preferred pager and familiar with its functions already.
I prefer the 'ansible-navigator doc -m stdout' too and then '/ EXAMPLES:'
Thanks.
Hello.
I have already found the solution ! and it is a really good one
To go directly to the examples at the bottom of ansible-navigator interface we can use this:
:{{ examples }} and then press [ENTER]
I hope this helps you.
Regards,
Roberto
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.