| 1 |
|
| 2 |
from __future__ import absolute_import, division, print_function |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
__metaclass__ = type |
| 7 |
|
| 8 |
ANSIBLE_METADATA = {'status': ['preview'], |
| 9 |
'supported_by': 'community', |
| 10 |
'metadata_version': '1.1'} |
| 11 |
|
| 12 |
DOCUMENTATION = ''' |
| 13 |
--- |
| 14 |
module: fmgr_wtpprofile_eslsesdongle |
| 15 |
short_description: ESL SES-imagotag dongle configuration. |
| 16 |
version_added: "2.1.0" |
| 17 |
extends_documentation_fragment: |
| 18 |
- fortinet.fortimanager.general |
| 19 |
- fortinet.fortimanager.general.partial_crud |
| 20 |
options: |
| 21 |
revision_note: |
| 22 |
description: The change note that can be specified when an object is created or updated. |
| 23 |
type: str |
| 24 |
adom: |
| 25 |
description: The parameter (adom) in requested url. |
| 26 |
type: str |
| 27 |
required: true |
| 28 |
wtp-profile: |
| 29 |
description: Deprecated, please use "wtp_profile" |
| 30 |
type: str |
| 31 |
wtp_profile: |
| 32 |
description: The parameter (wtp-profile) in requested url. |
| 33 |
type: str |
| 34 |
wtpprofile_eslsesdongle: |
| 35 |
description: The top level parameters set. |
| 36 |
required: false |
| 37 |
type: dict |
| 38 |
suboptions: |
| 39 |
apc_addr_type: |
| 40 |
aliases: ['apc-addr-type'] |
| 41 |
type: str |
| 42 |
description: ESL SES-imagotag APC address type |
| 43 |
choices: ['fqdn', 'ip'] |
| 44 |
apc_fqdn: |
| 45 |
aliases: ['apc-fqdn'] |
| 46 |
type: str |
| 47 |
description: FQDN of ESL SES-imagotag Access Point Controller |
| 48 |
apc_ip: |
| 49 |
aliases: ['apc-ip'] |
| 50 |
type: str |
| 51 |
description: IP address of ESL SES-imagotag Access Point Controller |
| 52 |
apc_port: |
| 53 |
aliases: ['apc-port'] |
| 54 |
type: int |
| 55 |
description: Port of ESL SES-imagotag Access Point Controller |
| 56 |
coex_level: |
| 57 |
aliases: ['coex-level'] |
| 58 |
type: str |
| 59 |
description: ESL SES-imagotag dongle coexistence level |
| 60 |
choices: ['none'] |
| 61 |
compliance_level: |
| 62 |
aliases: ['compliance-level'] |
| 63 |
type: str |
| 64 |
description: Compliance levels for the ESL solution integration |
| 65 |
choices: ['compliance-level-2'] |
| 66 |
esl_channel: |
| 67 |
aliases: ['esl-channel'] |
| 68 |
type: str |
| 69 |
description: ESL SES-imagotag dongle channel |
| 70 |
choices: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '127', '-1'] |
| 71 |
output_power: |
| 72 |
aliases: ['output-power'] |
| 73 |
type: str |
| 74 |
description: ESL SES-imagotag dongle output power |
| 75 |
choices: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] |
| 76 |
scd_enable: |
| 77 |
aliases: ['scd-enable'] |
| 78 |
type: str |
| 79 |
description: Enable/disable ESL SES-imagotag Serial Communication Daemon |
| 80 |
choices: ['disable', 'enable'] |
| 81 |
tls_cert_verification: |
| 82 |
aliases: ['tls-cert-verification'] |
| 83 |
type: str |
| 84 |
description: Enable/disable TLS certificate verification |
| 85 |
choices: ['disable', 'enable'] |
| 86 |
tls_fqdn_verification: |
| 87 |
aliases: ['tls-fqdn-verification'] |
| 88 |
type: str |
| 89 |
description: Enable/disable TLS certificate verification |
| 90 |
choices: ['disable', 'enable'] |
| 91 |
''' |
| 92 |
|
| 93 |
EXAMPLES = ''' |
| 94 |
- name: Example playbook (generated based on argument schema) |
| 95 |
hosts: fortimanagers |
| 96 |
connection: httpapi |
| 97 |
gather_facts: false |
| 98 |
tasks: |
| 99 |
- name: ESL SES-imagotag dongle configuration. |
| 100 |
fortinet.fortimanager.fmgr_wtpprofile_eslsesdongle: |
| 101 |
# workspace_locking_adom: <global or your adom name> |
| 102 |
adom: <your own value> |
| 103 |
wtp_profile: <your own value> |
| 104 |
wtpprofile_eslsesdongle: |
| 105 |
# apc_addr_type: <value in [fqdn, ip]> |
| 106 |
# apc_fqdn: <string> |
| 107 |
# apc_ip: <string> |
| 108 |
# apc_port: <integer> |
| 109 |
# coex_level: <value in [none]> |
| 110 |
# compliance_level: <value in [compliance-level-2]> |
| 111 |
# esl_channel: <value in [0, 1, 2, ...]> |
| 112 |
# output_power: <value in [a, b, c, ...]> |
| 113 |
# scd_enable: <value in [disable, enable]> |
| 114 |
# tls_cert_verification: <value in [disable, enable]> |
| 115 |
# tls_fqdn_verification: <value in [disable, enable]> |
| 116 |
''' |
| 117 |
|
| 118 |
RETURN = ''' |
| 119 |
meta: |
| 120 |
description: The result of the request. |
| 121 |
type: dict |
| 122 |
returned: always |
| 123 |
contains: |
| 124 |
request_url: |
| 125 |
description: The full url requested. |
| 126 |
returned: always |
| 127 |
type: str |
| 128 |
sample: /sys/login/user |
| 129 |
response_code: |
| 130 |
description: The status of api request. |
| 131 |
returned: always |
| 132 |
type: int |
| 133 |
sample: 0 |
| 134 |
response_data: |
| 135 |
description: The api response. |
| 136 |
type: list |
| 137 |
returned: always |
| 138 |
response_message: |
| 139 |
description: The descriptive message of the api response. |
| 140 |
type: str |
| 141 |
returned: always |
| 142 |
sample: OK. |
| 143 |
system_information: |
| 144 |
description: The information of the target system. |
| 145 |
type: dict |
| 146 |
returned: always |
| 147 |
rc: |
| 148 |
description: The status the request. |
| 149 |
type: int |
| 150 |
returned: always |
| 151 |
sample: 0 |
| 152 |
version_check_warning: |
| 153 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 154 |
type: list |
| 155 |
returned: complex |
| 156 |
''' |
| 157 |
from ansible.module_utils.basic import AnsibleModule |
| 158 |
from ansible.module_utils.connection import Connection |
| 159 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 160 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 161 |
|
| 162 |
|
| 163 |
def main(): |
| 164 |
urls_list = [ |
| 165 |
'/pm/config/adom/{adom}/obj/wireless-controller/wtp-profile/{wtp-profile}/esl-ses-dongle', |
| 166 |
'/pm/config/global/obj/wireless-controller/wtp-profile/{wtp-profile}/esl-ses-dongle' |
| 167 |
] |
| 168 |
module_arg_spec = { |
| 169 |
'adom': {'required': True, 'type': 'str'}, |
| 170 |
'wtp-profile': {'type': 'str', 'api_name': 'wtp_profile'}, |
| 171 |
'wtp_profile': {'type': 'str'}, |
| 172 |
'revision_note': {'type': 'str'}, |
| 173 |
'wtpprofile_eslsesdongle': { |
| 174 |
'type': 'dict', 'v_range': [['7.0.1', '']], |
| 175 |
'options': { |
| 176 |
'apc-addr-type': {'v_range': [['7.0.1', '']], 'choices': ['fqdn', 'ip'], 'type': 'str'}, |
| 177 |
'apc-fqdn': {'v_range': [['7.0.1', '']], 'type': 'str'}, |
| 178 |
'apc-ip': {'v_range': [['7.0.1', '']], 'type': 'str'}, |
| 179 |
'apc-port': {'v_range': [['7.0.1', '']], 'type': 'int'}, |
| 180 |
'coex-level': {'v_range': [['7.0.1', '']], 'choices': ['none'], 'type': 'str'}, |
| 181 |
'compliance-level': {'v_range': [['7.0.1', '']], 'choices': ['compliance-level-2'], 'type': 'str'}, |
| 182 |
'esl-channel': { |
| 183 |
'v_range': [['7.0.1', '']], |
| 184 |
'choices': ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '127', '-1'], |
| 185 |
'type': 'str' |
| 186 |
}, |
| 187 |
'output-power': {'v_range': [['7.0.1', '']], 'choices': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], 'type': 'str'}, |
| 188 |
'scd-enable': {'v_range': [['7.0.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 189 |
'tls-cert-verification': {'v_range': [['7.0.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 190 |
'tls-fqdn-verification': {'v_range': [['7.0.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'} |
| 191 |
} |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
module_option_spec = get_module_arg_spec('partial crud') |
| 196 |
module_arg_spec.update(module_option_spec) |
| 197 |
check_galaxy_version(module_arg_spec) |
| 198 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'wtpprofile_eslsesdongle'), |
| 199 |
supports_check_mode=True) |
| 200 |
if not module._socket_path: |
| 201 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 202 |
connection = Connection(module._socket_path) |
| 203 |
fmgr = NAPIManager('partial crud', module_arg_spec, urls_list, |
| 204 |
None, 'data', module, connection) |
| 205 |
fmgr.process_partial_crud() |
| 206 |
module.exit_json(meta=module.params) |
| 207 |
|
| 208 |
|
| 209 |
if __name__ == '__main__': |
| 210 |
main() |