ansible.builtin.fortios_firewall_vip6 (v2.8.20) — module

Configure virtual IP for IPv6 in Fortinet's FortiOS and FortiGate.

| "added in version" 2.8 of ansible.builtin"

Authors: Miguel Angel Munoz (@mamunozgonzalez), Nicolas Thomas (@thomnico)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.8.20

Description

This module is able to configure a FortiGate or FortiOS by allowing the user to configure firewall feature and vip6 category. Examples includes all options and need to be adjusted to datasources before usage. Tested with FOS v6.0.2


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- hosts: localhost
  vars:
   host: "192.168.122.40"
   username: "admin"
   password: ""
   vdom: "root"
  tasks:
  - name: Configure virtual IP for IPv6.
    fortios_firewall_vip6:
      host:  "{{ host }}"
      username: "{{ username }}"
      password: "{{ password }}"
      vdom:  "{{ vdom }}"
      firewall_vip6:
        state: "present"
        arp-reply: "disable"
        color: "4"
        comment: "Comment."
        extip: "<your_own_value>"
        extport: "<your_own_value>"
        http-cookie-age: "8"
        http-cookie-domain: "<your_own_value>"
        http-cookie-domain-from-host: "disable"
        http-cookie-generation: "11"
        http-cookie-path: "<your_own_value>"
        http-cookie-share: "disable"
        http-ip-header: "enable"
        http-ip-header-name: "<your_own_value>"
        http-multiplex: "enable"
        https-cookie-secure: "disable"
        id:  "18"
        ldb-method: "static"
        mappedip: "<your_own_value>"
        mappedport: "<your_own_value>"
        max-embryonic-connections: "22"
        monitor:
         -
            name: "default_name_24 (source firewall.ldb-monitor.name)"
        name: "default_name_25"
        outlook-web-access: "disable"
        persistence: "none"
        portforward: "disable"
        protocol: "tcp"
        realservers:
         -
            client-ip: "<your_own_value>"
            healthcheck: "disable"
            holddown-interval: "33"
            http-host: "myhostname"
            id:  "35"
            ip: "<your_own_value>"
            max-connections: "37"
            monitor: "<your_own_value> (source firewall.ldb-monitor.name)"
            port: "39"
            status: "active"
            weight: "41"
        server-type: "http"
        src-filter:
         -
            range: "<your_own_value>"
        ssl-algorithm: "high"
        ssl-certificate: "<your_own_value> (source vpn.certificate.local.name)"
        ssl-cipher-suites:
         -
            cipher: "TLS-RSA-WITH-3DES-EDE-CBC-SHA"
            priority: "49"
            versions: "ssl-3.0"
        ssl-client-fallback: "disable"
        ssl-client-renegotiation: "allow"
        ssl-client-session-state-max: "53"
        ssl-client-session-state-timeout: "54"
        ssl-client-session-state-type: "disable"
        ssl-dh-bits: "768"
        ssl-hpkp: "disable"
        ssl-hpkp-age: "58"
        ssl-hpkp-backup: "<your_own_value> (source vpn.certificate.local.name vpn.certificate.ca.name)"
        ssl-hpkp-include-subdomains: "disable"
        ssl-hpkp-primary: "<your_own_value> (source vpn.certificate.local.name vpn.certificate.ca.name)"
        ssl-hpkp-report-uri: "<your_own_value>"
        ssl-hsts: "disable"
        ssl-hsts-age: "64"
        ssl-hsts-include-subdomains: "disable"
        ssl-http-location-conversion: "enable"
        ssl-http-match-host: "enable"
        ssl-max-version: "ssl-3.0"
        ssl-min-version: "ssl-3.0"
        ssl-mode: "half"
        ssl-pfs: "require"
        ssl-send-empty-frags: "enable"
        ssl-server-algorithm: "high"
        ssl-server-cipher-suites:
         -
            cipher: "TLS-RSA-WITH-3DES-EDE-CBC-SHA"
            priority: "76"
            versions: "ssl-3.0"
        ssl-server-max-version: "ssl-3.0"
        ssl-server-min-version: "ssl-3.0"
        ssl-server-session-state-max: "80"
        ssl-server-session-state-timeout: "81"
        ssl-server-session-state-type: "disable"
        type: "static-nat"
        uuid: "<your_own_value>"
        weblogic-server: "disable"
        websphere-server: "disable"

Inputs

    
host:
    description:
    - FortiOS or FortiGate ip address.
    required: true

