mirror of https://github.com/ansible/ansible.git
ansible-doc stay 3.8 python compatible (#77682)
pathlib with_stem will wait till 3.9 also add tests by listing filterspull/73239/merge
parent
c71faec595
commit
749a105956
@ -0,0 +1,27 @@
|
|||||||
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
|
|
||||||
|
# Make coding more python3-ish
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
from ansible.utils.display import Display
|
||||||
|
|
||||||
|
display = Display()
|
||||||
|
|
||||||
|
|
||||||
|
def nochange(a):
|
||||||
|
return a
|
||||||
|
|
||||||
|
|
||||||
|
def meaningoflife(a):
|
||||||
|
return 42
|
||||||
|
|
||||||
|
|
||||||
|
class FilterModule(object):
|
||||||
|
''' Ansible core jinja2 filters '''
|
||||||
|
|
||||||
|
def filters(self):
|
||||||
|
return {
|
||||||
|
'noop': nochange,
|
||||||
|
'ultimatequestion': meaningoflife
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: ultimatequestion
|
||||||
|
author: Terry Prachet
|
||||||
|
version_added: 'histerical'
|
||||||
|
short_description: Ask any question but it will only respond with the answer to the ulitmate one
|
||||||
|
description:
|
||||||
|
- read the book
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: Anything you want, goign to ignore it anywayss ...
|
||||||
|
type: raw
|
||||||
|
required: true
|
||||||
|
|
||||||
|
EXAMPLES: |
|
||||||
|
# set first 10 volumes rw, rest as dp
|
||||||
|
meaning: "{{ (stuff|ulmtimatequestion }}"
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: guess
|
||||||
|
type: int
|
Loading…
Reference in New Issue