fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

Add "append" option to the 'fortios_firewall_addrgrp' module #206

Open unbreakabl3 opened 1 year ago

unbreakabl3 commented 1 year ago

Hello, dear developers.

There is an option called "append" exists now in FortiOS 6.4.x at least. Is it possible to add this to the fortios_firewall_addrgrp module?

image

Thank you very much in advance.

Nenq commented 8 months ago

bump, definitely missing this feature...

Nenq commented 8 months ago

A workaround can be made like this:

  1. Create a list
    - name: loop through hosts and add to fact
      set_fact:
        result: "{{ result + [{'name': item}] }}"
      with_inventory_hostnames:
        - all
  2. Add that fact to the member function
    - name: Configure IPv4 address groups.
      fortios_firewall_addrgrp:
        state: present
        access_token: "{{ fortios_access_token }}"
        firewall_addrgrp:
          member: "{{ result }}"
          name: servers