File: test_docs_suboptions.py

package info (click to toggle)
ansible-core 2.19.0~beta6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,628 kB
  • sloc: python: 180,313; cs: 4,929; sh: 4,601; xml: 34; makefile: 21
file content (69 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/python
from __future__ import annotations


DOCUMENTATION = """
---
module: test_docs_suboptions
short_description: Test module
description:
    - Test module
author:
    - Ansible Core Team
options:
    with_suboptions:
        description:
            - An option with suboptions.
            - Use with care.
        type: dict
        suboptions:
            z_last:
                description: The last suboption.
                type: str
            m_middle:
                description:
                    - The suboption in the middle.
                    - Has its own suboptions.
                suboptions:
                    a_suboption:
                        description: A sub-suboption.
                        type: str
            a_first:
                description: The first suboption.
                type: str
"""

EXAMPLES = """
"""

RETURN = """
"""


from ansible.module_utils.basic import AnsibleModule


def main():
    module = AnsibleModule(
        argument_spec=dict(
            test_docs_suboptions=dict(
                type='dict',
                options=dict(
                    a_first=dict(type='str'),
                    m_middle=dict(
                        type='dict',
                        options=dict(
                            a_suboption=dict(type='str')
                        ),
                    ),
                    z_last=dict(type='str'),
                ),
            ),
        ),
    )

    module.exit_json()


if __name__ == '__main__':
    main()