| 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_pkg_firewall_proxypolicy |
| 15 |
short_description: Configure proxy policies. |
| 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 |
pkg: |
| 29 |
description: The parameter (pkg) in requested url. |
| 30 |
type: str |
| 31 |
required: true |
| 32 |
pkg_firewall_proxypolicy: |
| 33 |
description: The top level parameters set. |
| 34 |
required: false |
| 35 |
type: dict |
| 36 |
suboptions: |
| 37 |
action: |
| 38 |
type: str |
| 39 |
description: Accept or deny traffic matching the policy parameters. |
| 40 |
choices: ['accept', 'deny', 'redirect', 'isolate'] |
| 41 |
application_list: |
| 42 |
aliases: ['application-list'] |
| 43 |
type: str |
| 44 |
description: Name of an existing Application list. |
| 45 |
av_profile: |
| 46 |
aliases: ['av-profile'] |
| 47 |
type: str |
| 48 |
description: Name of an existing Antivirus profile. |
| 49 |
comments: |
| 50 |
type: str |
| 51 |
description: Optional comments. |
| 52 |
disclaimer: |
| 53 |
type: str |
| 54 |
description: Web proxy disclaimer setting |
| 55 |
choices: ['disable', 'domain', 'policy', 'user'] |
| 56 |
dlp_sensor: |
| 57 |
aliases: ['dlp-sensor'] |
| 58 |
type: str |
| 59 |
description: Name of an existing DLP sensor. |
| 60 |
dstaddr: |
| 61 |
type: raw |
| 62 |
description: (list or str) Destination address objects. |
| 63 |
dstaddr_negate: |
| 64 |
aliases: ['dstaddr-negate'] |
| 65 |
type: str |
| 66 |
description: When enabled, destination addresses match against any address EXCEPT the specified destination addresses. |
| 67 |
choices: ['disable', 'enable'] |
| 68 |
dstaddr6: |
| 69 |
type: raw |
| 70 |
description: (list or str) IPv6 destination address objects. |
| 71 |
dstintf: |
| 72 |
type: raw |
| 73 |
description: (list or str) Destination interface names. |
| 74 |
global_label: |
| 75 |
aliases: ['global-label'] |
| 76 |
type: str |
| 77 |
description: Global web-based manager visible label. |
| 78 |
groups: |
| 79 |
type: raw |
| 80 |
description: (list or str) Names of group objects. |
| 81 |
http_tunnel_auth: |
| 82 |
aliases: ['http-tunnel-auth'] |
| 83 |
type: str |
| 84 |
description: Enable/disable HTTP tunnel authentication. |
| 85 |
choices: ['disable', 'enable'] |
| 86 |
icap_profile: |
| 87 |
aliases: ['icap-profile'] |
| 88 |
type: str |
| 89 |
description: Name of an existing ICAP profile. |
| 90 |
internet_service: |
| 91 |
aliases: ['internet-service'] |
| 92 |
type: str |
| 93 |
description: Enable/disable use of Internet Services for this policy. |
| 94 |
choices: ['disable', 'enable'] |
| 95 |
internet_service_custom: |
| 96 |
aliases: ['internet-service-custom'] |
| 97 |
type: raw |
| 98 |
description: (list or str) Custom Internet Service name. |
| 99 |
internet_service_id: |
| 100 |
aliases: ['internet-service-id'] |
| 101 |
type: raw |
| 102 |
description: (list or str) Internet Service ID. |
| 103 |
internet_service_negate: |
| 104 |
aliases: ['internet-service-negate'] |
| 105 |
type: str |
| 106 |
description: When enabled, Internet Services match against any internet service EXCEPT the selected Internet Service. |
| 107 |
choices: ['disable', 'enable'] |
| 108 |
ips_sensor: |
| 109 |
aliases: ['ips-sensor'] |
| 110 |
type: str |
| 111 |
description: Name of an existing IPS sensor. |
| 112 |
label: |
| 113 |
type: str |
| 114 |
description: VDOM-specific GUI visible label. |
| 115 |
logtraffic: |
| 116 |
type: str |
| 117 |
description: Enable/disable logging traffic through the policy. |
| 118 |
choices: ['disable', 'all', 'utm'] |
| 119 |
logtraffic_start: |
| 120 |
aliases: ['logtraffic-start'] |
| 121 |
type: str |
| 122 |
description: Enable/disable policy log traffic start. |
| 123 |
choices: ['disable', 'enable'] |
| 124 |
mms_profile: |
| 125 |
aliases: ['mms-profile'] |
| 126 |
type: str |
| 127 |
description: Name of an existing MMS profile. |
| 128 |
policyid: |
| 129 |
type: int |
| 130 |
description: Policy ID. |
| 131 |
required: true |
| 132 |
poolname: |
| 133 |
type: raw |
| 134 |
description: (list or str) Name of IP pool object. |
| 135 |
profile_group: |
| 136 |
aliases: ['profile-group'] |
| 137 |
type: str |
| 138 |
description: Name of profile group. |
| 139 |
profile_protocol_options: |
| 140 |
aliases: ['profile-protocol-options'] |
| 141 |
type: str |
| 142 |
description: Name of an existing Protocol options profile. |
| 143 |
profile_type: |
| 144 |
aliases: ['profile-type'] |
| 145 |
type: str |
| 146 |
description: Determine whether the firewall policy allows security profile groups or single profiles only. |
| 147 |
choices: ['single', 'group'] |
| 148 |
proxy: |
| 149 |
type: str |
| 150 |
description: Type of explicit proxy. |
| 151 |
choices: ['explicit-web', 'transparent-web', 'ftp', 'wanopt', 'ssh', 'ssh-tunnel', |
| 152 |
'access-proxy', 'ztna-proxy'] |
| 153 |
redirect_url: |
| 154 |
aliases: ['redirect-url'] |
| 155 |
type: str |
| 156 |
description: Redirect URL for further explicit web proxy processing. |
| 157 |
replacemsg_override_group: |
| 158 |
aliases: ['replacemsg-override-group'] |
| 159 |
type: str |
| 160 |
description: Authentication replacement message override group. |
| 161 |
scan_botnet_connections: |
| 162 |
aliases: ['scan-botnet-connections'] |
| 163 |
type: str |
| 164 |
description: Enable/disable scanning of connections to Botnet servers. |
| 165 |
choices: ['disable', 'block', 'monitor'] |
| 166 |
schedule: |
| 167 |
type: str |
| 168 |
description: Name of schedule object. |
| 169 |
service: |
| 170 |
type: raw |
| 171 |
description: (list or str) Name of service objects. |
| 172 |
service_negate: |
| 173 |
aliases: ['service-negate'] |
| 174 |
type: str |
| 175 |
description: When enabled, services match against any service EXCEPT the specified destination services. |
| 176 |
choices: ['disable', 'enable'] |
| 177 |
spamfilter_profile: |
| 178 |
aliases: ['spamfilter-profile'] |
| 179 |
type: str |
| 180 |
description: Name of an existing Spam filter profile. |
| 181 |
srcaddr: |
| 182 |
type: raw |
| 183 |
description: (list or str) Source address objects |
| 184 |
srcaddr_negate: |
| 185 |
aliases: ['srcaddr-negate'] |
| 186 |
type: str |
| 187 |
description: When enabled, source addresses match against any address EXCEPT the specified source addresses. |
| 188 |
choices: ['disable', 'enable'] |
| 189 |
srcaddr6: |
| 190 |
type: raw |
| 191 |
description: (list or str) IPv6 source address objects. |
| 192 |
srcintf: |
| 193 |
type: raw |
| 194 |
description: (list or str) Source interface names. |
| 195 |
ssl_ssh_profile: |
| 196 |
aliases: ['ssl-ssh-profile'] |
| 197 |
type: str |
| 198 |
description: Name of an existing SSL SSH profile. |
| 199 |
status: |
| 200 |
type: str |
| 201 |
description: Enable/disable the active status of the policy. |
| 202 |
choices: ['disable', 'enable'] |
| 203 |
tags: |
| 204 |
type: str |
| 205 |
description: Names of object-tags applied to address. |
| 206 |
transparent: |
| 207 |
type: str |
| 208 |
description: Enable to use the IP address of the client to connect to the server. |
| 209 |
choices: ['disable', 'enable'] |
| 210 |
users: |
| 211 |
type: raw |
| 212 |
description: (list or str) Names of user objects. |
| 213 |
utm_status: |
| 214 |
aliases: ['utm-status'] |
| 215 |
type: str |
| 216 |
description: Enable the use of UTM profiles/sensors/lists. |
| 217 |
choices: ['disable', 'enable'] |
| 218 |
uuid: |
| 219 |
type: str |
| 220 |
description: Universally Unique Identifier |
| 221 |
waf_profile: |
| 222 |
aliases: ['waf-profile'] |
| 223 |
type: str |
| 224 |
description: Name of an existing Web application firewall profile. |
| 225 |
webcache: |
| 226 |
type: str |
| 227 |
description: Enable/disable web caching. |
| 228 |
choices: ['disable', 'enable'] |
| 229 |
webcache_https: |
| 230 |
aliases: ['webcache-https'] |
| 231 |
type: str |
| 232 |
description: Enable/disable web caching for HTTPS |
| 233 |
choices: ['disable', 'enable'] |
| 234 |
webfilter_profile: |
| 235 |
aliases: ['webfilter-profile'] |
| 236 |
type: str |
| 237 |
description: Name of an existing Web filter profile. |
| 238 |
webproxy_forward_server: |
| 239 |
aliases: ['webproxy-forward-server'] |
| 240 |
type: str |
| 241 |
description: Name of web proxy forward server. |
| 242 |
webproxy_profile: |
| 243 |
aliases: ['webproxy-profile'] |
| 244 |
type: str |
| 245 |
description: Name of web proxy profile. |
| 246 |
cifs_profile: |
| 247 |
aliases: ['cifs-profile'] |
| 248 |
type: str |
| 249 |
description: Name of an existing CIFS profile. |
| 250 |
emailfilter_profile: |
| 251 |
aliases: ['emailfilter-profile'] |
| 252 |
type: str |
| 253 |
description: Name of an existing email filter profile. |
| 254 |
internet_service_custom_group: |
| 255 |
aliases: ['internet-service-custom-group'] |
| 256 |
type: raw |
| 257 |
description: (list or str) Custom Internet Service group name. |
| 258 |
internet_service_group: |
| 259 |
aliases: ['internet-service-group'] |
| 260 |
type: raw |
| 261 |
description: (list or str) Internet Service group name. |
| 262 |
session_ttl: |
| 263 |
aliases: ['session-ttl'] |
| 264 |
type: raw |
| 265 |
description: (int or str) TTL in seconds for sessions accepted by this policy |
| 266 |
ssh_filter_profile: |
| 267 |
aliases: ['ssh-filter-profile'] |
| 268 |
type: str |
| 269 |
description: Name of an existing SSH filter profile. |
| 270 |
ssh_policy_redirect: |
| 271 |
aliases: ['ssh-policy-redirect'] |
| 272 |
type: str |
| 273 |
description: Redirect SSH traffic to matching transparent proxy policy. |
| 274 |
choices: ['disable', 'enable'] |
| 275 |
decrypted_traffic_mirror: |
| 276 |
aliases: ['decrypted-traffic-mirror'] |
| 277 |
type: str |
| 278 |
description: Decrypted traffic mirror. |
| 279 |
internet_service_name: |
| 280 |
aliases: ['internet-service-name'] |
| 281 |
type: raw |
| 282 |
description: (list or str) Internet Service name. |
| 283 |
file_filter_profile: |
| 284 |
aliases: ['file-filter-profile'] |
| 285 |
type: str |
| 286 |
description: Name of an existing file-filter profile. |
| 287 |
name: |
| 288 |
type: str |
| 289 |
description: Policy name. |
| 290 |
access_proxy: |
| 291 |
aliases: ['access-proxy'] |
| 292 |
type: raw |
| 293 |
description: (list or str) Access Proxy. |
| 294 |
device_ownership: |
| 295 |
aliases: ['device-ownership'] |
| 296 |
type: str |
| 297 |
description: When enabled, the ownership enforcement will be done at policy level. |
| 298 |
choices: ['disable', 'enable'] |
| 299 |
videofilter_profile: |
| 300 |
aliases: ['videofilter-profile'] |
| 301 |
type: str |
| 302 |
description: Name of an existing VideoFilter profile. |
| 303 |
voip_profile: |
| 304 |
aliases: ['voip-profile'] |
| 305 |
type: str |
| 306 |
description: Name of an existing VoIP profile. |
| 307 |
ztna_ems_tag: |
| 308 |
aliases: ['ztna-ems-tag'] |
| 309 |
type: raw |
| 310 |
description: (list or str) ZTNA EMS Tag names. |
| 311 |
access_proxy6: |
| 312 |
aliases: ['access-proxy6'] |
| 313 |
type: raw |
| 314 |
description: (list or str) IPv6 access proxy. |
| 315 |
block_notification: |
| 316 |
aliases: ['block-notification'] |
| 317 |
type: str |
| 318 |
description: Enable/disable block notification. |
| 319 |
choices: ['disable', 'enable'] |
| 320 |
dlp_profile: |
| 321 |
aliases: ['dlp-profile'] |
| 322 |
type: str |
| 323 |
description: Name of an existing DLP profile. |
| 324 |
sctp_filter_profile: |
| 325 |
aliases: ['sctp-filter-profile'] |
| 326 |
type: str |
| 327 |
description: Name of an existing SCTP filter profile. |
| 328 |
ztna_tags_match_logic: |
| 329 |
aliases: ['ztna-tags-match-logic'] |
| 330 |
type: str |
| 331 |
description: ZTNA tag matching logic. |
| 332 |
choices: ['or', 'and'] |
| 333 |
casb_profile: |
| 334 |
aliases: ['casb-profile'] |
| 335 |
type: str |
| 336 |
description: Name of an existing CASB profile. |
| 337 |
detect_https_in_http_request: |
| 338 |
aliases: ['detect-https-in-http-request'] |
| 339 |
type: str |
| 340 |
description: Enable/disable detection of HTTPS in HTTP request. |
| 341 |
choices: ['disable', 'enable'] |
| 342 |
diameter_filter_profile: |
| 343 |
aliases: ['diameter-filter-profile'] |
| 344 |
type: str |
| 345 |
description: Name of an existing Diameter filter profile. |
| 346 |
internet_service6: |
| 347 |
aliases: ['internet-service6'] |
| 348 |
type: str |
| 349 |
description: Enable/disable use of Internet Services IPv6 for this policy. |
| 350 |
choices: ['disable', 'enable'] |
| 351 |
internet_service6_custom: |
| 352 |
aliases: ['internet-service6-custom'] |
| 353 |
type: raw |
| 354 |
description: (list) Custom Internet Service IPv6 name. |
| 355 |
internet_service6_custom_group: |
| 356 |
aliases: ['internet-service6-custom-group'] |
| 357 |
type: raw |
| 358 |
description: (list) Custom Internet Service IPv6 group name. |
| 359 |
internet_service6_group: |
| 360 |
aliases: ['internet-service6-group'] |
| 361 |
type: raw |
| 362 |
description: (list) Internet Service IPv6 group name. |
| 363 |
internet_service6_name: |
| 364 |
aliases: ['internet-service6-name'] |
| 365 |
type: raw |
| 366 |
description: (list) Internet Service IPv6 name. |
| 367 |
internet_service6_negate: |
| 368 |
aliases: ['internet-service6-negate'] |
| 369 |
type: str |
| 370 |
description: When enabled, Internet Services match against any internet service IPv6 EXCEPT the selected Internet Service IPv6. |
| 371 |
choices: ['disable', 'enable'] |
| 372 |
ips_voip_filter: |
| 373 |
aliases: ['ips-voip-filter'] |
| 374 |
type: str |
| 375 |
description: Name of an existing VoIP |
| 376 |
virtual_patch_profile: |
| 377 |
aliases: ['virtual-patch-profile'] |
| 378 |
type: str |
| 379 |
description: Virtual patch profile. |
| 380 |
_policy_block: |
| 381 |
type: int |
| 382 |
description: Assigned policy block. |
| 383 |
dnsfilter_profile: |
| 384 |
aliases: ['dnsfilter-profile'] |
| 385 |
type: raw |
| 386 |
description: (list) Name of an existing DNS filter profile. |
| 387 |
log_http_transaction: |
| 388 |
aliases: ['log-http-transaction'] |
| 389 |
type: str |
| 390 |
description: Enable/disable HTTP transaction log. |
| 391 |
choices: ['disable', 'enable'] |
| 392 |
ztna_proxy: |
| 393 |
aliases: ['ztna-proxy'] |
| 394 |
type: raw |
| 395 |
description: (list) IPv4 ZTNA traffic forward proxy. |
| 396 |
isolator_server: |
| 397 |
aliases: ['isolator-server'] |
| 398 |
type: raw |
| 399 |
description: (list) Isolator server name. |
| 400 |
url_risk: |
| 401 |
aliases: ['url-risk'] |
| 402 |
type: raw |
| 403 |
description: (list) URL risk level name. |
| 404 |
ztna_ems_tag_negate: |
| 405 |
aliases: ['ztna-ems-tag-negate'] |
| 406 |
type: str |
| 407 |
description: When enabled, ZTNA EMS tags match against any tag EXCEPT the specified ZTNA EMS tags. |
| 408 |
choices: ['disable', 'enable'] |
| 409 |
https_sub_category: |
| 410 |
aliases: ['https-sub-category'] |
| 411 |
type: str |
| 412 |
description: Enable/disable HTTPS sub-category policy matching. |
| 413 |
choices: ['disable', 'enable'] |
| 414 |
telemetry_profile: |
| 415 |
aliases: ['telemetry-profile'] |
| 416 |
type: raw |
| 417 |
description: (list) Name of an existing telemetry profile. |
| 418 |
poolname6: |
| 419 |
type: raw |
| 420 |
description: (list) Name of IPv6 pool object. |
| 421 |
internet_service_fortiguard: |
| 422 |
aliases: ['internet-service-fortiguard'] |
| 423 |
type: raw |
| 424 |
description: (list) FortiGuard Internet Service name. |
| 425 |
internet_service6_fortiguard: |
| 426 |
aliases: ['internet-service6-fortiguard'] |
| 427 |
type: raw |
| 428 |
description: (list) FortiGuard Internet Service IPv6 name. |
| 429 |
''' |
| 430 |
|
| 431 |
EXAMPLES = ''' |
| 432 |
- name: Example playbook |
| 433 |
hosts: fortimanagers |
| 434 |
gather_facts: false |
| 435 |
connection: httpapi |
| 436 |
vars: |
| 437 |
ansible_httpapi_use_ssl: true |
| 438 |
ansible_httpapi_validate_certs: false |
| 439 |
ansible_httpapi_port: 443 |
| 440 |
tasks: |
| 441 |
- name: Configure proxy policies. |
| 442 |
fortinet.fortimanager.fmgr_pkg_firewall_proxypolicy: |
| 443 |
bypass_validation: false |
| 444 |
adom: ansible |
| 445 |
pkg: ansible # package name |
| 446 |
state: present |
| 447 |
pkg_firewall_proxypolicy: |
| 448 |
action: accept # <value in [accept, deny, redirect]> |
| 449 |
comments: ansible-comment |
| 450 |
dstaddr: all |
| 451 |
dstintf: any |
| 452 |
policyid: 1 |
| 453 |
schedule: always |
| 454 |
service: ALL |
| 455 |
srcaddr: all |
| 456 |
srcintf: any |
| 457 |
status: disable |
| 458 |
|
| 459 |
- name: Gathering fortimanager facts |
| 460 |
hosts: fortimanagers |
| 461 |
gather_facts: false |
| 462 |
connection: httpapi |
| 463 |
vars: |
| 464 |
ansible_httpapi_use_ssl: true |
| 465 |
ansible_httpapi_validate_certs: false |
| 466 |
ansible_httpapi_port: 443 |
| 467 |
tasks: |
| 468 |
- name: Retrieve all the proxy policies |
| 469 |
fortinet.fortimanager.fmgr_fact: |
| 470 |
facts: |
| 471 |
selector: "pkg_firewall_proxypolicy" |
| 472 |
params: |
| 473 |
adom: "ansible" |
| 474 |
proxy_policy: "your_value" |
| 475 |
pkg: "ansible" # package name |
| 476 |
''' |
| 477 |
|
| 478 |
RETURN = ''' |
| 479 |
meta: |
| 480 |
description: The result of the request. |
| 481 |
type: dict |
| 482 |
returned: always |
| 483 |
contains: |
| 484 |
request_url: |
| 485 |
description: The full url requested. |
| 486 |
returned: always |
| 487 |
type: str |
| 488 |
sample: /sys/login/user |
| 489 |
response_code: |
| 490 |
description: The status of api request. |
| 491 |
returned: always |
| 492 |
type: int |
| 493 |
sample: 0 |
| 494 |
response_data: |
| 495 |
description: The api response. |
| 496 |
type: list |
| 497 |
returned: always |
| 498 |
response_message: |
| 499 |
description: The descriptive message of the api response. |
| 500 |
type: str |
| 501 |
returned: always |
| 502 |
sample: OK. |
| 503 |
system_information: |
| 504 |
description: The information of the target system. |
| 505 |
type: dict |
| 506 |
returned: always |
| 507 |
rc: |
| 508 |
description: The status the request. |
| 509 |
type: int |
| 510 |
returned: always |
| 511 |
sample: 0 |
| 512 |
version_check_warning: |
| 513 |
description: Warning if the parameters used in the playbook are not supported by the current FortiManager version. |
| 514 |
type: list |
| 515 |
returned: complex |
| 516 |
''' |
| 517 |
from ansible.module_utils.basic import AnsibleModule |
| 518 |
from ansible.module_utils.connection import Connection |
| 519 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass |
| 520 |
from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec |
| 521 |
|
| 522 |
|
| 523 |
def main(): |
| 524 |
urls_list = [ |
| 525 |
'/pm/config/adom/{adom}/pkg/{pkg}/firewall/proxy-policy' |
| 526 |
] |
| 527 |
module_arg_spec = { |
| 528 |
'adom': {'required': True, 'type': 'str'}, |
| 529 |
'pkg': {'required': True, 'type': 'str'}, |
| 530 |
'revision_note': {'type': 'str'}, |
| 531 |
'pkg_firewall_proxypolicy': { |
| 532 |
'type': 'dict', 'v_range': [['6.0.0', '']], |
| 533 |
'options': { |
| 534 |
'action': {'choices': ['accept', 'deny', 'redirect', 'isolate'], 'type': 'str'}, |
| 535 |
'application-list': {'type': 'str'}, |
| 536 |
'av-profile': {'type': 'str'}, |
| 537 |
'comments': {'type': 'str'}, |
| 538 |
'disclaimer': {'choices': ['disable', 'domain', 'policy', 'user'], 'type': 'str'}, |
| 539 |
'dlp-sensor': {'type': 'str'}, |
| 540 |
'dstaddr': {'type': 'raw'}, |
| 541 |
'dstaddr-negate': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 542 |
'dstaddr6': {'type': 'raw'}, |
| 543 |
'dstintf': {'type': 'raw'}, |
| 544 |
'global-label': {'type': 'str'}, |
| 545 |
'groups': {'type': 'raw'}, |
| 546 |
'http-tunnel-auth': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 547 |
'icap-profile': {'type': 'str'}, |
| 548 |
'internet-service': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 549 |
'internet-service-custom': {'type': 'raw'}, |
| 550 |
'internet-service-id': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'}, |
| 551 |
'internet-service-negate': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 552 |
'ips-sensor': {'type': 'str'}, |
| 553 |
'label': {'type': 'str'}, |
| 554 |
'logtraffic': {'choices': ['disable', 'all', 'utm'], 'type': 'str'}, |
| 555 |
'logtraffic-start': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 556 |
'mms-profile': {'v_range': [['6.0.0', '7.2.0'], ['7.2.6', '7.2.12'], ['7.4.3', '7.6.2']], 'type': 'str'}, |
| 557 |
'policyid': {'required': True, 'type': 'int'}, |
| 558 |
'poolname': {'type': 'raw'}, |
| 559 |
'profile-group': {'type': 'str'}, |
| 560 |
'profile-protocol-options': {'v_range': [['6.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 561 |
'profile-type': {'choices': ['single', 'group'], 'type': 'str'}, |
| 562 |
'proxy': { |
| 563 |
'choices': ['explicit-web', 'transparent-web', 'ftp', 'wanopt', 'ssh', 'ssh-tunnel', 'access-proxy', 'ztna-proxy'], |
| 564 |
'type': 'str' |
| 565 |
}, |
| 566 |
'redirect-url': {'type': 'str'}, |
| 567 |
'replacemsg-override-group': {'type': 'str'}, |
| 568 |
'scan-botnet-connections': {'v_range': [['6.0.0', '7.2.1']], 'choices': ['disable', 'block', 'monitor'], 'type': 'str'}, |
| 569 |
'schedule': {'type': 'str'}, |
| 570 |
'service': {'type': 'raw'}, |
| 571 |
'service-negate': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 572 |
'spamfilter-profile': {'v_range': [['6.0.0', '7.2.1']], 'type': 'str'}, |
| 573 |
'srcaddr': {'type': 'raw'}, |
| 574 |
'srcaddr-negate': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 575 |
'srcaddr6': {'type': 'raw'}, |
| 576 |
'srcintf': {'type': 'raw'}, |
| 577 |
'ssl-ssh-profile': {'v_range': [['6.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 578 |
'status': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 579 |
'tags': {'v_range': [['6.0.0', '6.4.15']], 'type': 'str'}, |
| 580 |
'transparent': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 581 |
'users': {'type': 'raw'}, |
| 582 |
'utm-status': {'choices': ['disable', 'enable'], 'type': 'str'}, |
| 583 |
'uuid': {'type': 'str'}, |
| 584 |
'waf-profile': {'type': 'str'}, |
| 585 |
'webcache': {'v_range': [['6.0.0', '7.2.0'], ['7.2.6', '7.2.12'], ['7.4.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 586 |
'webcache-https': {'v_range': [['6.0.0', '7.2.0'], ['7.2.6', '7.2.12'], ['7.4.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 587 |
'webfilter-profile': {'type': 'str'}, |
| 588 |
'webproxy-forward-server': {'type': 'str'}, |
| 589 |
'webproxy-profile': {'type': 'str'}, |
| 590 |
'cifs-profile': {'v_range': [['6.2.0', '']], 'type': 'str'}, |
| 591 |
'emailfilter-profile': {'v_range': [['6.2.0', '']], 'type': 'str'}, |
| 592 |
'internet-service-custom-group': {'v_range': [['6.2.0', '']], 'type': 'raw'}, |
| 593 |
'internet-service-group': {'v_range': [['6.2.0', '']], 'type': 'raw'}, |
| 594 |
'session-ttl': {'v_range': [['6.2.0', '']], 'type': 'raw'}, |
| 595 |
'ssh-filter-profile': {'v_range': [['6.2.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 596 |
'ssh-policy-redirect': {'v_range': [['6.2.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 597 |
'decrypted-traffic-mirror': {'v_range': [['6.4.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 598 |
'internet-service-name': {'v_range': [['6.4.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 599 |
'file-filter-profile': {'v_range': [['6.4.1', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 600 |
'name': {'v_range': [['6.4.2', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 601 |
'access-proxy': {'v_range': [['7.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 602 |
'device-ownership': { |
| 603 |
'v_range': [['7.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], |
| 604 |
'choices': ['disable', 'enable'], |
| 605 |
'type': 'str' |
| 606 |
}, |
| 607 |
'videofilter-profile': {'v_range': [['7.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 608 |
'voip-profile': {'v_range': [['7.0.0', '7.2.2'], ['7.2.6', '7.2.12'], ['7.4.3', '']], 'type': 'str'}, |
| 609 |
'ztna-ems-tag': {'v_range': [['7.0.0', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 610 |
'access-proxy6': {'v_range': [['7.0.1', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 611 |
'block-notification': { |
| 612 |
'v_range': [['7.0.3', '7.2.1'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], |
| 613 |
'choices': ['disable', 'enable'], |
| 614 |
'type': 'str' |
| 615 |
}, |
| 616 |
'dlp-profile': {'v_range': [['7.2.0', '7.2.1'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 617 |
'sctp-filter-profile': {'v_range': [['7.0.1', '7.2.2'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 618 |
'ztna-tags-match-logic': { |
| 619 |
'v_range': [['7.0.2', '7.2.1'], ['7.2.4', '7.2.4'], ['7.2.6', '7.2.12'], ['7.4.2', '']], |
| 620 |
'choices': ['or', 'and'], |
| 621 |
'type': 'str' |
| 622 |
}, |
| 623 |
'casb-profile': {'v_range': [['7.4.2', '']], 'type': 'str'}, |
| 624 |
'detect-https-in-http-request': {'v_range': [['7.4.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 625 |
'diameter-filter-profile': {'v_range': [['7.4.2', '']], 'type': 'str'}, |
| 626 |
'internet-service6': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 627 |
'internet-service6-custom': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 628 |
'internet-service6-custom-group': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 629 |
'internet-service6-group': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 630 |
'internet-service6-name': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'raw'}, |
| 631 |
'internet-service6-negate': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 632 |
'ips-voip-filter': {'v_range': [['7.2.6', '7.2.12'], ['7.4.2', '']], 'type': 'str'}, |
| 633 |
'virtual-patch-profile': {'v_range': [['7.4.2', '']], 'type': 'str'}, |
| 634 |
'_policy_block': {'v_range': [['7.6.0', '']], 'type': 'int'}, |
| 635 |
'dnsfilter-profile': {'v_range': [['7.6.0', '']], 'type': 'raw'}, |
| 636 |
'log-http-transaction': {'v_range': [['7.6.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 637 |
'ztna-proxy': {'v_range': [['7.6.0', '']], 'type': 'raw'}, |
| 638 |
'isolator-server': {'v_range': [['7.6.2', '']], 'type': 'raw'}, |
| 639 |
'url-risk': {'v_range': [['7.6.2', '']], 'type': 'raw'}, |
| 640 |
'ztna-ems-tag-negate': {'v_range': [['7.6.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 641 |
'https-sub-category': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}, |
| 642 |
'telemetry-profile': {'v_range': [['7.6.3', '']], 'type': 'raw'}, |
| 643 |
'poolname6': {'v_range': [['7.4.8', '7.4.10'], ['7.6.5', '']], 'type': 'raw'}, |
| 644 |
'internet-service-fortiguard': {'v_range': [['7.6.4', '']], 'type': 'raw'}, |
| 645 |
'internet-service6-fortiguard': {'v_range': [['7.6.4', '']], 'type': 'raw'} |
| 646 |
} |
| 647 |
} |
| 648 |
} |
| 649 |
|
| 650 |
module_option_spec = get_module_arg_spec('full crud') |
| 651 |
module_arg_spec.update(module_option_spec) |
| 652 |
check_galaxy_version(module_arg_spec) |
| 653 |
module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'pkg_firewall_proxypolicy'), |
| 654 |
supports_check_mode=True) |
| 655 |
if not module._socket_path: |
| 656 |
module.fail_json(msg='MUST RUN IN HTTPAPI MODE') |
| 657 |
connection = Connection(module._socket_path) |
| 658 |
fmgr = NAPIManager('full crud', module_arg_spec, urls_list, |
| 659 |
'policyid', 'data', module, connection) |
| 660 |
fmgr.process_crud() |
| 661 |
module.exit_json(meta=module.params) |
| 662 |
|
| 663 |
|
| 664 |
if __name__ == '__main__': |
| 665 |
main() |