| 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_user_group |
| 15 |
short_description: Configure user groups. |
| 16 |
version_added: "2.0.0" |
| 17 |
extends_documentation_fragment: |
| 18 |
- fortinet.fortimanager.general |
| 19 |
- fortinet.fortimanager.general.full_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 |
user_group: |
| 29 |
description: The top level parameters set. |
| 30 |
required: false |
| 31 |
type: dict |
| 32 |
suboptions: |
| 33 |
auth_concurrent_override: |
| 34 |
aliases: ['auth-concurrent-override'] |
| 35 |
type: str |
| 36 |
description: Enable/disable overriding the global number of concurrent authentication sessions for this user group. |
| 37 |
choices: ['disable', 'enable'] |
| 38 |
auth_concurrent_value: |
| 39 |
aliases: ['auth-concurrent-value'] |
| 40 |
type: int |
| 41 |
description: Maximum number of concurrent authenticated connections per user |
| 42 |
authtimeout: |
| 43 |
type: int |
| 44 |
description: Authentication timeout in minutes for this user group. |
| 45 |
company: |
| 46 |
type: str |
| 47 |
description: Set the action for the company guest user field. |
| 48 |
choices: ['optional', 'mandatory', 'disabled'] |
| 49 |
email: |
| 50 |
type: str |
| 51 |
description: Enable/disable the guest user email address field. |
| 52 |
choices: ['disable', 'enable'] |
| 53 |
expire: |
| 54 |
type: int |
| 55 |
description: Time in seconds before guest user accounts expire. |
| 56 |
expire_type: |
| 57 |
aliases: ['expire-type'] |
| 58 |
type: str |
| 59 |
description: Determine when the expiration countdown begins. |
| 60 |
choices: ['immediately', 'first-successful-login'] |
| 61 |
group_type: |
| 62 |
aliases: ['group-type'] |
| 63 |
type: str |
| 64 |
description: Set the group to be for firewall authentication, FSSO, RSSO, or guest users. |
| 65 |
choices: ['firewall', 'directory-service', 'fsso-service', 'guest', 'rsso'] |
| 66 |
guest: |
| 67 |
type: list |
| 68 |
elements: dict |
| 69 |
description: Guest. |
| 70 |
suboptions: |
| 71 |
comment: |
| 72 |
type: str |
| 73 |
description: Comment. |
| 74 |
company: |
| 75 |
type: str |
| 76 |
description: Set the action for the company guest user field. |
| 77 |
email: |
| 78 |
type: str |
| 79 |
description: Email. |
| 80 |
expiration: |
| 81 |
type: str |
| 82 |
description: Expire time. |
| 83 |
mobile_phone: |
| 84 |
aliases: ['mobile-phone'] |
| 85 |
type: str |
| 86 |
description: Mobile phone. |
| 87 |
name: |
| 88 |
type: str |
| 89 |
description: Guest name. |
| 90 |
password: |
| 91 |
type: raw |
| 92 |
description: (list) Guest password. |
| 93 |
sponsor: |
| 94 |
type: str |
| 95 |
description: Set the action for the sponsor guest user field. |
| 96 |
user_id: |
| 97 |
aliases: ['user-id'] |
| 98 |
type: str |
| 99 |
description: Guest ID. |
| 100 |
group: |
| 101 |
type: str |
| 102 |
description: Guest name. |
| 103 |
id: |
| 104 |
type: int |
| 105 |
description: Guest ID. |
| 106 |
http_digest_realm: |
| 107 |
aliases: ['http-digest-realm'] |
| 108 |
type: str |
| 109 |
description: Realm attribute for MD5-digest authentication. |
| 110 |
id: |
| 111 |
type: int |
| 112 |
description: Group ID. |
| 113 |
match: |
| 114 |
type: list |
| 115 |
elements: dict |
| 116 |
description: Match. |
| 117 |
suboptions: |
| 118 |
_gui_meta: |
| 119 |
type: str |
| 120 |
description: Gui meta. |
| 121 |
group_name: |
| 122 |
aliases: ['group-name'] |
| 123 |
type: str |
| 124 |
description: Name of matching group on remote authentication server. |
| 125 |
id: |
| 126 |
type: int |
| 127 |
description: ID. |
| 128 |
server_name: |
| 129 |
aliases: ['server-name'] |
| 130 |
type: str |
| 131 |
description: Name of remote auth server. |
| 132 |
max_accounts: |
| 133 |
aliases: ['max-accounts'] |
| 134 |
type: int |
| 135 |
description: Maximum number of guest accounts that can be created for this group |
| 136 |
member: |
| 137 |
type: list |
| 138 |
elements: str |
| 139 |
description: Names of users, peers, LDAP severs, or RADIUS servers to add to the user group. |
| 140 |
mobile_phone: |
| 141 |
aliases: ['mobile-phone'] |
| 142 |
type: str |
| 143 |
description: Enable/disable the guest user mobile phone number field. |
| 144 |
choices: ['disable', 'enable'] |
| 145 |
multiple_guest_add: |
| 146 |
aliases: ['multiple-guest-add'] |
| 147 |
type: str |
| 148 |
description: Enable/disable addition of multiple guests. |
| 149 |
choices: ['disable', 'enable'] |
| 150 |
name: |
| 151 |
type: str |
| 152 |
description: Group name. |
| 153 |
required: true |
| 154 |
password: |
| 155 |
type: str |
| 156 |
description: Guest user password type. |
| 157 |
choices: ['auto-generate', 'specify', 'disable'] |
| 158 |
sms_custom_server: |
| 159 |
aliases: ['sms-custom-server'] |
| 160 |
type: str |
| 161 |
description: SMS server. |
| 162 |
sms_server: |
| 163 |
aliases: ['sms-server'] |
| 164 |
type: str |
| 165 |
description: Send SMS through FortiGuard or other external server. |
| 166 |
choices: ['fortiguard', 'custom'] |
| 167 |
sponsor: |
| 168 |
type: str |
| 169 |
description: Set the action for the sponsor guest user field. |
| 170 |
choices: ['optional', 'mandatory', 'disabled'] |
| 171 |
sso_attribute_value: |
| 172 |
aliases: ['sso-attribute-value'] |
| 173 |
type: str |
| 174 |
description: Name of the RADIUS user group that this local user group represents. |
| 175 |
user_id: |
| 176 |
aliases: ['user-id'] |
| 177 |
type: str |
| 178 |
description: Guest user ID type. |
| 179 |
choices: ['email', 'auto-generate', 'specify'] |
| 180 |
user_name: |
| 181 |
aliases: ['user-name'] |
| 182 |
type: str |
| 183 |
description: Enable/disable the guest user name entry. |
| 184 |
choices: ['disable', 'enable'] |
| 185 |
dynamic_mapping: |
| 186 |
type: list |
| 187 |
elements: dict |
| 188 |
description: Dynamic mapping. |
| 189 |
suboptions: |
| 190 |
_scope: |
| 191 |
type: list |
| 192 |
elements: dict |
| 193 |
description: Scope. |
| 194 |
suboptions: |
| 195 |
name: |
| 196 |
type: str |
| 197 |
description: Name. |
| 198 |
vdom: |
| 199 |
type: str |
| 200 |
description: Vdom. |
| 201 |
auth_concurrent_override: |
| 202 |
aliases: ['auth-concurrent-override'] |
| 203 |
type: str |
| 204 |
description: Enable/disable overriding the global number of concurrent authentication sessions for this user group. |
| 205 |
choices: ['disable', 'enable'] |
| 206 |
auth_concurrent_value: |
| 207 |
aliases: ['auth-concurrent-value'] |
| 208 |
type: int |
| 209 |
description: Maximum number of concurrent authenticated connections per user |
| 210 |
authtimeout: |
| 211 |
type: int |
| 212 |
description: Authentication timeout in minutes for this user group. |
| 213 |
company: |
| 214 |
type: str |
| 215 |
description: Set the action for the company guest user field. |
| 216 |
choices: ['optional', 'mandatory', 'disabled'] |
| 217 |
email: |
| 218 |
type: str |
| 219 |
description: Enable/disable the guest user email address field. |
| 220 |
choices: ['disable', 'enable'] |
| 221 |
expire: |
| 222 |
type: int |
| 223 |
description: Time in seconds before guest user accounts expire |
| 224 |
expire_type: |
| 225 |
aliases: ['expire-type'] |
| 226 |
type: str |
| 227 |
description: Determine when the expiration countdown begins. |
| 228 |
choices: ['immediately', 'first-successful-login'] |
| 229 |
group_type: |
| 230 |
aliases: ['group-type'] |
| 231 |
type: str |
| 232 |
description: Set the group to be for firewall authentication, FSSO, RSSO, or guest users. |
| 233 |
choices: ['firewall', 'directory-service', 'fsso-service', 'guest', 'rsso'] |
| 234 |
guest: |
| 235 |
type: list |
| 236 |
elements: dict |
| 237 |
description: Guest. |
| 238 |
suboptions: |
| 239 |
comment: |
| 240 |
type: str |
| 241 |
description: Comment. |
| 242 |
company: |
| 243 |
type: str |
| 244 |
description: Set the action for the company guest user field. |
| 245 |
email: |
| 246 |
type: str |
| 247 |
description: Email. |
| 248 |
expiration: |
| 249 |
type: str |
| 250 |
description: Expire time. |
| 251 |
group: |
| 252 |
type: str |
| 253 |
description: Group. |
| 254 |
id: |
| 255 |
type: int |
| 256 |
description: Guest ID. |
| 257 |
mobile_phone: |
| 258 |
aliases: ['mobile-phone'] |
| 259 |
type: str |
| 260 |
description: Mobile phone. |
| 261 |
name: |
| 262 |
type: str |
| 263 |
description: Guest name. |
| 264 |
password: |
| 265 |
type: raw |
| 266 |
description: (list) Guest password. |
| 267 |
sponsor: |
| 268 |
type: str |
| 269 |
description: Set the action for the sponsor guest user field. |
| 270 |
user_id: |
| 271 |
aliases: ['user-id'] |
| 272 |
type: str |
| 273 |
description: Guest ID. |
| 274 |
http_digest_realm: |
| 275 |
aliases: ['http-digest-realm'] |
| 276 |
type: str |
| 277 |
description: Realm attribute for MD5-digest authentication. |
| 278 |
id: |
| 279 |
type: int |
| 280 |
description: Group ID. |
| 281 |
ldap_memberof: |
| 282 |
aliases: ['ldap-memberof'] |
| 283 |
type: str |
| 284 |
description: Ldap memberof. |
| 285 |
logic_type: |
| 286 |
aliases: ['logic-type'] |
| 287 |
type: str |
| 288 |
description: Logic type. |
| 289 |
choices: ['or', 'and'] |
| 290 |
match: |
| 291 |
type: list |
| 292 |
elements: dict |
| 293 |
description: Match. |
| 294 |
suboptions: |
| 295 |
_gui_meta: |
| 296 |
type: str |
| 297 |
description: Gui meta. |
| 298 |
group_name: |
| 299 |
aliases: ['group-name'] |
| 300 |
type: str |
| 301 |
description: Name of matching user or group on remote authentication server. |
| 302 |
id: |
| 303 |
type: int |
| 304 |
description: ID. |
| 305 |
server_name: |
| 306 |
aliases: ['server-name'] |
| 307 |
type: str |
| 308 |
description: Name of remote auth server. |
| 309 |
max_accounts: |
| 310 |
aliases: ['max-accounts'] |
| 311 |
type: int |
| 312 |
description: Maximum number of guest accounts that can be created for this group |
| 313 |
member: |
| 314 |
type: raw |
| 315 |
description: (list or str) Names of users, peers, LDAP severs, or RADIUS servers to add to the user group. |
| 316 |
mobile_phone: |
| 317 |
aliases: ['mobile-phone'] |
| 318 |
type: str |
| 319 |
description: Enable/disable the guest user mobile phone number field. |
| 320 |
choices: ['disable', 'enable'] |
| 321 |
multiple_guest_add: |
| 322 |
aliases: ['multiple-guest-add'] |
| 323 |
type: str |
| 324 |
description: Enable/disable addition of multiple guests. |
| 325 |
choices: ['disable', 'enable'] |
| 326 |
password: |
| 327 |
type: str |
| 328 |
description: Guest user password type. |
| 329 |
choices: ['auto-generate', 'specify', 'disable'] |
| 330 |
redir_url: |
| 331 |
aliases: ['redir-url'] |
| 332 |
type: str |
| 333 |
description: Redir url. |
| 334 |
sms_custom_server: |
| 335 |
aliases: ['sms-custom-server'] |
| 336 |
type: str |
| 337 |
description: SMS server. |
| 338 |
sms_server: |
| 339 |
aliases: ['sms-server'] |
| 340 |
type: str |
| 341 |
description: Send SMS through FortiGuard or other external server. |
| 342 |
choices: ['fortiguard', 'custom'] |
| 343 |
sponsor: |
| 344 |
type: str |
| 345 |
description: Set the action for the sponsor guest user field. |
| 346 |
choices: ['optional', 'mandatory', 'disabled'] |
| 347 |
sslvpn_bookmarks_group: |
| 348 |
aliases: ['sslvpn-bookmarks-group'] |
| 349 |
type: raw |
| 350 |
description: (list or str) Sslvpn bookmarks group. |
| 351 |
sslvpn_cache_cleaner: |
| 352 |
aliases: ['sslvpn-cache-cleaner'] |
| 353 |
type: str |
| 354 |
description: Sslvpn cache cleaner. |
| 355 |
choices: ['disable', 'enable'] |
| 356 |
sslvpn_client_check: |
| 357 |
aliases: ['sslvpn-client-check'] |
| 358 |
type: list |
| 359 |
elements: str |
| 360 |
description: Sslvpn client check. |
| 361 |
choices: ['forticlient', 'forticlient-av', 'forticlient-fw', '3rdAV', |
| 362 |
'3rdFW'] |
| 363 |
sslvpn_ftp: |
| 364 |
aliases: ['sslvpn-ftp'] |
| 365 |
type: str |
| 366 |
description: Sslvpn ftp. |
| 367 |
choices: ['disable', 'enable'] |
| 368 |
sslvpn_http: |
| 369 |
aliases: ['sslvpn-http'] |
| 370 |
type: str |
| 371 |
description: Sslvpn http. |
| 372 |
choices: ['disable', 'enable'] |
| 373 |
sslvpn_os_check: |
| 374 |
aliases: ['sslvpn-os-check'] |
| 375 |
type: str |
| 376 |
description: Sslvpn os check. |
| 377 |
choices: ['disable', 'enable'] |
| 378 |
sslvpn_os_check_list: |
| 379 |
aliases: ['sslvpn-os-check-list'] |
| 380 |
type: dict |
| 381 |
description: Sslvpn os check list. |
| 382 |
suboptions: |
| 383 |
action: |
| 384 |
type: str |
| 385 |
description: Action. |
| 386 |
choices: ['allow', 'check-up-to-date', 'deny'] |
| 387 |
latest_patch_level: |
| 388 |
aliases: ['latest-patch-level'] |
| 389 |
type: str |
| 390 |
description: Latest patch level. |
| 391 |
name: |
| 392 |
type: str |
| 393 |
description: Name. |
| 394 |
tolerance: |
| 395 |
type: int |
| 396 |
description: Tolerance. |
| 397 |
sslvpn_portal: |
| 398 |
aliases: ['sslvpn-portal'] |
| 399 |
type: raw |
| 400 |
description: (list or str) Sslvpn portal. |
| 401 |
sslvpn_portal_heading: |
| 402 |
aliases: ['sslvpn-portal-heading'] |
| 403 |
type: str |
| 404 |
description: Sslvpn portal heading. |
| 405 |
sslvpn_rdp: |
| 406 |
aliases: ['sslvpn-rdp'] |
| 407 |
type: str |
| 408 |
description: Sslvpn rdp. |
| 409 |
choices: ['disable', 'enable'] |
| 410 |
sslvpn_samba: |
| 411 |
aliases: ['sslvpn-samba'] |
| 412 |
type: str |
| 413 |
description: Sslvpn samba. |
| 414 |
choices: ['disable', 'enable'] |
| 415 |
sslvpn_split_tunneling: |
| 416 |
aliases: ['sslvpn-split-tunneling'] |
| 417 |
type: str |
| 418 |
description: Sslvpn split tunneling. |
| 419 |
choices: ['disable', 'enable'] |
| 420 |
sslvpn_ssh: |
| 421 |
aliases: ['sslvpn-ssh'] |
| 422 |
type: str |
| 423 |
description: Sslvpn ssh. |
| 424 |
choices: ['disable', 'enable'] |
| 425 |
sslvpn_telnet: |
| 426 |
aliases: ['sslvpn-telnet'] |
| 427 |
type: str |
| 428 |
description: Sslvpn telnet. |
| 429 |
choices: ['disable', 'enable'] |
| 430 |
sslvpn_tunnel: |
| 431 |
aliases: ['sslvpn-tunnel'] |
| 432 |
type: str |
| 433 |
description: Sslvpn tunnel. |
| 434 |
choices: ['disable', 'enable'] |
| 435 |
sslvpn_tunnel_endip: |
| 436 |
aliases: ['sslvpn-tunnel-endip'] |
| 437 |
type: str |
| 438 |
description: Sslvpn tunnel endip. |
| 439 |
sslvpn_tunnel_ip_mode: |
| 440 |
aliases: ['sslvpn-tunnel-ip-mode'] |
| 441 |
type: str |
| 442 |
description: Sslvpn tunnel ip mode. |
| 443 |
choices: ['range', 'usrgrp'] |
| 444 |
sslvpn_tunnel_startip: |
| 445 |
aliases: ['sslvpn-tunnel-startip'] |
| 446 |
type: str |
| 447 |
description: Sslvpn tunnel startip. |
| 448 |
sslvpn_virtual_desktop: |
| 449 |
aliases: ['sslvpn-virtual-desktop'] |
| 450 |
type: str |
| 451 |
description: Sslvpn virtual desktop. |
| 452 |
choices: ['disable', 'enable'] |
| 453 |
sslvpn_vnc: |
| 454 |
aliases: ['sslvpn-vnc'] |
| 455 |
type: str |
| 456 |
description: Sslvpn vnc. |
| 457 |
choices: ['disable', 'enable'] |
| 458 |
sslvpn_webapp: |
| 459 |
aliases: ['sslvpn-webapp'] |
| 460 |
type: str |
| 461 |
description: Sslvpn webapp. |
| 462 |
choices: ['disable', 'enable'] |
| 463 |
sso_attribute_value: |
| 464 |
aliases: ['sso-attribute-value'] |
| 465 |
type: str |
| 466 |
description: Name of the RADIUS user group that this local user group represents. |
| 467 |
user_id: |
| 468 |
aliases: ['user-id'] |
| 469 |
type: str |
| 470 |
description: Guest user ID type. |
| 471 |
choices: ['email', 'auto-generate', 'specify'] |
| 472 |
user_name: |
| 473 |
aliases: ['user-name'] |
| 474 |
type: str |
| 475 |
description: Enable/disable the guest user name entry. |
| 476 |
choices: ['disable', 'enable'] |
| 477 |
negate: |
| 478 |
type: str |
| 479 |
description: Negate. |
| 480 |
choices: ['disable', 'enable'] |
| 481 |
logic_type: |
| 482 |
aliases: ['logic-type'] |
| 483 |
type: str |
| 484 |
description: Set the logic between members or matching entries. |
| 485 |
choices: ['or', 'and'] |
| 486 |
negate: |
| 487 |
type: str |
| 488 |
description: Negate. |
| 489 |
choices: ['disable', 'enable'] |
| 490 |
''' |
| 491 |
|
| 492 |
EXAMPLES = ''' |
| 493 |
- name: Example playbook |
| 494 |
hosts: fortimanagers |
| 495 |
gather_facts: false |
| 496 |
connection: httpapi |
| 497 |
vars: |
| 498 |
ansible_httpapi_use_ssl: true |
| 499 |
ansible_httpapi_validate_certs: false |
| 500 |
ansible_httpapi_port: 443 |
| 501 |
tasks: |
| 502 |
- name: Configure user groups. |
| 503 |
fortinet.fortimanager.fmgr_user_group: |
| 504 |
bypass_validation: false |
| 505 |
adom: FortiCarrier |
| 506 |
state: present |
| 507 |
user_group: |
| 508 |
id: 1 |
| 509 |
name: ansible-test-group |
| 510 |
password: specify # <value in [auto-generate, specify, disable]> |
| 511 |
user_id: email # <value in [email, auto-generate, specify]> |
| 512 |
|
| 513 |
- name: Gathering fortimanager facts |
| 514 |
hosts: fortimanagers |
| 515 |
gather_facts: false |
| 516 |
connection: httpapi |
| 517 |
vars: |
| 518 |
ansible_httpapi_use_ssl: true |
| 519 |
ansible_httpapi_validate_certs: false |
| 520 |
ansible_httpapi_port: 443 |
| 521 |
tasks: |
| 522 |
- name: Retrieve all the user groups |
| 523 |
fortinet.fortimanager.fmgr_fact: |
| 524 |
facts: |
| 525 |
selector: "user_group" |
| 526 |
params: |
| 527 |
adom: "ansible" |
| 528 |
group: "your_value" |
| 529 |
''' |
| 530 |
|
| 531 |
RETURN = ''' |
| 532 |
meta: |
| 533 |
description: The result of the request. |
| 534 |
type: dict |
| 535 |
returned: always |
| 536 |
contains: |
| 537 |
request_url: |
| 538 |
description: The full url requested. |
| 539 |
returned: always |
| 540 |
type: str |
| 541 |
sample: /sys/login/user |
| 542 |
response_code: |
| 543 |
description: The status of api request. |
| 544 |
returned: always |
| 545 |
type: int |
| 546 |
sample: 0 |
| 547 |
response_data: |
| 548 |
description: The api response. |
| 549 |
type: list |
| 550 |
returned: always |
| 551 |
response_message: |
| 552 |
description: The descriptive message of the api response. |
| 553 |
type: str |
| 554 |
returned: always |
| 555 |
sample: OK. |
| 556 |
system_information: |
| 557 |
description: The information of the target system. |
| 558 |
type: dict |
| 559 |
returned: always |
| 560 |
rc: |
| 561 |
description: The status the request. |
| 562 |
type: int |
| 563 |
returned: always |
| 564 |
sample: 0 |
| 565 |
version_check_warning: |
| 566 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 567 |
type: list |
| 568 |
returned: complex |
| 569 |
''' |
| 570 |
from ansible.module_utils.basic import AnsibleModule |
| 571 |
from ansible.module_utils.connection import Connection |
| 572 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 573 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 574 |
|
| 575 |
|
| 576 |
def main(): |
| 577 |
urls_list = [ |
| 578 |
'/pm/config/adom/{adom}/obj/user/group', |
| 579 |
'/pm/config/global/obj/user/group' |
| 580 |
] |
| 581 |
module_arg_spec = { |
| 582 |
'adom': {'required': True, 'type': 'str'}, |
| 583 |
'revision_note': {'type': 'str'}, |
| 584 |
'user_group': { |
| 585 |
'type': 'dict', 'v_range': [['6.0.0', '']], |
| 586 |
'options': { |
| 587 |
'auth-concurrent-override': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 588 |
'auth-concurrent-value': {'type': 'int'}, |
| 589 |
'authtimeout': {'type': 'int'}, |
| 590 |
'company': {'choices': ['optional', 'mandatory', 'disabled'], 'type': 'str'}, |
| 591 |
'email': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 592 |
'expire': {'type': 'int'}, |
| 593 |
'expire-type': {'choices': ['immediately', 'first-successful-login'], 'type': 'str'}, |
| 594 |
'group-type': {'choices': ['firewall', 'directory-service', 'fsso-service', 'guest', 'rsso'], 'type': 'str'}, |
| 595 |
'guest': { |
| 596 |
'type': 'list', |
| 597 |
'options': { |
| 598 |
'comment': {'type': 'str'}, |
| 599 |
'company': {'type': 'str'}, |
| 600 |
'email': {'type': 'str'}, |
| 601 |
'expiration': {'type': 'str'}, |
| 602 |
'mobile-phone': {'type': 'str'}, |
| 603 |
'name': {'type': 'str'}, |
| 604 |
'password': {'no_log': True, 'type': 'raw'}, |
| 605 |
'sponsor': {'type': 'str'}, |
| 606 |
'user-id': {'type': 'str'}, |
| 607 |
'group': {'v_range': [['6.2.0', '6.2.13']], 'type': 'str'}, |
| 608 |
'id': {'v_range': [['6.2.3', '']], 'type': 'int'} |
| 609 |
}, |
| 610 |
'elements': 'dict' |
| 611 |
}, |
| 612 |
'http-digest-realm': {'type': 'str'}, |
| 613 |
'id': {'type': 'int'}, |
| 614 |
'match': { |
| 615 |
'type': 'list', |
| 616 |
'options': {'_gui_meta': {'type': 'str'}, 'group-name': {'type': 'str'}, 'id': {'type': 'int'}, 'server-name': {'type': 'str'}}, |
| 617 |
'elements': 'dict' |
| 618 |
}, |
| 619 |
'max-accounts': {'type': 'int'}, |
| 620 |
'member': {'type': 'list', 'elements': 'str'}, |
| 621 |
'mobile-phone': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 622 |
'multiple-guest-add': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 623 |
'name': {'required': True, 'type': 'str'}, |
| 624 |
'password': {'choices': ['auto-generate', 'specify', 'disable'], 'no_log': True, 'type': 'str'}, |
| 625 |
'sms-custom-server': {'type': 'str'}, |
| 626 |
'sms-server': {'choices': ['fortiguard', 'custom'], 'type': 'str'}, |
| 627 |
'sponsor': {'choices': ['optional', 'mandatory', 'disabled'], 'type': 'str'}, |
| 628 |
'sso-attribute-value': {'type': 'str'}, |
| 629 |
'user-id': {'choices': ['email', 'auto-generate', 'specify'], 'type': 'str'}, |
| 630 |
'user-name': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 631 |
'dynamic_mapping': { |
| 632 |
'v_range': [['7.0.2', '']], |
| 633 |
'type': 'list', |
| 634 |
'options': { |
| 635 |
'_scope': { |
| 636 |
'v_range': [['7.0.2', '']], |
| 637 |
'type': 'list', |
| 638 |
'options': {'name': {'v_range': [['7.0.2', '']], 'type': 'str'}, 'vdom': {'v_range': [['7.0.2', '']], 'type': 'str'}}, |
| 639 |
'elements': 'dict' |
| 640 |
}, |
| 641 |
'auth-concurrent-override': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 642 |
'auth-concurrent-value': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 643 |
'authtimeout': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 644 |
'company': {'v_range': [['7.0.2', '']], 'choices': ['optional', 'mandatory', 'disabled'], 'type': 'str'}, |
| 645 |
'email': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 646 |
'expire': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 647 |
'expire-type': {'v_range': [['7.0.2', '']], 'choices': ['immediately', 'first-successful-login'], 'type': 'str'}, |
| 648 |
'group-type': { |
| 649 |
'v_range': [['7.0.2', '']], |
| 650 |
'choices': ['firewall', 'directory-service', 'fsso-service', 'guest', 'rsso'], |
| 651 |
'type': 'str' |
| 652 |
}, |
| 653 |
'guest': { |
| 654 |
'v_range': [['7.0.2', '']], |
| 655 |
'type': 'list', |
| 656 |
'options': { |
| 657 |
'comment': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 658 |
'company': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 659 |
'email': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 660 |
'expiration': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 661 |
'group': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 662 |
'id': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 663 |
'mobile-phone': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 664 |
'name': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 665 |
'password': {'v_range': [['7.0.2', '']], 'no_log': True, 'type': 'raw'}, |
| 666 |
'sponsor': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 667 |
'user-id': {'v_range': [['7.0.2', '']], 'type': 'str'} |
| 668 |
}, |
| 669 |
'elements': 'dict' |
| 670 |
}, |
| 671 |
'http-digest-realm': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 672 |
'id': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 673 |
'ldap-memberof': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 674 |
'logic-type': {'v_range': [['7.0.3', '']], 'choices': ['or', 'and'], 'type': 'str'}, |
| 675 |
'match': { |
| 676 |
'v_range': [['7.0.2', '']], |
| 677 |
'type': 'list', |
| 678 |
'options': { |
| 679 |
'_gui_meta': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 680 |
'group-name': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 681 |
'id': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 682 |
'server-name': {'v_range': [['7.0.2', '']], 'type': 'str'} |
| 683 |
}, |
| 684 |
'elements': 'dict' |
| 685 |
}, |
| 686 |
'max-accounts': {'v_range': [['7.0.2', '']], 'type': 'int'}, |
| 687 |
'member': {'v_range': [['7.0.2', '']], 'type': 'raw'}, |
| 688 |
'mobile-phone': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 689 |
'multiple-guest-add': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 690 |
'password': {'v_range': [['7.0.2', '']], 'choices': ['auto-generate', 'specify', 'disable'], 'no_log': True, 'type': 'str'}, |
| 691 |
'redir-url': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 692 |
'sms-custom-server': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 693 |
'sms-server': {'v_range': [['7.0.2', '']], 'choices': ['fortiguard', 'custom'], 'type': 'str'}, |
| 694 |
'sponsor': {'v_range': [['7.0.2', '']], 'choices': ['optional', 'mandatory', 'disabled'], 'type': 'str'}, |
| 695 |
'sslvpn-bookmarks-group': {'v_range': [['7.0.2', '']], 'type': 'raw'}, |
| 696 |
'sslvpn-cache-cleaner': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 697 |
'sslvpn-client-check': { |
| 698 |
'v_range': [['7.0.2', '']], |
| 699 |
'type': 'list', |
| 700 |
'choices': ['forticlient', 'forticlient-av', 'forticlient-fw', '3rdAV', '3rdFW'], |
| 701 |
'elements': 'str' |
| 702 |
}, |
| 703 |
'sslvpn-ftp': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 704 |
'sslvpn-http': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 705 |
'sslvpn-os-check': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 706 |
'sslvpn-os-check-list': { |
| 707 |
'v_range': [['7.0.2', '']], |
| 708 |
'type': 'dict', |
| 709 |
'options': { |
| 710 |
'action': {'v_range': [['7.0.2', '']], 'choices': ['allow', 'check-up-to-date', 'deny'], 'type': 'str'}, |
| 711 |
'latest-patch-level': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 712 |
'name': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 713 |
'tolerance': {'v_range': [['7.0.2', '']], 'type': 'int'} |
| 714 |
} |
| 715 |
}, |
| 716 |
'sslvpn-portal': {'v_range': [['7.0.2', '']], 'type': 'raw'}, |
| 717 |
'sslvpn-portal-heading': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 718 |
'sslvpn-rdp': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 719 |
'sslvpn-samba': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 720 |
'sslvpn-split-tunneling': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 721 |
'sslvpn-ssh': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 722 |
'sslvpn-telnet': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 723 |
'sslvpn-tunnel': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 724 |
'sslvpn-tunnel-endip': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 725 |
'sslvpn-tunnel-ip-mode': {'v_range': [['7.0.2', '']], 'choices': ['range', 'usrgrp'], 'type': 'str'}, |
| 726 |
'sslvpn-tunnel-startip': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 727 |
'sslvpn-virtual-desktop': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 728 |
'sslvpn-vnc': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 729 |
'sslvpn-webapp': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 730 |
'sso-attribute-value': {'v_range': [['7.0.2', '']], 'type': 'str'}, |
| 731 |
'user-id': {'v_range': [['7.0.2', '']], 'choices': ['email', 'auto-generate', 'specify'], 'type': 'str'}, |
| 732 |
'user-name': {'v_range': [['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 733 |
'negate': {'v_range': [['7.4.9', '7.4.10'], ['7.6.5', '']], 'choices': ['disable', 'enable'], 'type': 'str'} |
| 734 |
}, |
| 735 |
'elements': 'dict' |
| 736 |
}, |
| 737 |
'logic-type': {'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']], 'choices': ['or', 'and'], 'type': 'str'}, |
| 738 |
'negate': {'v_range': [['7.4.9', '7.4.10'], ['7.6.5', '']], 'choices': ['disable', 'enable'], 'type': 'str'} |
| 739 |
} |
| 740 |
} |
| 741 |
} |
| 742 |
|
| 743 |
module_option_spec = get_module_arg_spec('full crud') |
| 744 |
module_arg_spec.update(module_option_spec) |
| 745 |
check_galaxy_version(module_arg_spec) |
| 746 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'user_group'), |
| 747 |
supports_check_mode=True) |
| 748 |
if not module._socket_path: |
| 749 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 750 |
connection = Connection(module._socket_path) |
| 751 |
fmgr = NAPIManager('full crud', module_arg_spec, urls_list, |
| 752 |
'name', 'data', module, connection) |
| 753 |
fmgr.process_crud() |
| 754 |
module.exit_json(meta=module.params) |
| 755 |
|
| 756 |
|
| 757 |
if __name__ == '__main__': |
| 758 |
main() |