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
d0350b19
Commit
d0350b19
authored
Aug 20, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12024 from jhawkesworth/win_splitdrive_filter
Add win_splitdrive filter for windows users
parents
04e26849
a46b5008
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
docsite/rst/playbooks_filters.rst
+12
-0
lib/ansible/plugins/filter/core.py
+1
-0
No files found.
docsite/rst/playbooks_filters.rst
View file @
d0350b19
...
...
@@ -342,6 +342,18 @@ To get the last name of a windows style file path (new in version 2.0)::
{{ path | win_basename }}
To separate the windows drive letter from the rest of a file path (new in version 2.0)::
{{ path | win_splitdrive }}
To get only the windows drive letter
{{ path | win_splitdrive | first }}
To get the rest of the path without the drive letter
{{ path | win_splitdrive | last }}
To get the directory from a path::
{{ path | dirname }}
...
...
lib/ansible/plugins/filter/core.py
View file @
d0350b19
...
...
@@ -254,6 +254,7 @@ class FilterModule(object):
'splitext'
:
partial
(
unicode_wrap
,
os
.
path
.
splitext
),
'win_basename'
:
partial
(
unicode_wrap
,
ntpath
.
basename
),
'win_dirname'
:
partial
(
unicode_wrap
,
ntpath
.
dirname
),
'win_splitdrive'
:
partial
(
unicode_wrap
,
ntpath
.
splitdrive
),
# value as boolean
'bool'
:
bool
,
...
...
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