parent
62c4a47e86
commit
c0c2960e17
3 changed files with 17 additions and 3 deletions
@ -0,0 +1,10 @@ |
||||
--- |
||||
# Copyright (c) Ansible Project |
||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) |
||||
# SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
||||
requires_ansible: '>=2.9.6' |
||||
plugin_routing: |
||||
filter: |
||||
abspath: |
||||
redirect: laurivan.plugins.abspath |
@ -1,9 +1,13 @@ |
||||
from functools import partial |
||||
from ansible.utils.unicode import unicode_wrap |
||||
|
||||
def abspath(fname): |
||||
return os.path.abspath(fname) |
||||
|
||||
class FilterModule(object): |
||||
''' Ansible file jinja2 filters ''' |
||||
def filters(self): |
||||
return { |
||||
'abspath': partial(unicode_wrap, os.path.abspath) |
||||
filters = { |
||||
'abspath': abspath |
||||
} |
||||
return filters |
||||
|
Loading…
Reference in new issue