Dave_ross
Mission Specialist
Mission Specialist
  • 545 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!!

1 Solution

Accepted Solutions
dkcbk
Flight Engineer
Flight Engineer
  • 522 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

3 Replies
darek
Flight Engineer Flight Engineer
Flight Engineer
  • 534 Views
0 Kudos
dkcbk
Flight Engineer
Flight Engineer
  • 523 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
  • 509 Views

Nice!, thanks for the documentation!.

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