Well, without digging in and actually writing most of the content, here are some snippets of how I would write it.
exists relay service AND exists package "systemd" of rpm AND(
not exists file "/etc/systemd/system/besrelay.service.d/filelimits.conf" whose(content of it contains "LimitNOFILE=infinity")
not exists file "/etc/security/limits.conf" whose(content of it contains "* hard nofile 65536") )
…for your relevance
Then write your action script to update the files the way you see fit. You could actually download the file you want in place, or update the file the way you noted above.
You could separate out the sytemd conf file and the limits part, but with this, you have al the parts you need to build it.