cancel
Showing results for 
Search instead for 
Did you mean: 
Dave_ross
Mission Specialist
Mission Specialist
  • 2,269 Views

Ansible-doc for filters

Jump to solution

Hello, Community

I was looking for documentation for ansible-pligins by CLI, but it happends that in version of ansible i can´t consult them, `ansible-doc -t filter ipaddr` i ran the next command, but it shows an error that option doesent exists in this ansible version. it's there any option, package, etc, to be setted or installed to consult them by CLI, or not?.

 

kind regards!!

2 Solutions

Accepted Solutions
dkcbk
Flight Engineer
Flight Engineer
  • 2,246 Views

Hi @Dave_ross

Every plugin/filter/module has documentation. ipaddr filter is part of the ansible.utils collection. You can find the documentation like this:

$ ansible-navigator collections (use execution environment image which has ansible.utils collection, e.g. ee-supported-rhel8)

Screenshot 2023-09-22 at 13.25.21.png

As you can see, ansible.utils collection has number 7, so type "7"

Find ipaddr filter, as you can see it has number 7 (you can type :f ipaddr)

Screenshot 2023-09-22 at 13.27.55.png

Then type 0

Screenshot 2023-09-22 at 13.31.07.png

Here you can find documentation for the mentioned filter and examples.

Screenshot 2023-09-22 at 13.32.53.png

 

Another way to find documentation is to manually download the collection. Filters are placed in plugins sub-dir of the collection's dir. There is a README.md file there that contains documentation and examples.

View solution in original post

Travis
Moderator
Moderator
  • 1,479 Views

@Chetan_Tiwary_ -

So currently, we can't use the "/" for searching in the ansible-navigator interactive mode. If you want to do things like that you can use STDOUT mode and the cli. If you are in navigator, you're stuck with the features and functions provided.

There is and might be a way in the future as I thought this had been something reported, so it was added to the project board in 2023.

https://github.com/ansible/ansible-navigator/issues/441

Even if this would get resolved in a new version of Navigator, it wouldn't make it into the current version of the RH294 Ansible course as it won't have packages changed until the next update and newer Ansible Navigator versions take time to make it into the official supported AAP2 channels.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training

View solution in original post

9 Replies
darek
Flight Engineer Flight Engineer
Flight Engineer
  • 2,258 Views
dkcbk
Flight Engineer
Flight Engineer
  • 2,247 Views

Hi @Dave_ross

Every plugin/filter/module has documentation. ipaddr filter is part of the ansible.utils collection. You can find the documentation like this:

$ ansible-navigator collections (use execution environment image which has ansible.utils collection, e.g. ee-supported-rhel8)

Screenshot 2023-09-22 at 13.25.21.png

As you can see, ansible.utils collection has number 7, so type "7"

Find ipaddr filter, as you can see it has number 7 (you can type :f ipaddr)

Screenshot 2023-09-22 at 13.27.55.png

Then type 0

Screenshot 2023-09-22 at 13.31.07.png

Here you can find documentation for the mentioned filter and examples.

Screenshot 2023-09-22 at 13.32.53.png

 

Another way to find documentation is to manually download the collection. Filters are placed in plugins sub-dir of the collection's dir. There is a README.md file there that contains documentation and examples.

Dave_ross
Mission Specialist
Mission Specialist
  • 2,233 Views

Nice!, thanks for the documentation!.

0 Kudos
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,484 Views

@dkcbk @Travis is there a way we can check the documentation in interactive mode without scrolling just like we can use   search option in man pages like /EXAMPLE  to get straightaway to the example usages , for example filter ansible.utils.ipaddr - how can I do that ?

0 Kudos
Travis
Moderator
Moderator
  • 1,480 Views

@Chetan_Tiwary_ -

So currently, we can't use the "/" for searching in the ansible-navigator interactive mode. If you want to do things like that you can use STDOUT mode and the cli. If you are in navigator, you're stuck with the features and functions provided.

There is and might be a way in the future as I thought this had been something reported, so it was added to the project board in 2023.

https://github.com/ansible/ansible-navigator/issues/441

Even if this would get resolved in a new version of Navigator, it wouldn't make it into the current version of the RH294 Ansible course as it won't have packages changed until the next update and newer Ansible Navigator versions take time to make it into the official supported AAP2 channels.

Travis Michette, RHCA XIII
https://rhtapps.redhat.com/verify?certId=111-134-086
SENIOR TECHNICAL INSTRUCTOR / CERTIFIED INSTRUCTOR AND EXAMINER
Red Hat Certification + Training
Chetan_Tiwary_
Community Manager
Community Manager
  • 1,472 Views

thanks @Travis for clearing this up!

0 Kudos
anthonywongibm
Mission Specialist
Mission Specialist
  • 1,714 Views

but many filter cannot find in the method, e.g. e64encode, so it;s not in builtin now?

Bytesalat
Mission Specialist
Mission Specialist
  • 1,705 Views

Even "ansible-doc --type filter ansible.builtin.b64encode" (without execution environments) doesn't work for you?

Roldo
Mission Specialist
Mission Specialist
  • 1,693 Views

AFAIK, the "filter" type is not available in the version of ansible available in the course and the exam (ansible core 2.13.4).

Join the discussion
You must log in to join this conversation.