community.general.fmgr_provisioning (0.1.1) — module

Provision devices via FortiMananger

Authors: Andrew Welsh (@Ghilli3)

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 model devices on the FortiManager using jsonrpc API and have them pre-configured, so when central management is configured, the configuration is pushed down to the registering devices

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create FGT1 Model Device
  fmgr_provisioning:
    host: "{{ inventory_hostname }}"
    username: "{{ username }}"
    password: "{{ password }}"
    adom: "root"
    vdom: "root"
    policy_package: "default"
    name: "FGT1"
    group: "Ansible"
    serial: "FGVM000000117994"
    platform: "FortiGate-VM64"
    description: "Provisioned by Ansible"
    os_version: '6.0'
    minor_release: 0
    patch_release: 0
    os_type: 'fos'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

- name: Create FGT2 Model Device
  fmgr_provisioning:
    host: "{{ inventory_hostname }}"
    username: "{{ username }}"
    password: "{{ password }}"
    adom: "root"
    vdom: "root"
    policy_package: "test_pp"
    name: "FGT2"
    group: "Ansible"
    serial: "FGVM000000117992"
    platform: "FortiGate-VM64"
    description: "Provisioned by Ansible"
    os_version: '5.0'
    minor_release: 6
    patch_release: 0
    os_type: 'fos'

Inputs

    
adom:
    description:
    - The administrative domain (admon) the configuration belongs to
    required: true

host:
    description:
    - The FortiManager's Address.
    required: true

name:
    description:
    - The name of the device to be provisioned.
    required: true

vdom:
    description:
    - The virtual domain (vdom) the configuration belongs to

group:
    description:
    - The name of the device group the provisioned device can belong to.
    required: false

serial:
    description:
    - The serial number of the device that will be provisioned.
    required: true

os_type:
    description:
    - The Fortinet OS type to be pushed to the device, such as 'FOS' for FortiOS.
    required: true

password:
    description:
    - The password associated with the username account.
    required: false

platform:
    description:
    - The platform of the device, such as model number or VM.
    required: true

username:
    description:
    - The username to log into the FortiManager
    required: true

os_version:
    description:
    - The Fortinet OS version to be used for the device, such as 5.0 or 6.0.
    required: true

description:
    description:
    - Description of the device to be provisioned.
    required: false

minor_release:
    description:
    - The minor release number such as 6.X.1, as X being the minor release.
    required: false

patch_release:
    description:
    - The patch release number such as 6.0.X, as X being the patch release.
    required: false

policy_package:
    description:
    - The name of the policy package to be assigned to the device.
    required: true

Outputs

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