My question is how to edit/modify existing irule using ansible automatically. Please help me by pointing to code or module to do so.
I have existing irules which are needed to be edited/modified frequently. So, I’m automating it using ansible. I have found code to create and delete irule using ansible but it dont have option to edit. Please help me.
Thanks for your reply Dario. What I want is actually to edit/modify existing irules. I have seen this before its not so clear how to modify or edit existing irules. Or even If I want to take existing irule edit and recreate it.
Ansible is a state machine. It will deploy a configuration with or without an iRule. The state option on the link provided by Dario hints at this. There is no such thing as edit. You would redeploy the iRule again to overwrite the old one. I would just run the playbook again with an updated file and see if it updates the F5’s active configuration.
My understanding now is with ansible it is not possible to modify/update existing irule. Is it possible in some other tools like tcl etc? Or do we have REST api for this?
Hi AhmedBaig, ansible does the config management well, you give it an irule and it updates it. If you are asking about using an offline editor to pull down an irule, edit it on the fly, and “save” which updates the iRule on the BIG-IP, you can use the Eclipse plugin for that, or you can use the rest API to update the contents of an iRule directly. In fact, I even wrote a little demo app in python’s flask environment that you can use a local docker container to edit your iRules with. Let me know which direction you are seeking and I’ll point you to the right resources.
Update:
Example using the API with python below. That said, doing it this way is really no different than using ansible as you are not interactively changing the irule. You update it in a file and then use the API to push the update.