The NetApp Community is moving to a new platform and is in Read-Only mode. Click to learn more.
Stay connected during the transition - Join our Discord community today.

AFF

Ansible and Fpolicy management

Jechar
2,312 Views

Hello,

 

We try to configure Fpolicy throught Ansible to facilitate updates of exclude extension list content manage by security team.

In the extension list we have numeric extension like 000 but when ansible try to activate the fpolicy it failed :

"msg": "calling: /private/cli/vserver/fpolicy/policy/scope: got Expecting json, got: b'{
n \"records\": [
n

{\\n \"vserver\": \"BASNASCIFS\",\\n \"policy_name\": \"blockext_cifs_v1.50\",\\n \"file_extensions_to_include\": [\\n 000,\\n \"kkk\",\\n \"kkkjj\"\\n ],\\n \"is_file_extension_check_on_directories_enabled\": true,\\n \"is_monitoring_of_objects_with_no_extension_enabled\": false\\n }

n ],
n \"num_records\": 1
n}'."

 

For your information the scope is created successfully :

Vserver Policy Extensions Extensions
Name Name Included Excluded
----------------- ------------------- -------------------- -------------------
abcd  blockext_cifs_v1.50 000, kkk, kkkjj -

 


And if we enable the fpolicy throught the cli, it work ! 

 

Have you got an idea ?

It seems that ansible use the value as integer and not as string, we tried to add single au double quote, same issue

 

Thanks

Jc

3 REPLIES 3

ChLokesh
2,140 Views

Hello Jechar,

 

Please raise this query on the following portal. I strongly believe you will have your query answered there.

https://github.com/ansible-collections/netapp.ontap 

mirko
2,051 Views

I don't believe this is an issue in our modules.  but a bug in ontap itself.

mirko
2,057 Views

This clearly is a bug in ontap.  It returns faulty json (not wrapping quotes around the 000).
Are you registering the return value of this module ?  If you are, try to remove the register property, chances are the faulty response is ignored.  Nevertheless, a bug

Public