Closed arnoldthebat closed 7 months ago
Hi @arnoldthebat ,
Thank you for raising this issue, you are right, ssl-certificate
data type changed from string to array since FortiOS7.4.2, I will report it to the development team for fixing, here is a temporary workaround solution for you, sorry for any inconvenience.
- name: config firewall vip
fortios_json_generic:
vdom: '{{ vdom }}'
json_generic:
method: POST
path: /api/v2/cmdb/firewall/vip
jsonbody: '
{
"extintf": "any",
"extip": "2.3.4.5",
"extport": "23",
"name": "vip_json2",
"server-type": "https",
"type": "server-load-balance",
"ssl-mode": "full",
"ssl-certificate": [
{
"name": "Fortinet_Factory"
}
]
}
'
register: info
- name: display vars
debug: msg="{{info}}"
Thanks, Maxx
Hi @arnoldthebat
Please install the latest version 2.3.6 and try this module again! I will close this ticket as the issue has been fixed in this version. Use the parameter 'ssl_certificate_dict' in your playbook if the fortiOS firmware version is >=7.4.2
https://ansible-galaxy-fortios-docs.readthedocs.io/en/latest/gen/fortios_firewall_vip.html
ssl_certificate_dict:
- name: Fortinet_Factory
- name: "Fortinet_Factory_Backup"
Thanks, Jie
Using fortinet.fortios.fortios_firewall_vip - version 2.3.5
Attempting to add in a VIP of type 'server-load-balance'
Code snippet:
Error:
There must be at least 1 server certificate configured.\nattribute set operator error, -56, discard the setting\nCommand fail
Setting the following on the FW
diag deb en
diag deb cli 8
On the CLI, the last command we see is
unset ssl-certificate
and then abort with error 56.For ref, setting the
server_type
tohttp
then running the above works. The certificate wont get set of course.Also see: https://stackoverflow.com/questions/77959671/ansible-fortigate-vip-configuration-with-ssl-certificate for another user experiencing the same issue
Tried 2.3.5 - 2.3.3 versions of the collection with the same output error
Setting the cert manually after changing the type to https, and adding in the certs allows subsequent changes to be made to the VIP. Any cert changes however are ignored.
Note that this fails on FortiOS7.4.3 but works on FortiOS7.2.7 so related to a small change in the payload since in 7.4.3 its changed to an array:
FortiOS7.4.3
FortiOS7.2.7