ansible.builtin.fortios_address (v2.9.23) — module

Manage fortios firewall address objects

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

Authors: Benjamin Jolivot (@bjolivot)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.23

Description

This module provide management of firewall addresses on FortiOS devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Register french addresses
  fortios_address:
    host: 192.168.0.254
    username: admin
    password: p4ssw0rd
    state: present
    name: "fromfrance"
    type: geography
    country: FR
    comment: "French geoip address"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Register some fqdn
  fortios_address:
    host: 192.168.0.254
    username: admin
    password: p4ssw0rd
    state: present
    name: "Ansible"
    type: fqdn
    value: www.ansible.com
    comment: "Ansible website"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Register google DNS
  fortios_address:
    host: 192.168.0.254
    username: admin
    password: p4ssw0rd
    state: present
    name: "google_dns"
    type: ipmask
    value: 8.8.8.8

Inputs

    
host:
    description:
    - Specifies the DNS hostname or IP address for connecting to the remote fortios device.
      Required when I(file_mode) is False.
    type: str

name:
    description:
    - Name of the address to add or delete.
    required: true

type:
    choices:
    - iprange
    - fqdn
    - ipmask
    - geography
    description:
    - Type of the address.

vdom:
    description:
    - Specifies on which vdom to apply configuration
    type: str

state:
    choices:
    - present
    - absent
    description:
    - Specifies if address need to be added or deleted.
    required: true

value:
    description:
    - Address value, based on type. If type=fqdn, something like www.google.com. If type=ipmask,
      you can use simple ip (192.168.0.1), ip+mask (192.168.0.1 255.255.255.0) or CIDR
      (192.168.0.1/32).

backup:
    default: false
    description:
    - This argument will cause the module to create a backup of the current C(running-config)
      from the remote device before any changes are made.  The backup file is written
      to the i(backup) folder.
    type: bool

end_ip:
    description:
    - Last ip in range (used only with type=iprange).

comment:
    description:
    - free text to describe address.

country:
    description:
    - 2 letter country code (like FR).

timeout:
    default: 60
    description:
    - Timeout in seconds for connecting to the remote device.
    type: int

password:
    description:
    - Specifies the password used to authenticate to the remote device. Required when
      I(file_mode) is True.
    type: str

start_ip:
    description:
    - First ip in range (used only with type=iprange).

username:
    description:
    - Configures the username used to authenticate to the remote device. Required when
      I(file_mode) is True.
    type: str

file_mode:
    default: false
    description:
    - Don't connect to any device, only use I(config_file) as input and Output.
    type: bool
    version_added: '2.4'
    version_added_collection: fortinet.fortios

interface:
    default: any
    description:
    - interface name the address apply to.

backup_path:
    description:
    - Specifies where to store backup files. Required if I(backup=yes).
    type: path

config_file:
    description:
    - Path to configuration file. Required when I(file_mode) is True.
    type: path
    version_added: '2.4'
    version_added_collection: fortinet.fortios

backup_filename:
    description:
    - Specifies the backup filename. If omitted filename will be formatted like HOST_config.YYYY-MM-DD@HH:MM:SS
    type: str

Outputs

change_string:
  description: The commands executed by the module.
  returned: only if config changed
  type: str
firewall_address_config:
  description: full firewall addresses config string.
  returned: always
  type: str