community.general.fmgr_device (0.1.1) — module

Add or remove device from FortiManager.

Authors: Luke Weighall (@lweighall), Andrew Welsh (@Ghilli3), Jim Huber (@p4r4n0y1ng)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Add or remove a device or list of devices from FortiManager Device Manager using JSON RPC API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: DISCOVER AND ADD DEVICE FGT1
  fmgr_device:
    adom: "root"
    device_username: "admin"
    device_password: "admin"
    device_ip: "10.10.24.201"
    device_unique_name: "FGT1"
    device_serial: "FGVM000000117994"
    mode: "add"
    blind_add: "enable"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: DISCOVER AND ADD DEVICE FGT2
  fmgr_device:
    adom: "root"
    device_username: "admin"
    device_password: "admin"
    device_ip: "10.10.24.202"
    device_unique_name: "FGT2"
    device_serial: "FGVM000000117992"
    mode: "delete"

Inputs

    
adom:
    default: root
    description:
    - The ADOM the configuration should belong to.
    required: true

mode:
    choices:
    - add
    - delete
    default: add
    description:
    - The desired mode of the specified object.
    required: false

blind_add:
    choices:
    - enable
    - disable
    default: disable
    description:
    - When adding a device, module will check if it exists, and skip if it does.
    - If enabled, this option will stop the module from checking if it already exists,
      and blindly add the device.
    required: false

device_ip:
    description:
    - The IP of the device being added to FortiManager. Supports both IPv4 and IPv6.
    required: false

device_serial:
    description:
    - The serial number of the device being added to FortiManager.
    required: false

device_password:
    description:
    - The password of the device being added to FortiManager.
    required: false

device_username:
    description:
    - The username of the device being added to FortiManager.
    required: false

device_unique_name:
    description:
    - The desired "friendly" name of the device being added to FortiManager.
    required: false

Outputs

api_result:
  description: full API response, includes status code and message
  returned: always
  type: str