mirror of https://github.com/ansible/ansible.git
for j2 plugins dedupe on path and not basename
for j2 this is a container file , for other plugins file name == plugin name
(cherry picked from commit b4566c18b3
)
pull/82092/head
parent
0c98b2256c
commit
8896db97ed
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- Plugin loader does not dedupe nor cache filter/test plugins by file basename, but full path name.
|
||||
- Restoring the ability of filters/tests can have same file base name but different tests/filters defined inside.
|
@ -0,0 +1,7 @@
|
||||
- hosts: localhost
|
||||
gather_facts: false
|
||||
roles:
|
||||
- r1
|
||||
- r2
|
||||
tasks:
|
||||
- debug: msg={{'a'|filter1|filter2|filter3}}
|
@ -0,0 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def do_nothing(myval):
|
||||
return myval
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
''' Ansible core jinja2 filters '''
|
||||
|
||||
def filters(self):
|
||||
return {
|
||||
'filter1': do_nothing,
|
||||
'filter3': do_nothing,
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
DOCUMENTATION:
|
||||
name: filter1
|
||||
version_added: "1.9"
|
||||
short_description: Does nothing
|
||||
description:
|
||||
- Really, does nothing
|
||||
notes:
|
||||
- This is a test filter
|
||||
positional: _input
|
||||
options:
|
||||
_input:
|
||||
description: the input
|
||||
required: true
|
||||
|
||||
EXAMPLES: ''
|
||||
RETURN:
|
||||
_value:
|
||||
description: The input
|
@ -0,0 +1,18 @@
|
||||
DOCUMENTATION:
|
||||
name: filter3
|
||||
version_added: "1.9"
|
||||
short_description: Does nothing
|
||||
description:
|
||||
- Really, does nothing
|
||||
notes:
|
||||
- This is a test filter
|
||||
positional: _input
|
||||
options:
|
||||
_input:
|
||||
description: the input
|
||||
required: true
|
||||
|
||||
EXAMPLES: ''
|
||||
RETURN:
|
||||
_value:
|
||||
description: The input
|
@ -0,0 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def do_nothing(myval):
|
||||
return myval
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
''' Ansible core jinja2 filters '''
|
||||
|
||||
def filters(self):
|
||||
return {
|
||||
'filter2': do_nothing,
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
DOCUMENTATION:
|
||||
name: filter2
|
||||
version_added: "1.9"
|
||||
short_description: Does nothing
|
||||
description:
|
||||
- Really, does nothing
|
||||
notes:
|
||||
- This is a test filter
|
||||
positional: _input
|
||||
options:
|
||||
_input:
|
||||
description: the input
|
||||
required: true
|
||||
|
||||
EXAMPLES: ''
|
||||
RETURN:
|
||||
_value:
|
||||
description: The input
|
Loading…
Reference in New Issue