-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathaaagroup_intranetip_binding.py
151 lines (132 loc) · 4.81 KB
/
aaagroup_intranetip_binding.py
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2023 Cloud Software Group, Inc.
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = r"""
---
module: aaagroup_intranetip_binding
short_description: Binding Resource definition for describing association between
aaagroup and intranetip resources
description: Binding Resource definition for describing association between aaagroup
and intranetip resources
version_added: 2.0.0
author:
- Sumanth Lingappa (@sumanth-lingappa)
- Shiva Shankar Vaddepally (@shivashankar-vaddepally)
options:
state:
choices:
- present
- absent
default: present
description:
- The state of the resource being configured by the module on the NetScaler
ADC node.
- When C(present), the resource will be added/updated configured according to
the module's parameters.
- When C(absent), the resource will be deleted from the NetScaler ADC node.
type: str
gotopriorityexpression:
type: str
description:
- 'Expression or other value specifying the next policy to evaluate if the current
policy evaluates to TRUE. Specify one of the following values:'
- '* NEXT - Evaluate the policy with the next higher priority number.'
- '* END - End policy evaluation.'
- '* USE_INVOCATION_RESULT - Applicable if this policy invokes another policy
label. If the final goto in the invoked policy label has a value of END, the
evaluation stops. If the final goto is anything other than END, the current
policy label performs a NEXT.'
- '* An expression that evaluates to a number.'
- 'If you specify an expression, the number to which it evaluates determines
the next policy to evaluate, as follows:'
- '* If the expression evaluates to a higher numbered priority, the policy
with that priority is evaluated next.'
- '* If the expression evaluates to the priority of the current policy, the
policy with the next higher numbered priority is evaluated next.'
- '* If the expression evaluates to a number that is larger than the largest
numbered priority, policy evaluation ends.'
- 'An UNDEF event is triggered if:'
- '* The expression is invalid.'
- '* The expression evaluates to a priority number that is numerically lower
than the current policy''s priority.'
- '* The expression evaluates to a priority number that is between the current
policy''s priority number (say, 30) and the highest priority number (say,
100), but does not match any configured priority number (for example, the
expression evaluates to the number 85). This example assumes that the priority
number increments by 10 for every successive policy, and therefore a priority
number of 85 does not exist in the policy label.'
groupname:
type: str
description:
- Name of the group that you are binding.
intranetip:
type: str
description:
- The Intranet IP(s) bound to the group
netmask:
type: str
description:
- The netmask for the Intranet IP
extends_documentation_fragment: netscaler.adc.netscaler_adc
"""
EXAMPLES = r"""
---
- name: Sample aaagroup_intranetip_binding playbook
hosts: demo_netscalers
gather_facts: false
tasks:
- name: Configure aaagroup_intranetip_binding
delegate_to: localhost
netscaler.adc.aaagroup_intranetip_binding:
state: present
groupname: group1
intranetip: 192.168.1.80
netmask: 255.255.255.240
"""
RETURN = r"""
---
changed:
description: Indicates if any change is made by the module
returned: always
type: bool
sample: true
diff:
description: Dictionary of before and after changes
returned: always
type: dict
sample: {'before': {'key1': 'xyz'}, 'after': {'key2': 'pqr'}, 'prepared': 'changes
done'}
diff_list:
description: List of differences between the actual configured object and the configuration
specified in the module
returned: when changed
type: list
sample: ["Attribute `key1` differs. Desired: (<class 'str'>) XYZ. Existing: (<class
'str'>) PQR"]
failed:
description: Indicates if the module failed or not
returned: always
type: bool
sample: false
loglines:
description: list of logged messages by the module
returned: always
type: list
sample: ['message 1', 'message 2']
"""
import os
from ..module_utils.module_executor import ModuleExecutor
RESOURCE_NAME = os.path.basename(__file__).replace(".py", "")
def main():
executor = ModuleExecutor(RESOURCE_NAME)
executor.main()
if __name__ == "__main__":
main()