Closed tchession closed 5 years ago
Hi, sorry for the late reply. I think the problem is in the mappedip attribute. According to the schema it is a table and not a string:
GET http://{{fgt_ip}}/api/v2/cmdb/firewall/vip?action=schema
[...]
"mappedip": {
"name": "mappedip",
"category": "table",
"help": "IP address or address range on the destination network to which the external IP address is mapped.",
"mkey": "range",
"mkey_type": "string",
"children": {
"range": {
"name": "range",
"category": "unitary",
"type": "string",
"help": "Mapped IP range.",
"required": true,
"size": 64
}
},
[...]
I have created this example for your case. It has been tested in v6.0.2:
- hosts: localhost
vars:
host: "192.168.122.40"
username: "admin"
password: ""
tasks:
- name: Set vip on the fortigate
connection: local
fortiosconfig:
https: False
action: "set"
host: "{{host}}"
username: "{{username}}"
password: "{{password}}"
config: "firewall vip"
config_parameters:
name: "1"
type: static-nat
dns-mapping-ttl: 0
ldb-method: static
extip: 1.1.1.1
mappedip:
- range: 10.10.10.10
extintf: port1
arp-reply: enable
protocol: tcp
extport: 0-65535
mappedport: 0-65535
Hope that helps.
Hello,
I am receiving the following error when running a playbook to create a VIP on an FG-VM-64.
The playbook is as follows:
I have confirmed that the firewall is reachable from my Ansible machine, and that the credentials are correct. My pip list is below.
Thank you very much for your assistance.