vdom:
    default: root
    description:
    - Virtual domain, among those defined previously. A vdom is a virtual instance of
      the FortiGate that can be configured and used as a different unit.

https:
    default: false
    description:
    - Indicates if the requests towards FortiGate must use HTTPS protocol
    type: bool

password:
    default: ''
    description:
    - FortiOS or FortiGate password.

username:
    description:
    - FortiOS or FortiGate username.
    required: true

firewall_vip6:
    default: null
    description:
    - Configure virtual IP for IPv6.
    suboptions:
      arp-reply:
        choices:
        - disable
        - enable
        description:
        - Enable to respond to ARP requests for this virtual IP address. Enabled by default.
      color:
        description:
        - Color of icon on the GUI.
      comment:
        description:
        - Comment.
      extip:
        description:
        - IP address or address range on the external interface that you want to map to
          an address or address range on the destination network.
      extport:
        description:
        - Incoming port number range that you want to map to a port number range on the
          destination network.
      http-cookie-age:
        description:
        - Time in minutes that client web browsers should keep a cookie. Default is 60
          seconds. 0 = no time limit.
      http-cookie-domain:
        description:
        - Domain that HTTP cookie persistence should apply to.
      http-cookie-domain-from-host:
        choices:
        - disable
        - enable
        description:
        - Enable/disable use of HTTP cookie domain from host field in HTTP.
      http-cookie-generation:
        description:
        - Generation of HTTP cookie to be accepted. Changing invalidates all existing
          cookies.
      http-cookie-path:
        description:
        - Limit HTTP cookie persistence to the specified path.
      http-cookie-share:
        choices:
        - disable
        - same-ip
        description:
        - Control sharing of cookies across virtual servers. same-ip means a cookie from
          one virtual server can be used by another. Disable stops cookie sharing.
      http-ip-header:
        choices:
        - enable
        - disable
        description:
        - For HTTP multiplexing, enable to add the original client IP address in the XForwarded-For
          HTTP header.
      http-ip-header-name:
        description:
        - For HTTP multiplexing, enter a custom HTTPS header name. The original client
          IP address is added to this header. If empty, X-Forwarded-For is used.
      http-multiplex:
        choices:
        - enable
        - disable
        description:
        - Enable/disable HTTP multiplexing.
      https-cookie-secure:
        choices:
        - disable
        - enable
        description:
        - Enable/disable verification that inserted HTTPS cookies are secure.
      id:
        description:
        - Custom defined ID.
      ldb-method:
        choices:
        - static
        - round-robin
        - weighted
        - least-session
        - least-rtt
        - first-alive
        - http-host
        description:
        - Method used to distribute sessions to real servers.
      mappedip:
        description:
        - Mapped IP address range in the format startIP-endIP.
      mappedport:
        description:
        - Port number range on the destination network to which the external port number
          range is mapped.
      max-embryonic-connections:
        description:
        - Maximum number of incomplete connections.
      monitor:
        description:
        - Name of the health check monitor to use when polling to determine a virtual
          server's connectivity status.
        suboptions:
          name:
            description:
            - Health monitor name. Source firewall.ldb-monitor.name.
            required: true
      name:
        description:
        - Virtual ip6 name.
        required: true
      outlook-web-access:
        choices:
        - disable
        - enable
        description:
        - Enable to add the Front-End-Https header for Microsoft Outlook Web Access.
      persistence:
        choices:
        - none
        - http-cookie
        - ssl-session-id
        description:
        - Configure how to make sure that clients connect to the same server every time
          they make a request that is part of the same session.
      portforward:
        choices:
        - disable
        - enable
        description:
        - Enable port forwarding.
      protocol:
        choices:
        - tcp
        - udp
        - sctp
        description:
        - Protocol to use when forwarding packets.
      realservers:
        description:
        - Select the real servers that this server load balancing VIP will distribute
          traffic to.
        suboptions:
          client-ip:
            description:
            - Only clients in this IP range can connect to this real server.
          healthcheck:
            choices:
            - disable
            - enable
            - vip
            description:
            - Enable to check the responsiveness of the real server before forwarding
              traffic.
          holddown-interval:
            description:
            - Time in seconds that the health check monitor continues to monitor an unresponsive
              server that should be active.
          http-host:
            description:
            - HTTP server domain name in HTTP header.
          id:
            description:
            - Real server ID.
            required: true
          ip:
            description:
            - IPv6 address of the real server.
          max-connections:
            description:
            - Max number of active connections that can directed to the real server. When
              reached, sessions are sent to other real servers.
          monitor:
            description:
            - Name of the health check monitor to use when polling to determine a virtual
              server's connectivity status. Source firewall .ldb-monitor.name.
          port:
            description:
            - Port for communicating with the real server. Required if port forwarding
              is enabled.
          status:
            choices:
            - active
            - standby
            - disable
            description:
            - Set the status of the real server to active so that it can accept traffic,
              or on standby or disabled so no traffic is sent.
          weight:
            description:
            - Weight of the real server. If weighted load balancing is enabled, the server
              with the highest weight gets more connections.
      server-type:
        choices:
        - http
        - https
        - imaps
        - pop3s
        - smtps
        - ssl
        - tcp
        - udp
        - ip
        description:
        - Protocol to be load balanced by the virtual server (also called the server load
          balance virtual IP).
      src-filter:
        description:
        - Source IP6 filter (x:x:x:x:x:x:x:x/x). Separate addresses with spaces.
        suboptions:
          range:
            description:
            - Source-filter range.
            required: true
      ssl-algorithm:
        choices:
        - high
        - medium
        - low
        - custom
        description:
        - Permitted encryption algorithms for SSL sessions according to encryption strength.
      ssl-certificate:
        description:
        - The name of the SSL certificate to use for SSL acceleration. Source vpn.certificate.local.name.
      ssl-cipher-suites:
        description:
        - SSL/TLS cipher suites acceptable from a client, ordered by priority.
        suboptions:
          cipher:
            choices:
            - TLS-RSA-WITH-3DES-EDE-CBC-SHA
            - TLS-DHE-RSA-WITH-DES-CBC-SHA
            - TLS-DHE-DSS-WITH-DES-CBC-SHA
            description:
            - Cipher suite name.
          priority:
            description:
            - SSL/TLS cipher suites priority.
            required: true
          versions:
            choices:
            - ssl-3.0
            - tls-1.0
            - tls-1.1
            - tls-1.2
            description:
            - SSL/TLS versions that the cipher suite can be used with.
      ssl-client-fallback:
        choices:
        - disable
        - enable
        description:
        - Enable/disable support for preventing Downgrade Attacks on client connections
          (RFC 7507).
      ssl-client-renegotiation:
        choices:
        - allow
        - deny
        - secure
        description:
        - Allow, deny, or require secure renegotiation of client sessions to comply with
          RFC 5746.
      ssl-client-session-state-max:
        description:
        - Maximum number of client to FortiGate SSL session states to keep.
      ssl-client-session-state-timeout:
        description:
        - Number of minutes to keep client to FortiGate SSL session state.
      ssl-client-session-state-type:
        choices:
        - disable
        - time
        - count
        - both
        description:
        - How to expire SSL sessions for the segment of the SSL connection between the
          client and the FortiGate.
      ssl-dh-bits:
        choices:
        - 768
        - 1024
        - 1536
        - 2048
        - 3072
        - 4096
        description:
        - Number of bits to use in the Diffie-Hellman exchange for RSA encryption of SSL
          sessions.
      ssl-hpkp:
        choices:
        - disable
        - enable
        - report-only
        description:
        - Enable/disable including HPKP header in response.
      ssl-hpkp-age:
        description:
        - Number of minutes the web browser should keep HPKP.
      ssl-hpkp-backup:
        description:
        - Certificate to generate backup HPKP pin from. Source vpn.certificate.local.name
          vpn.certificate.ca.name.
      ssl-hpkp-include-subdomains:
        choices:
        - disable
        - enable
        description:
        - Indicate that HPKP header applies to all subdomains.
      ssl-hpkp-primary:
        description:
        - Certificate to generate primary HPKP pin from. Source vpn.certificate.local.name
          vpn.certificate.ca.name.
      ssl-hpkp-report-uri:
        description:
        - URL to report HPKP violations to.
      ssl-hsts:
        choices:
        - disable
        - enable
        description:
        - Enable/disable including HSTS header in response.
      ssl-hsts-age:
        description:
        - Number of seconds the client should honour the HSTS setting.
      ssl-hsts-include-subdomains:
        choices:
        - disable
        - enable
        description:
        - Indicate that HSTS header applies to all subdomains.
      ssl-http-location-conversion:
        choices:
        - enable
        - disable
        description:
        - Enable to replace HTTP with HTTPS in the reply's Location HTTP header field.
      ssl-http-match-host:
        choices:
        - enable
        - disable
        description:
        - Enable/disable HTTP host matching for location conversion.
      ssl-max-version:
        choices:
        - ssl-3.0
        - tls-1.0
        - tls-1.1
        - tls-1.2
        description:
        - Highest SSL/TLS version acceptable from a client.
      ssl-min-version:
        choices:
        - ssl-3.0
        - tls-1.0
        - tls-1.1
        - tls-1.2
        description:
        - Lowest SSL/TLS version acceptable from a client.
      ssl-mode:
        choices:
        - half
        - full
        description:
        - Apply SSL offloading between the client and the FortiGate (half) or from the
          client to the FortiGate and from the FortiGate to the server (full).
      ssl-pfs:
        choices:
        - require
        - deny
        - allow
        description:
        - Select the cipher suites that can be used for SSL perfect forward secrecy (PFS).
          Applies to both client and server sessions.
      ssl-send-empty-frags:
        choices:
        - enable
        - disable
        description:
        - Enable/disable sending empty fragments to avoid CBC IV attacks (SSL 3.0 & TLS
          1.0 only). May need to be disabled for compatibility with older systems.
      ssl-server-algorithm:
        choices:
        - high
        - medium
        - low
        - custom
        - client
        description:
        - Permitted encryption algorithms for the server side of SSL full mode sessions
          according to encryption strength.
      ssl-server-cipher-suites:
        description:
        - SSL/TLS cipher suites to offer to a server, ordered by priority.
        suboptions:
          cipher:
            choices:
            - TLS-RSA-WITH-3DES-EDE-CBC-SHA
            - TLS-DHE-RSA-WITH-DES-CBC-SHA
            - TLS-DHE-DSS-WITH-DES-CBC-SHA
            description:
            - Cipher suite name.
          priority:
            description:
            - SSL/TLS cipher suites priority.
            required: true
          versions:
            choices:
            - ssl-3.0
            - tls-1.0
            - tls-1.1
            - tls-1.2
            description:
            - SSL/TLS versions that the cipher suite can be used with.
      ssl-server-max-version:
        choices:
        - ssl-3.0
        - tls-1.0
        - tls-1.1
        - tls-1.2
        - client
        description:
        - Highest SSL/TLS version acceptable from a server. Use the client setting by
          default.
      ssl-server-min-version:
        choices:
        - ssl-3.0
        - tls-1.0
        - tls-1.1
        - tls-1.2
        - client
        description:
        - Lowest SSL/TLS version acceptable from a server. Use the client setting by default.
      ssl-server-session-state-max:
        description:
        - Maximum number of FortiGate to Server SSL session states to keep.
      ssl-server-session-state-timeout:
        description:
        - Number of minutes to keep FortiGate to Server SSL session state.
      ssl-server-session-state-type:
        choices:
        - disable
        - time
        - count
        - both
        description:
        - How to expire SSL sessions for the segment of the SSL connection between the
          server and the FortiGate.
      state:
        choices:
        - present
        - absent
        description:
        - Indicates whether to create or remove the object
      type:
        choices:
        - static-nat
        - server-load-balance
        description:
        - Configure a static NAT or server load balance VIP.
      uuid:
        description:
        - Universally Unique Identifier (UUID; automatically assigned but can be manually
          reset).
      weblogic-server:
        choices:
        - disable
        - enable
        description:
        - Enable to add an HTTP header to indicate SSL offloading for a WebLogic server.
      websphere-server:
        choices:
        - disable
        - enable
        description:
        - Enable to add an HTTP header to indicate SSL offloading for a WebSphere server.

Outputs

build:
  description: Build number of the fortigate image
  returned: always
  sample: '1547'
  type: str
http_method:
  description: Last method used to provision the content into FortiGate
  returned: always
  sample: PUT
  type: str
http_status:
  description: Last result given by FortiGate on last operation applied
  returned: always
  sample: '200'
  type: str
mkey:
  description: Master key (id) used in the last call to FortiGate
  returned: success
  sample: key1
  type: str
name:
  description: Name of the table used to fulfill the request
  returned: always
  sample: urlfilter
  type: str
path:
  description: Path of the table used to fulfill the request
  returned: always
  sample: webfilter
  type: str
revision:
  description: Internal revision number
  returned: always
  sample: 17.0.2.10658
  type: str
serial:
  description: Serial number of the unit
  returned: always
  sample: FGVMEVYYQT3AB5352
  type: str
status:
  description: Indication of the operation's result
  returned: always
  sample: success
  type: str
vdom:
  description: Virtual domain used
  returned: always
  sample: root
  type: str
version:
  description: Version of the FortiGate
  returned: always
  sample: v5.6.3
  type: str