fortinet.fortimanager.fmgr_pkg_firewall_proxypolicy (2.4.0) — module

Configure proxy policies.

| "added in version" 2.0.0 of fortinet.fortimanager"

Authors: Xinwei Du (@dux-fortinet), Xing Li (@lix-fortinet), Jie Xue (@JieX19), Link Zheng (@chillancezen), Frank Shen (@fshen01), Hongbin Lu (@fgtdev-hblu)

preview | supported by community

Install collection

Install with ansible-galaxy collection install fortinet.fortimanager:==2.4.0


Add to requirements.yml

  collections:
    - name: fortinet.fortimanager
      version: 2.4.0

Description

This module is able to configure a FortiManager device.

Examples include all parameters and values which need to be adjusted to data sources before usage.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Example playbook
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure proxy policies.
      fortinet.fortimanager.fmgr_pkg_firewall_proxypolicy:
        bypass_validation: false
        adom: ansible
        pkg: ansible # package name
        state: present
        pkg_firewall_proxypolicy:
          action: accept # <value in [accept, deny, redirect]>
          comments: ansible-comment
          dstaddr: all
          dstintf: any
          policyid: 1
          schedule: always
          service: ALL
          srcaddr: all
          srcintf: any
          status: disable
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gathering fortimanager facts
  hosts: fortimanagers
  gather_facts: false
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Retrieve all the proxy policies
      fortinet.fortimanager.fmgr_fact:
        facts:
          selector: "pkg_firewall_proxypolicy"
          params:
            adom: "ansible"
            proxy-policy: "your_value"
            pkg: "ansible" # package name

Inputs

    
pkg:
    description: The parameter (pkg) in requested url.
    required: true
    type: str

adom:
    description: The parameter (adom) in requested url.
    required: true
    type: str

state:
    choices:
    - present
    - absent
    description: The directive to create, update or delete an object.
    required: true
    type: str

rc_failed:
    description: The rc codes list with which the conditions to fail will be overriden.
    elements: int
    type: list

enable_log:
    default: false
    description: Enable/Disable logging for task.
    type: bool

access_token:
    description: The token to access FortiManager without using username and password.
    type: str

rc_succeeded:
    description: The rc codes list with which the conditions to succeed will be overriden.
    elements: int
    type: list

proposed_method:
    choices:
    - update
    - set
    - add
    description: The overridden method for the underlying Json RPC request.
    type: str

bypass_validation:
    default: false
    description: Only set to True when module schema diffs with FortiManager API structure,
      module continues to execute without validating parameters.
    type: bool

workspace_locking_adom:
    description: The adom to lock for FortiManager running in workspace mode, the value
      can be global and others including root.
    type: str

forticloud_access_token:
    description: Authenticate Ansible client with forticloud API access token.
    type: str

