Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
25ef581a
Commit
25ef581a
authored
Feb 21, 2015
by
Maciej Delmanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic examples of ipaddr filter use
parent
71dae62b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
docsite/rst/playbooks_filters_ipaddr.rst
+20
-3
No files found.
docsite/rst/playbooks_filters_ipaddr.rst
View file @
25ef581a
...
...
@@ -27,7 +27,15 @@ Basic tests
``ipaddr()`` is designed to return the input value if a query is True, and
``False`` if query is False. This way it can be very easily used in chained
filters. Here are some example tests of various input strings::
filters. To use the filter, pass a string to it::
{{ '192.0.2.0' | ipaddr }}
You can also pass the values as variables::
{{ myvar | ipaddr }}
Here are some example tests of various input strings::
# These values are valid IP addresses or network ranges
'192.168.0.1' -> 192.168.0.1
...
...
@@ -46,8 +54,17 @@ filters. Here are some example tests of various input strings::
'fe80:/10' -> False
Sometimes you need either IPv4 or IPv6 addresses. To filter only for particular
type, ``ipaddr()`` filter has two "aliases", ``ipv4()`` and ``ipv6()``. Here's
an example test to look for IPv4 addresses::
type, ``ipaddr()`` filter has two "aliases", ``ipv4()`` and ``ipv6()``.
Example us of an IPv4 filter::
{{ myvar | ipv4 }}
And similar example of an IPv6 filter::
{{ myvar | ipv6 }}
Here's an example test to look for IPv4 addresses::
'192.168.0.1' -> 192.168.0.1
'192.168.32.0/24' -> 192.168.32.0/24
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment