network_hosts - Host Resource

Added in version 1.0.0.

Synopsis

Host Resource.

Use API “/resource-api/v2/network/hosts”.

Requirements

The below requirements are needed on the host that executes this module.

  • ansible>=2.17.0

Parameters

  • state The state of the module. "present" means create or update the resource, "absent" means delete the resource.type: strchoices: ['present', 'absent']default: present
  • force_behavior Specify this option to force the method to use to interact with the resource.type: strchoices: ['none', 'read', 'create', 'update', 'delete']default: none
  • bypass_validation Bypass validation of the module.type: booldefault: False
  • params The parameters of the module.[Required]type: dict
    • primary_key [Required]type: str
    • type type: strchoices: ['fqdn', 'geography', 'ipmask', 'iprange']
    • location type: strchoices: ['external', 'internal', 'private-access', 'unspecified']
    • subnet type: str
    • start_ip type: str
    • end_ip type: str
    • fqdn type: str
    • country_id type: str

Examples

- name: Network Host
  hosts: fortisase
  gather_facts: false
  vars:
    host: "network_host_example"
  tasks:
    - name: Create/Update Network Host
      fortinet.fortisase.network_hosts:
        state: present
        params:
          primary_key: "{{ host }}"
          type: "ipmask"
          location: "internal"
          subnet: "192.168.4.0/24"
    - name: Delete Network Host
      fortinet.fortisase.network_hosts:
        state: absent
        params:
          primary_key: "{{ host }}"

Return Values

  • http_code type: intreturned: always
  • response type: rawreturned: always

Authors

  • Xinwei Du (@dux-fortinet)