fortinet.fortimanager.fmgr_pkg_firewall_consolidated_policy (2.4.0) — module

Configure consolidated IPv4/IPv6 policies.

| "added in version" 2.1.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 (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure consolidated IPv4/IPv6 policies.
      fortinet.fortimanager.fmgr_pkg_firewall_consolidated_policy:
        # bypass_validation: false
        workspace_locking_adom: <value in [global, custom adom including root]>
        workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        adom: <your own value>
        pkg: <your own value>
        state: present # <value in [present, absent]>
        pkg_firewall_consolidated_policy:
          action: <value in [deny, accept, ipsec]>
          app_category: <list or string>
          app_group: <list or string>
          application: <list or integer>
          application_list: <string>
          auto_asic_offload: <value in [disable, enable]>
          av_profile: <string>
          cifs_profile: <string>
          comments: <string>
          diffserv_forward: <value in [disable, enable]>
          diffserv_reverse: <value in [disable, enable]>
          diffservcode_forward: <string>
          diffservcode_rev: <string>
          dlp_sensor: <string>
          dnsfilter_profile: <string>
          dstaddr4: <list or string>
          dstaddr6: <list or string>
          dstintf: <list or string>
          emailfilter_profile: <string>
          fixedport: <value in [disable, enable]>
          groups: <list or string>
          http_policy_redirect: <value in [disable, enable]>
          icap_profile: <string>
          inbound: <value in [disable, enable]>
          inspection_mode: <value in [proxy, flow]>
          internet_service: <value in [disable, enable]>
          internet_service_custom: <list or string>
          internet_service_custom_group: <list or string>
          internet_service_group: <list or string>
          internet_service_id: <list or string>
          internet_service_src: <value in [disable, enable]>
          internet_service_src_custom: <list or string>
          internet_service_src_custom_group: <list or string>
          internet_service_src_group: <list or string>
          internet_service_src_id: <list or string>
          ippool: <value in [disable, enable]>
          ips_sensor: <string>
          logtraffic: <value in [disable, all, utm]>
          logtraffic_start: <value in [disable, enable]>
          mms_profile: <string>
          name: <string>
          nat: <value in [disable, enable]>
          outbound: <value in [disable, enable]>
          per_ip_shaper: <string>
          policyid: <integer>
          poolname4: <list or string>
          poolname6: <list or string>
          profile_group: <string>
          profile_protocol_options: <string>
          profile_type: <value in [single, group]>
          schedule: <string>
          service: <list or string>
          session_ttl: <integer>
          srcaddr4: <list or string>
          srcaddr6: <list or string>
          srcintf: <list or string>
          ssh_filter_profile: <string>
          ssh_policy_redirect: <value in [disable, enable]>
          ssl_ssh_profile: <string>
          status: <value in [disable, enable]>
          tcp_mss_receiver: <integer>
          tcp_mss_sender: <integer>
          traffic_shaper: <string>
          traffic_shaper_reverse: <string>
          url_category: <list or string>
          users: <list or string>
          utm_status: <value in [disable, enable]>
          uuid: <string>
          voip_profile: <string>
          vpntunnel: <string>
          waf_profile: <string>
          wanopt: <value in [disable, enable]>
          wanopt_detection: <value in [active, passive, off]>
          wanopt_passive_opt: <value in [default, transparent, non-transparent]>
          wanopt_peer: <string>
          wanopt_profile: <string>
          webcache: <value in [disable, enable]>
          webcache_https: <value in [disable, enable]>
          webfilter_profile: <string>
          webproxy_forward_server: <string>
          webproxy_profile: <string>
          captive_portal_exempt: <value in [disable, enable]>
          dstaddr_negate: <value in [disable, enable]>
          fsso_groups: <list or string>
          global_label: <string>
          internet_service_negate: <value in [disable, enable]>
          internet_service_src_negate: <value in [disable, enable]>
          service_negate: <value in [disable, enable]>
          srcaddr_negate: <value in [disable, enable]>
          _policy_block: <integer>

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

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

pkg_firewall_consolidated_policy:
    description: The top level parameters set.
    required: false
    suboptions:
      _policy_block:
        description: Assigned policy block.
        type: int
      action:
        choices:
        - deny
        - accept
        - ipsec
        description: Policy action
        type: str
      app-category:
        description: (list or str) Deprecated, please rename it to app_category. Application
          category ID list.
        type: raw
      app-group:
        description: (list or str) Deprecated, please rename it to app_group. Application
          group names.
        type: raw
      application:
        description: (list) Application.
        type: raw
      application-list:
        description: Deprecated, please rename it to application_list. Name of an existing
          Application list.
        type: str
      auto-asic-offload:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to auto_asic_offload. Enable/disable
          offloading security profile processing to CP processors.
        type: str
      av-profile:
        description: Deprecated, please rename it to av_profile. Name of an existing Antivirus
          profile.
        type: str
      captive-portal-exempt:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to captive_portal_exempt. Enable exemption
          of some users from the captive portal.
        type: str
      cifs-profile:
        description: Deprecated, please rename it to cifs_profile. Name of an existing
          CIFS profile.
        type: str
      comments:
        description: Comment.
        type: str
      diffserv-forward:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to diffserv_forward. Enable to change
          packets DiffServ values to the specified diffservcode-f...
        type: str
      diffserv-reverse:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to diffserv_reverse. Enable to change
          packets reverse
        type: str
      diffservcode-forward:
        description: Deprecated, please rename it to diffservcode_forward. Change packets
          DiffServ to this value.
        type: str
      diffservcode-rev:
        description: Deprecated, please rename it to diffservcode_rev. Change packets
          reverse
        type: str
      dlp-sensor:
        description: Deprecated, please rename it to dlp_sensor. Name of an existing DLP
          sensor.
        type: str
      dnsfilter-profile:
        description: Deprecated, please rename it to dnsfilter_profile. Name of an existing
          DNS filter profile.
        type: str
      dstaddr-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to dstaddr_negate. When enabled dstaddr
          specifies what the destination address must NOT be.
        type: str
      dstaddr4:
        description: (list or str) Destination IPv4 address name and address group names.
        type: raw
      dstaddr6:
        description: (list or str) Destination IPv6 address name and address group names.
        type: raw
      dstintf:
        description: (list or str) Outgoing
        type: raw
      emailfilter-profile:
        description: Deprecated, please rename it to emailfilter_profile. Name of an existing
          email filter profile.
        type: str
      fixedport:
        choices:
        - disable
        - enable
        description: Enable to prevent source NAT from changing a sessions source port.
        type: str
      fsso-groups:
        description: (list or str) Deprecated, please rename it to fsso_groups. Names
          of FSSO groups.
        type: raw
      global-label:
        description: Deprecated, please rename it to global_label. Label for the policy
          that appears when the GUI is in Global View mode.
        type: str
      groups:
        description: (list or str) Names of user groups that can authenticate with this
          policy.
        type: raw
      http-policy-redirect:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to http_policy_redirect. Redirect HTTP
        type: str
      icap-profile:
        description: Deprecated, please rename it to icap_profile. Name of an existing
          ICAP profile.
        type: str
      inbound:
        choices:
        - disable
        - enable
        description: Policy-based IPsec VPN
        type: str
      inspection-mode:
        choices:
        - proxy
        - flow
        description: Deprecated, please rename it to inspection_mode. Policy inspection
          mode
        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-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service_negate. When enabled
          internet-service specifies what the service must NOT be.
        type: str
      internet-service-src:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service_src. Enable/disable
          use of Internet Services in source for this policy.
        type: str
      internet-service-src-custom:
        description: (list or str) Deprecated, please rename it to internet_service_src_custom.
          Custom Internet Service source name.
        type: raw
      internet-service-src-custom-group:
        description: (list or str) Deprecated, please rename it to internet_service_src_custom_group.
          Custom Internet Service source group name.
        type: raw
      internet-service-src-group:
        description: (list or str) Deprecated, please rename it to internet_service_src_group.
          Internet Service source group name.
        type: raw
      internet-service-src-id:
        description: (list or str) Deprecated, please rename it to internet_service_src_id.
          Internet Service source ID.
        type: raw
      internet-service-src-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to internet_service_src_negate. When
          enabled internet-service-src specifies what the service ...
        type: str
      ippool:
        choices:
        - disable
        - enable
        description: Enable to use IP Pools for source NAT.
        type: str
      ips-sensor:
        description: Deprecated, please rename it to ips_sensor. Name of an existing IPS
          sensor.
        type: str
      logtraffic:
        choices:
        - disable
        - all
        - utm
        description: Enable or disable logging.
        type: str
      logtraffic-start:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to logtraffic_start. Record logs when
          a session starts.
        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
      nat:
        choices:
        - disable
        - enable
        description: Enable/disable source NAT.
        type: str
      outbound:
        choices:
        - disable
        - enable
        description: Policy-based IPsec VPN
        type: str
      per-ip-shaper:
        description: Deprecated, please rename it to per_ip_shaper. Per-IP traffic shaper.
        type: str
      policyid:
        description: Policy ID
        required: true
        type: int
      poolname4:
        description: (list or str) IPv4 pool names.
        type: raw
      poolname6:
        description: (list or str) IPv6 pool names.
        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
      schedule:
        description: Schedule name.
        type: str
      service:
        description: (list or str) Service and service group names.
        type: raw
      service-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to service_negate. When enabled service
          specifies what the service must NOT be.
        type: str
      session-ttl:
        description: Deprecated, please rename it to session_ttl. TTL in seconds for sessions
          accepted by this policy
        type: int
      srcaddr-negate:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to srcaddr_negate. When enabled srcaddr
          specifies what the source address must NOT be.
        type: str
      srcaddr4:
        description: (list or str) Source IPv4 address name and address group names.
        type: raw
      srcaddr6:
        description: (list or str) Source IPv6 address name and address group names.
        type: raw
      srcintf:
        description: (list or str) Incoming
        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 or disable this policy.
        type: str
      tcp-mss-receiver:
        description: Deprecated, please rename it to tcp_mss_receiver. Receiver TCP maximum
          segment size
        type: int
      tcp-mss-sender:
        description: Deprecated, please rename it to tcp_mss_sender. Sender TCP maximum
          segment size
        type: int
      traffic-shaper:
        description: Deprecated, please rename it to traffic_shaper. Traffic shaper.
        type: str
      traffic-shaper-reverse:
        description: Deprecated, please rename it to traffic_shaper_reverse. Reverse traffic
          shaper.
        type: str
      url-category:
        description: (list or str) Deprecated, please rename it to url_category. URL category
          ID list.
        type: raw
      users:
        description: (list or str) Names of individual users that can authenticate with
          this policy.
        type: raw
      utm-status:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to utm_status. Enable to add one or
          more security profiles
        type: str
      uuid:
        description: Universally Unique Identifier
        type: str
      voip-profile:
        description: Deprecated, please rename it to voip_profile. Name of an existing
          VoIP profile.
        type: str
      vpntunnel:
        description: Policy-based IPsec VPN
        type: str
      waf-profile:
        description: Deprecated, please rename it to waf_profile. Name of an existing
          Web application firewall profile.
        type: str
      wanopt:
        choices:
        - disable
        - enable
        description: Enable/disable WAN optimization.
        type: str
      wanopt-detection:
        choices:
        - active
        - passive
        - 'off'
        description: Deprecated, please rename it to wanopt_detection. WAN optimization
          auto-detection mode.
        type: str
      wanopt-passive-opt:
        choices:
        - default
        - transparent
        - non-transparent
        description: Deprecated, please rename it to wanopt_passive_opt. WAN optimization
          passive mode options.
        type: str
      wanopt-peer:
        description: Deprecated, please rename it to wanopt_peer. WAN optimization peer.
        type: str
      wanopt-profile:
        description: Deprecated, please rename it to wanopt_profile. WAN optimization
          profile.
        type: str
      webcache:
        choices:
        - disable
        - enable
        description: Enable/disable web cache.
        type: str
      webcache-https:
        choices:
        - disable
        - enable
        description: Deprecated, please rename it to webcache_https. Enable/disable web
          cache 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. Webproxy
          forward server name.
        type: str
      webproxy-profile:
        description: Deprecated, please rename it to webproxy_profile. Webproxy profile
          name.
        type: str
    type: dict

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