| 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_platform |
| 15 |
short_description: WTP, FortiAP, or AP platform. |
| 16 |
version_added: "2.0.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_platform: |
| 35 |
description: The top level parameters set. |
| 36 |
required: false |
| 37 |
type: dict |
| 38 |
suboptions: |
| 39 |
type: |
| 40 |
type: str |
| 41 |
description: WTP, FortiAP or AP platform type. |
| 42 |
choices: ['30B-50B', '60B', '80CM-81CM', '220A', '220B', '210B', '60C', '222B', |
| 43 |
'112B', '320B', '11C', '14C', '223B', '28C', '320C', '221C', '25D', |
| 44 |
'222C', '224D', '214B', '21D', '24D', '112D', '223C', '321C', 'C220C', |
| 45 |
'C225C', 'S321C', 'S323C', 'FWF', 'S311C', 'S313C', 'AP-11N', 'S322C', |
| 46 |
'S321CR', 'S322CR', 'S323CR', 'S421E', 'S422E', 'S423E', '421E', '423E', |
| 47 |
'C221E', 'C226E', 'C23JD', 'C24JE', 'C21D', 'U421E', 'U423E', '221E', |
| 48 |
'222E', '223E', 'S221E', 'S223E', 'U221EV', 'U223EV', 'U321EV', |
| 49 |
'U323EV', '224E', 'U422EV', 'U24JEV', '321E', 'U431F', 'U433F', '231E', |
| 50 |
'431F', '433F', '231F', '432F', '234F', '23JF', 'U231F', '831F', |
| 51 |
'U234F', 'U432F', '431FL', '432FR', '433FL', '231FL', '231G', '233G', |
| 52 |
'431G', '433G', 'U231G', 'U441G', '234G', '432G', '441K', '443K', |
| 53 |
'241K', '243K', '231K', '23JK', '222KL', '244K', '432K', 'MVP', '231KD'] |
| 54 |
mode: |
| 55 |
type: str |
| 56 |
description: Configure operation mode of 5G radios |
| 57 |
choices: ['dual-5G', 'single-5G'] |
| 58 |
ddscan: |
| 59 |
type: str |
| 60 |
description: Enable/disable use of one radio for dedicated dual-band scanning to detect RF characterization and wireless threat management. |
| 61 |
choices: ['disable', 'enable'] |
| 62 |
_local_platform_str: |
| 63 |
type: str |
| 64 |
description: Local platform str. |
| 65 |
''' |
| 66 |
|
| 67 |
EXAMPLES = ''' |
| 68 |
- name: Example playbook (generated based on argument schema) |
| 69 |
hosts: fortimanagers |
| 70 |
connection: httpapi |
| 71 |
gather_facts: false |
| 72 |
tasks: |
| 73 |
- name: WTP, FortiAP, or AP platform. |
| 74 |
fortinet.fortimanager.fmgr_wtpprofile_platform: |
| 75 |
# workspace_locking_adom: <global or your adom name> |
| 76 |
adom: <your own value> |
| 77 |
wtp_profile: <your own value> |
| 78 |
wtpprofile_platform: |
| 79 |
# type: <value in [30B-50B, 60B, 80CM-81CM, ...]> |
| 80 |
# mode: <value in [dual-5G, single-5G]> |
| 81 |
# ddscan: <value in [disable, enable]> |
| 82 |
# _local_platform_str: <string> |
| 83 |
''' |
| 84 |
|
| 85 |
RETURN = ''' |
| 86 |
meta: |
| 87 |
description: The result of the request. |
| 88 |
type: dict |
| 89 |
returned: always |
| 90 |
contains: |
| 91 |
request_url: |
| 92 |
description: The full url requested. |
| 93 |
returned: always |
| 94 |
type: str |
| 95 |
sample: /sys/login/user |
| 96 |
response_code: |
| 97 |
description: The status of api request. |
| 98 |
returned: always |
| 99 |
type: int |
| 100 |
sample: 0 |
| 101 |
response_data: |
| 102 |
description: The api response. |
| 103 |
type: list |
| 104 |
returned: always |
| 105 |
response_message: |
| 106 |
description: The descriptive message of the api response. |
| 107 |
type: str |
| 108 |
returned: always |
| 109 |
sample: OK. |
| 110 |
system_information: |
| 111 |
description: The information of the target system. |
| 112 |
type: dict |
| 113 |
returned: always |
| 114 |
rc: |
| 115 |
description: The status the request. |
| 116 |
type: int |
| 117 |
returned: always |
| 118 |
sample: 0 |
| 119 |
version_check_warning: |
| 120 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 121 |
type: list |
| 122 |
returned: complex |
| 123 |
''' |
| 124 |
from ansible.module_utils.basic import AnsibleModule |
| 125 |
from ansible.module_utils.connection import Connection |
| 126 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 127 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 128 |
|
| 129 |
|
| 130 |
def main(): |
| 131 |
urls_list = [ |
| 132 |
'/pm/config/adom/{adom}/obj/wireless-controller/wtp-profile/{wtp-profile}/platform', |
| 133 |
'/pm/config/global/obj/wireless-controller/wtp-profile/{wtp-profile}/platform' |
| 134 |
] |
| 135 |
module_arg_spec = { |
| 136 |
'adom': {'required': True, 'type': 'str'}, |
| 137 |
'wtp-profile': {'type': 'str', 'api_name': 'wtp_profile'}, |
| 138 |
'wtp_profile': {'type': 'str'}, |
| 139 |
'revision_note': {'type': 'str'}, |
| 140 |
'wtpprofile_platform': { |
| 141 |
'type': 'dict', 'v_range': [['6.0.0', '']], |
| 142 |
'options': { |
| 143 |
'type': { |
| 144 |
'choices': [ |
| 145 |
'30B-50B', '60B', '80CM-81CM', '220A', '220B', '210B', '60C', '222B', '112B', '320B', '11C', '14C', '223B', '28C', '320C', |
| 146 |
'221C', '25D', '222C', '224D', '214B', '21D', '24D', '112D', '223C', '321C', 'C220C', 'C225C', 'S321C', 'S323C', 'FWF', 'S311C', |
| 147 |
'S313C', 'AP-11N', 'S322C', 'S321CR', 'S322CR', 'S323CR', 'S421E', 'S422E', 'S423E', '421E', '423E', 'C221E', 'C226E', 'C23JD', |
| 148 |
'C24JE', 'C21D', 'U421E', 'U423E', '221E', '222E', '223E', 'S221E', 'S223E', 'U221EV', 'U223EV', 'U321EV', 'U323EV', '224E', |
| 149 |
'U422EV', 'U24JEV', '321E', 'U431F', 'U433F', '231E', '431F', '433F', '231F', '432F', '234F', '23JF', 'U231F', '831F', 'U234F', |
| 150 |
'U432F', '431FL', '432FR', '433FL', '231FL', '231G', '233G', '431G', '433G', 'U231G', 'U441G', '234G', '432G', '441K', '443K', |
| 151 |
'241K', '243K', '231K', '23JK', '222KL', '244K', '432K', 'MVP', '231KD' |
| 152 |
], |
| 153 |
'type': 'str' |
| 154 |
}, |
| 155 |
'mode': {'v_range': [['6.2.2', '']], 'choices': ['dual-5G', 'single-5G'], 'type': 'str'}, |
| 156 |
'ddscan': {'v_range': [['6.2.5', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 157 |
'_local_platform_str': {'v_range': [['6.2.8', '6.2.13'], ['6.4.6', '']], 'type': 'str'} |
| 158 |
} |
| 159 |
} |
| 160 |
} |
| 161 |
|
| 162 |
module_option_spec = get_module_arg_spec('partial crud') |
| 163 |
module_arg_spec.update(module_option_spec) |
| 164 |
check_galaxy_version(module_arg_spec) |
| 165 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'wtpprofile_platform'), |
| 166 |
supports_check_mode=True) |
| 167 |
if not module._socket_path: |
| 168 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 169 |
connection = Connection(module._socket_path) |
| 170 |
fmgr = NAPIManager('partial crud', module_arg_spec, urls_list, |
| 171 |
None, 'data', module, connection) |
| 172 |
fmgr.process_partial_crud() |
| 173 |
module.exit_json(meta=module.params) |
| 174 |
|
| 175 |
|
| 176 |
if __name__ == '__main__': |
| 177 |
main() |