---
- name: Configure Address objects FORTINET
hosts: localhost
vars:
host: "192.168.122.25"
username: "admin"
password: "admin"
vdom: "root"
partner: "PARTNER_1"
addresses:
- comment: "Administration IP for CPE 1"
name: "H-{{ partner }}_Cpe.Lo1-1"
- comment: "Administration IP for CPE 2"
name: "H-{{ partner }}_Cpe.Lo1-2"
tasks:
- name: Configure one partner address
fortios_firewall_address:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
https: "False"
state: "present"
firewall_address:
comment: "{{ item.comment }}"
subnet: "{{ item.subnet }}"
type: "ipmask"
with_items: "{{ addresses }}"
- name: Configure address group for the partner
fortios_firewall_addrgrp:
host: "{{ host }}"
username: "{{ username }}"
password: "{{ password }}"
vdom: "{{ vdom }}"
https: "False"
state: "present"
firewall_addrgrp:
name: "G-{{ partner }}_Cpe.Lo"
member:
comment: "IP Groupe of partner {{ partner }}"
visibility: "enable"
with_items: "{{ addresses }}"
register: print_output
- debug: var=print_output