network_dns_rules - DNS Rule Resource

Added in version 1.0.0.

Synopsis

DNS Rule Resource.

Use API “/resource-api/v2/network/dns-rules”.

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
    • primary_dns type: str
    • secondary_dns type: str
    • domains type: listelements: str
    • pop_dns_override type: dict
    • for_private type: bool

Examples

- name: Network DNS Rule
  hosts: fortisase
  gather_facts: false
  vars:
    primary_key: "1"
  tasks:
    - name: Create/Update Network DNS Rule
      fortinet.fortisase.network_dns_rules:
        state: present
        params:
          primary_key: "{{ primary_key }}"
          primary_dns: "1.1.1.1"
          secondary_dns: "1.1.1.2"
          domains:
            - www.facebook.com
            - www.google.com
          pop_dns_override: {}
    - name: Delete Network DNS Rule
      fortinet.fortisase.network_dns_rules:
        state: absent
        params:
          primary_key: "{{ primary_key }}"

Return Values

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

Authors

  • Xinwei Du (@dux-fortinet)