Hi Pualius,
I haven't been able to get the first option working with "Show the data format expected for records_content". This is using the "copy" module/collection. I assume to make a file, to be used to actually import the data with the bigip_datagroup_module.
The second option does work. Thanks! The formatting is really tricky and would be very time consuming, so letting this slide as well.
Just like Nikoolayy1 suggesting, I was allready tinkering with the send_command module and it seems to be working fine. To add 1 line to the DGL i use the following code
tasks:
- name: add {{key}}":="{{value}} to DGL:{{dgl}} on {{server}}
f5networks.f5_modules.bigip_command:
commands:
- modify ltm data-group internal {{dgl}} records add { {{key}} { data {{value}} }}
provider:
server: "{{server}}"
user: "{{F5_username}}"
password: "{{F5_password}}"
When the String/key does not exist, the key-value pair will be added. When the 'key' does exist, it will not update the dgl and gives the following output: The requested class string item (/Common/dgl test-string) already exists in partition Common
It also gives a Warning:
"warnings": [
"Using \"write\" commands is not idempotent. You should use a module that is specifically made for that. If such a module does not exist, then please file a bug. The command in question is \"modify ltm data-group internal dgl...\""
Still i have a hard time wrapping my head around the fact that there is no idempotent function inside the bigip_data_group_module (to Manage dgl's) to add 1 key-value pair to a dgl.
Anyway thanks for all the help, it was useful!