ansible filter
This commit is contained in:
23
Ansible/plugin_devel.md
Normal file
23
Ansible/plugin_devel.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Plugin development
|
||||
|
||||
## Filter example
|
||||
|
||||
```
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
||||
# Some more imports
|
||||
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
def myfilter(myinput):
|
||||
return myinput + 1
|
||||
|
||||
|
||||
class FilterModule(object):
|
||||
|
||||
def filters(self):
|
||||
return {
|
||||
'myfilter': myfilter,
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user