fortinet.fortimanager.fmgr_system_snmp_community (2.4.0) — module

SNMP community configuration.

| "added in version" 2.0.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
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: SNMP community configuration.
      fortinet.fortimanager.fmgr_system_snmp_community:
        bypass_validation: false
        state: present
        system_snmp_community:
          id: 1
          name: ansible-test-snmp
          status: disable
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gathering fortimanager facts
  hosts: fortimanagers
  gather_facts: false
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Retrieve all the SNMP communities
      fortinet.fortimanager.fmgr_fact:
        facts:
          selector: "system_snmp_community"
          params:
            community: "your_value"

Inputs

    
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

system_snmp_community:
    description: The top level parameters set.
    required: false
    suboptions:
      events:
        choices:
        - disk_low
        - ha_switch
        - intf_ip_chg
        - sys_reboot
        - cpu_high
        - mem_low
        - log-alert
        - log-rate
        - log-data-rate
        - lic-gbday
        - lic-dev-quota
        - cpu-high-exclude-nice
        description:
        - SNMP trap events.
        - disk_low - Disk usage too high.
        - ha_switch - HA switch.
        - intf_ip_chg - Interface IP address changed.
        - sys_reboot - System reboot.
        - cpu_high - CPU usage too high.
        - mem_low - Available memory is low.
        - log-alert - Log base alert message.
        - log-rate - High incoming log rate detected.
        - log-data-rate - High incoming log data rate detected.
        - lic-gbday - High licensed log GB/day detected.
        - lic-dev-quota - High licensed device quota detected.
        - cpu-high-exclude-nice - CPU usage exclude NICE threshold.
        elements: str
        type: list
      hosts:
        description: Hosts.
        elements: dict
        suboptions:
          id:
            description: Host entry ID.
            type: int
          interface:
            description: Allow interface name.
            type: str
          ip:
            description: Allow host IP address.
            type: str
        type: list
      hosts6:
        description: Hosts6.
        elements: dict
        suboptions:
          id:
            description: Host entry ID.
            type: int
          interface:
            description: Allow interface name.
            type: str
          ip:
            description: Allow host IP address.
            type: str
        type: list
      id:
        description: Community ID.
        required: true
        type: int
      name:
        description: Community name.
        type: str
      query_v1_port:
        description: SNMP v1 query port.
        type: int
      query_v1_status:
        choices:
        - disable
        - enable
        description:
        - Enable/disable SNMP v1 query.
        - disable - Disable setting.
        - enable - Enable setting.
        type: str
      query_v2c_port:
        description: SNMP v2c query port.
        type: int
      query_v2c_status:
        choices:
        - disable
        - enable
        description:
        - Enable/disable SNMP v2c query.
        - disable - Disable setting.
        - enable - Enable setting.
        type: str
      status:
        choices:
        - disable
        - enable
        description:
        - Enable/disable community.
        - disable - Disable setting.
        - enable - Enable setting.
        type: str
      trap_v1_rport:
        description: SNMP v1 trap remote port.
        type: int
      trap_v1_status:
        choices:
        - disable
        - enable
        description:
        - Enable/disable SNMP v1 trap.
        - disable - Disable setting.
        - enable - Enable setting.
        type: str
      trap_v2c_rport:
        description: SNMP v2c trap remote port.
        type: int
      trap_v2c_status:
        choices:
        - disable
        - enable
        description:
        - Enable/disable SNMP v2c trap.
        - disable - Disable setting.
        - enable - Enable setting.
        type: str
    type: dict

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

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