-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find all filter_plugin folders to correctly load custom filters. Remove basic filter fallback added in 1.1.2 to highlight future issues
- Loading branch information
Showing
13 changed files
with
120 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class FilterModule(object): | ||
|
||
def filters(self): | ||
return { | ||
'cust_filter_0': self.cust_filter_0 | ||
} | ||
|
||
def cust_filter_0(self, input): | ||
return input + "cust_filter_0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
used_var: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
all: | ||
vars: | ||
unused_inv_var: "{{ 'abc' | cust_filter_0 }}" | ||
used_inv_var2: abc | ||
|
||
SERVERS: | ||
hosts: | ||
localhost: | ||
used_host_var: def {{ used_inv_var2 | trim }} | ||
|
||
STORAGE: | ||
hosts: | ||
localhost: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- name: No deps | ||
hosts: SERVERS | ||
become: false | ||
gather_facts: false | ||
connection: local | ||
pre_tasks: | ||
- name: Pre | ||
delegate_to: localhost | ||
ansible.builtin.debug: | ||
var: used_var | ||
tasks: | ||
- name: Debug1 | ||
delegate_to: localhost | ||
ansible.builtin.debug: | ||
var: used_var | ||
roles: | ||
- role1 |
13 changes: 13 additions & 0 deletions
13
tests/repos/custom_filter/repo/roles/role1/filter_plugins/filters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class FilterModule(object): | ||
|
||
def filters(self): | ||
return { | ||
'cust_filter_1': self.cust_filter_1, | ||
'cust_filter_2': self.cust_filter_2, | ||
} | ||
|
||
def cust_filter_1(self, input): | ||
return input + "cust_filter_1" | ||
|
||
def cust_filter_2(self, input): | ||
return input + "cust_filter_2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- name: Cmd1 | ||
ansible.builtin.command: echo {{ used_var }} | ||
changed_when: false | ||
|
||
- name: Cmd2 | ||
ansible.builtin.command: | ||
cmd: echo {{ used_var }} | ||
changed_when: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{ some_host_var | cust_filter_2("why") }} | ||
dwp[k | ||
gfgkrpokg[r | ||
egkproekg | ||
{{ some_host_var }} | ||
{{ used_host_var | cust_filter_1("why3") }} | ||
dfeefe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
unused_inv_var |