pkg_firewall_proxypolicy:
    description: The top level parameters set.
    required: false
    suboptions:
      access-proxy:
        description: (list or str) Deprecated, please rename it to access_proxy. Access
          Proxy.
        type: raw
      access-proxy6:
        description: (list or str) Deprecated, please rename it to access_proxy6.
        type: raw
      action:
        choices:
        - accept
        - deny
        - redirect
        description: Accept or deny traffic matching the policy parameters.
        type: str
      application-list:
        description: Deprecated, please rename it to application_list. Name of an existing
          Application list.
        type: str
      av-profile:
        description: Deprecated, please rename it to av_profile. Name of an existing Antivirus
          profile.
        type: str
      block-notification:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to block_notification. Enable/disable
          block notification.
        type: str
      casb-profile:
        description: Deprecated, please rename it to casb_profile. Name of an existing
          CASB profile.
        type: str
      cifs-profile:
        description: Deprecated, please rename it to cifs_profile. Name of an existing
          CIFS profile.
        type: str
      comments:
        description: Optional comments.
        type: str
      decrypted-traffic-mirror:
        description: Deprecated, please rename it to decrypted_traffic_mirror. Decrypted
          traffic mirror.
        type: str
      detect-https-in-http-request:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to detect_https_in_http_request. Enable/disable
          detection of HTTPS in HTTP request.
        type: str
      device-ownership:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to device_ownership. When enabled, the
          ownership enforcement will be done at policy level.
        type: str
      diameter-filter-profile:
        description: Deprecated, please rename it to diameter_filter_profile. Name of
          an existing Diameter filter profile.
        type: str
      disclaimer:
        choices:
        - disable
        - domain
        - policy
        - user
        description: Web proxy disclaimer setting
        type: str
      dlp-profile:
        description: Deprecated, please rename it to dlp_profile. Name of an existing
          DLP profile.
        type: str
      dlp-sensor:
        description: Deprecated, please rename it to dlp_sensor. Name of an existing DLP
          sensor.
        type: str
      dstaddr:
        description: (list or str) Destination address objects.
        type: raw
      dstaddr-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to dstaddr_negate. When enabled, destination
          addresses match against any address EXCEPT the s...
        type: str
      dstaddr6:
        description: (list or str) IPv6 destination address objects.
        type: raw
      dstintf:
        description: (list or str) Destination interface names.
        type: raw
      emailfilter-profile:
        description: Deprecated, please rename it to emailfilter_profile. Name of an existing
          email filter profile.
        type: str
      file-filter-profile:
        description: Deprecated, please rename it to file_filter_profile. Name of an existing
          file-filter profile.
        type: str
      global-label:
        description: Deprecated, please rename it to global_label. Global web-based manager
          visible label.
        type: str
      groups:
        description: (list or str) Names of group objects.
        type: raw
      http-tunnel-auth:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to http_tunnel_auth. Enable/disable
          HTTP tunnel authentication.
        type: str
      icap-profile:
        description: Deprecated, please rename it to icap_profile. Name of an existing
          ICAP profile.
        type: str
      internet-service:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service. Enable/disable
          use of Internet Services for this policy.
        type: str
      internet-service-custom:
        description: (list or str) Deprecated, please rename it to internet_service_custom.
          Custom Internet Service name.
        type: raw
      internet-service-custom-group:
        description: (list or str) Deprecated, please rename it to internet_service_custom_group.
          Custom Internet Service group name.
        type: raw
      internet-service-group:
        description: (list or str) Deprecated, please rename it to internet_service_group.
          Internet Service group name.
        type: raw
      internet-service-id:
        description: (list or str) Deprecated, please rename it to internet_service_id.
          Internet Service ID.
        type: raw
      internet-service-name:
        description: (list or str) Deprecated, please rename it to internet_service_name.
          Internet Service name.
        type: raw
      internet-service-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service_negate. When enabled,
          Internet Services match against any internet servic...
        type: str
      internet-service6:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service6. Enable/disable
          use of Internet Services IPv6 for this policy.
        type: str
      internet-service6-custom:
        description: (list) Deprecated, please rename it to internet_service6_custom.
        type: raw
      internet-service6-custom-group:
        description: (list) Deprecated, please rename it to internet_service6_custom_group.
        type: raw
      internet-service6-group:
        description: (list) Deprecated, please rename it to internet_service6_group.
        type: raw
      internet-service6-name:
        description: (list) Deprecated, please rename it to internet_service6_name.
        type: raw
      internet-service6-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service6_negate. When enabled,
          Internet Services match against any internet servi...
        type: str
      ips-sensor:
        description: Deprecated, please rename it to ips_sensor. Name of an existing IPS
          sensor.
        type: str
      ips-voip-filter:
        description: Deprecated, please rename it to ips_voip_filter. Name of an existing
          VoIP
        type: str
      label:
        description: VDOM-specific GUI visible label.
        type: str
      logtraffic:
        choices:
        - disable
        - all
        - utm
        description: Enable/disable logging traffic through the policy.
        type: str
      logtraffic-start:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to logtraffic_start. Enable/disable
          policy log traffic start.
        type: str
      mms-profile:
        description: Deprecated, please rename it to mms_profile. Name of an existing
          MMS profile.
        type: str
      name:
        description: Policy name.
        type: str
      policyid:
        description: Policy ID.
        required: true
        type: int
      poolname:
        description: (list or str) Name of IP pool object.
        type: raw
      profile-group:
        description: Deprecated, please rename it to profile_group. Name of profile group.
        type: str
      profile-protocol-options:
        description: Deprecated, please rename it to profile_protocol_options. Name of
          an existing Protocol options profile.
        type: str
      profile-type:
        choices:
        - single
        - group
        description: Deprecated, please rename it to profile_type. Determine whether the
          firewall policy allows security profile groups or sing...
        type: str
      proxy:
        choices:
        - explicit-web
        - transparent-web
        - ftp
        - wanopt
        - ssh
        - ssh-tunnel
        - access-proxy
        description: Type of explicit proxy.
        type: str
      redirect-url:
        description: Deprecated, please rename it to redirect_url. Redirect URL for further
          explicit web proxy processing.
        type: str
      replacemsg-override-group:
        description: Deprecated, please rename it to replacemsg_override_group. Authentication
          replacement message override group.
        type: str
      scan-botnet-connections:
        choices:
        - disable
        - block
        - monitor
        description: Deprecated, please rename it to scan_botnet_connections. Enable/disable
          scanning of connections to Botnet servers.
        type: str
      schedule:
        description: Name of schedule object.
        type: str
      sctp-filter-profile:
        description: Deprecated, please rename it to sctp_filter_profile. Name of an existing
          SCTP filter profile.
        type: str
      service:
        description: (list or str) Name of service objects.
        type: raw
      service-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to service_negate. When enabled, services
          match against any service EXCEPT the specified dest...
        type: str
      session-ttl:
        description: (int or str) Deprecated, please rename it to session_ttl. TTL in
          seconds for sessions accepted by this policy
        type: raw
      spamfilter-profile:
        description: Deprecated, please rename it to spamfilter_profile. Name of an existing
          Spam filter profile.
        type: str
      srcaddr:
        description: (list or str) Source address objects
        type: raw
      srcaddr-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to srcaddr_negate. When enabled, source
          addresses match against any address EXCEPT the specif...
        type: str
      srcaddr6:
        description: (list or str) IPv6 source address objects.
        type: raw
      srcintf:
        description: (list or str) Source interface names.
        type: raw
      ssh-filter-profile:
        description: Deprecated, please rename it to ssh_filter_profile. Name of an existing
          SSH filter profile.
        type: str
      ssh-policy-redirect:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to ssh_policy_redirect. Redirect SSH
          traffic to matching transparent proxy policy.
        type: str
      ssl-ssh-profile:
        description: Deprecated, please rename it to ssl_ssh_profile. Name of an existing
          SSL SSH profile.
        type: str
      status:
        choices:
        - disable
        - enable
        description: Enable/disable the active status of the policy.
        type: str
      tags:
        description: Names of object-tags applied to address.
        type: str
      transparent:
        choices:
        - disable
        - enable
        description: Enable to use the IP address of the client to connect to the server.
        type: str
      users:
        description: (list or str) Names of user objects.
        type: raw
      utm-status:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to utm_status. Enable the use of UTM
          profiles/sensors/lists.
        type: str
      uuid:
        description: Universally Unique Identifier
        type: str
      videofilter-profile:
        description: Deprecated, please rename it to videofilter_profile. Name of an existing
          VideoFilter profile.
        type: str
      virtual-patch-profile:
        description: Deprecated, please rename it to virtual_patch_profile.
        type: str
      voip-profile:
        description: Deprecated, please rename it to voip_profile. Name of an existing
          VoIP profile.
        type: str
      waf-profile:
        description: Deprecated, please rename it to waf_profile. Name of an existing
          Web application firewall profile.
        type: str
      webcache:
        choices:
        - disable
        - enable
        description: Enable/disable web caching.
        type: str
      webcache-https:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to webcache_https. Enable/disable web
          caching for HTTPS
        type: str
      webfilter-profile:
        description: Deprecated, please rename it to webfilter_profile. Name of an existing
          Web filter profile.
        type: str
      webproxy-forward-server:
        description: Deprecated, please rename it to webproxy_forward_server. Name of
          web proxy forward server.
        type: str
      webproxy-profile:
        description: Deprecated, please rename it to webproxy_profile. Name of web proxy
          profile.
        type: str
      ztna-ems-tag:
        description: (list or str) Deprecated, please rename it to ztna_ems_tag. ZTNA
          EMS Tag names.
        type: raw
      ztna-tags-match-logic:
        choices:
        - or
        - and
        description: Deprecated, please rename it to ztna_tags_match_logic. ZTNA tag matching
          logic.
        type: str
    type: dict

workspace_locking_timeout:
    default: 300
    description: The maximum time in seconds to wait for other user to release the workspace
      lock.
    type: int

Outputs

meta:
  contains:
    request_url:
      description: The full url requested.
      returned: always
      sample: /sys/login/user
      type: str
    response_code:
      description: The status of api request.
      returned: always
      sample: 0
      type: int
    response_data:
      description: The api response.
      returned: always
      type: list
    response_message:
      description: The descriptive message of the api response.
      returned: always
      sample: OK.
      type: str
    system_information:
      description: The information of the target system.
      returned: always
      type: dict
  description: The result of the request.
  returned: always
  type: dict
rc:
  description: The status the request.
  returned: always
  sample: 0
  type: int
version_check_warning:
  description: Warning if the parameters used in the playbook are not supported by
    the current FortiManager version.
  returned: complex
  type: list