Debian Codegraph @

test/integration/targets/deprecations/library/removeoption.py

raw
1 # -*- coding: utf-8 -*-
2 # Copyright: Ansible Project
3 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
5 from __future__ import annotations
6
7
8 DOCUMENTATION = r"""
9 ---
10 module: removeoption
11 short_description: noop
12 description: does nothing, test for removal of option
13 options:
14 one:
15 description:
16 - first option
17 type: bool
18 default: no
19 two:
20 description:
21 - second option
22 deprecated:
23 removed_in: '3.30'
24 why: cause i wanna test this!
25 alternatives: none needed
26 notes:
27 - Just noop to test module deprecation
28 seealso:
29 - module: willremove
30 author:
31 - Ansible Core Team
32 attributes:
33 action:
34 support: full
35 async:
36 support: full
37 bypass_host_loop:
38 support: none
39 check_mode:
40 support: full
41 diff_mode:
42 support: none
43 platform:
44 platforms: all
45 """
46
47 EXAMPLES = r"""
48 - name: useless
49 remove_option:
50 one: true
51 two: /etc/file.conf
52 """
53
54 RETURN = r"""
55 """
56
57 from ansible.module_utils.basic import AnsibleModule
58
59
60 def main():
61 module = AnsibleModule(
62 argument_spec=dict(
63 one=dict(type='bool', default='no'),
64 two=dict(type='str', removed_in_version='3.30'),
65 ),
66 supports_check_mode=True
67 )
68
69 one = module.params['one']
70 two = module.params['two']
71
72 result = {'yolo': 'lola'}
73
74 module.exit_json(**result)
75
76
77 if __name__ == '__main__':
78 main()