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
71f72b65
Commit
71f72b65
authored
9 years ago
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11432 from sivel/splitext-filter
Add splitext filter
parents
9341148f
4059904a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
docsite/rst/playbooks_filters.rst
+5
-0
lib/ansible/plugins/filter/core.py
+1
-0
No files found.
docsite/rst/playbooks_filters.rst
View file @
71f72b65
...
@@ -350,6 +350,11 @@ To get the relative path of a link, from a start point (new in version 1.7)::
...
@@ -350,6 +350,11 @@ To get the relative path of a link, from a start point (new in version 1.7)::
{{ path | relpath('/etc') }}
{{ path | relpath('/etc') }}
To get the root and extension of a path or filename (new in version 2.0)::
# with path == 'nginx.conf' the return would be ('nginx', '.conf')
{{ path | splitext }}
To work with Base64 encoded strings::
To work with Base64 encoded strings::
{{ encoded | b64decode }}
{{ encoded | b64decode }}
...
...
This diff is collapsed.
Click to expand it.
lib/ansible/plugins/filter/core.py
View file @
71f72b65
...
@@ -316,6 +316,7 @@ class FilterModule(object):
...
@@ -316,6 +316,7 @@ class FilterModule(object):
'expanduser'
:
partial
(
unicode_wrap
,
os
.
path
.
expanduser
),
'expanduser'
:
partial
(
unicode_wrap
,
os
.
path
.
expanduser
),
'realpath'
:
partial
(
unicode_wrap
,
os
.
path
.
realpath
),
'realpath'
:
partial
(
unicode_wrap
,
os
.
path
.
realpath
),
'relpath'
:
partial
(
unicode_wrap
,
os
.
path
.
relpath
),
'relpath'
:
partial
(
unicode_wrap
,
os
.
path
.
relpath
),
'splitext'
:
partial
(
unicode_wrap
,
os
.
path
.
splitext
),
# failure testing
# failure testing
'failed'
:
failed
,
'failed'
:
failed
,
...
...
This diff is collapsed.
Click to expand it.
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