Open Tiguespa opened 1 month ago
Hi @Tiguespa ,
Thank you for your question. Our Ansible module is designed to manage the entire object and ensure consistency between scripts and actual configurations. However, we do offer a member operation feature that allows for adding or deleting elements from an existing block. Please find an example below. Do let us know if this does not meet your requirements.
tasks:
- name: Configure interfaces.
fortios_system_interface:
vdom: root
state: present
member_state: present # present for adding and updating, absent for deleting
member_path: secondaryip:id # main key for locating the element
system_interface:
vdom: root
allowaccess:
- ping
- ssh
- https
ip: 1.2.56.4/24
name: test234
type: vlan
secondary_IP: "enable"
vlanid: 766
interface: port2
secondaryip:
-
ip: "2.3.4.6/24"
id: "2"
Thanks, Maxx
Thanks you Maxx, it seems it does exactly what i wanted !
I didn't understand member_state/path allowed to do that :)
Hello
I've noticed that if i want to implement a new secondary ip via playbook and the module system_interface, it will always change by the new one instead of adding .
Is there anything that i can do to just add ?
tasks:
name: Enable secondary IP on interface port fortinet.fortios.fortios_system_interface: state: "present" system_interface: name: "port..." secondary_IP: "enable" secondaryip:
Thanks