fix: Shortcut redirect.

This commit is contained in:
Laur Ivan 2022-12-11 00:39:24 +01:00
parent 62c4a47e86
commit c0c2960e17
3 changed files with 17 additions and 3 deletions

View File

@ -9,7 +9,7 @@ namespace: laurivan
name: plugins name: plugins
# The version of the collection. Must be compatible with semantic versioning # The version of the collection. Must be compatible with semantic versioning
version: 1.0.1 version: 1.0.2
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection # The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md readme: README.md

10
meta/runtime.yml Normal file
View File

@ -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

View File

@ -1,9 +1,13 @@
from functools import partial from functools import partial
from ansible.utils.unicode import unicode_wrap from ansible.utils.unicode import unicode_wrap
def abspath(fname):
return os.path.abspath(fname)
class FilterModule(object): class FilterModule(object):
''' Ansible file jinja2 filters ''' ''' Ansible file jinja2 filters '''
def filters(self): def filters(self):
return { filters = {
'abspath': partial(unicode_wrap, os.path.abspath) 'abspath': abspath
} }
return filters