Closed greenspartan closed 10 months ago
Hi Adrien,
The policyid: "0" is not longer supported with ansible module, you need to specify an id
Hi Alexis,
Thanks a lot for your feedback ! I confirm i don't have any error when using a real policyid (I mean different from 0).
Indeed in notes section of latest documentation it's advised to not use anymore policyid: "0"
But as it was not clearly said it was no longer supported, I didn't think my issue was coming from this.
By the way do you know where we can find Q&A mentionned in notes section ?
I would like to know how I can automatically use the latest available policy ID, without having fear to overlap/shadow existing policies ? Does it mean only option is to parse all policies and then find first available ID by sorting all that list ?
Thanks and have a great day !
Best Regards,
Adrien
Hi Adrien,
the solution will be to get/set a fact with the highest policyid configured actually
Hi Alexis,
Thanks for your feedback. Indeed I made additional tasks in order to fetch all policy and then find the first available ID.
Here it is if it can help someone :
- name: Retrieve policies
fortinet.fortios.fortios_configuration_fact:
vdom: "root"
selector: firewall_policy
register: r
- name: Set fw policy config list
set_fact:
fw_policy_config_list: "{{ r.meta.results | map(attribute='policyid') | list }}"
- name: Find first available policyID
set_fact:
first_available_id: "{{ (range(1, range_limit + 1) | difference(fw_policy_config_list) | first) }}"
where range_limit is a playbook variable.
So all is good for me now, I will close the issue ;).
Thanks again for the help !
Adrien
Hi guys,
I have recently upgraded Tower from 3.8.4 to AAP 2.4 (Ansible 2.15.5) and I have now an issue running a playbook while it was working just fine on Tower 3.8.4 (Ansible 2.9).
I am using fortinet.fortios ansible galaxy collection v2.3.4.
My Fortigate is running on v7.0.12
This playbook ends with following error :
Here's below the associated Ansible task code :
What is strange is that fortios_firewall_address, fortios_firewall_ippool and fortios_firewall_vip modules are working perfectly and are able to create related config on the Fortigate.
Issue is happening for fortios_firewall_policy module only.
I have activated some https debug on the Fortigate and I can see the following error message :
Why I have this error message
no method found for requested action: (null)
while other modules works perfectly ?Thanks in advance for your help and don't hesitate if you need additional infos ;) !
Best Regards,
Adrien