My team recently started testing Ansible functionality for building objects on our F5 LTMs. Part of the process that we would like to automate is the creation of pool monitors. I can successfully create HTTP and TCP monitors using the bigip_monitor_http and bigip_monitor_tcp modules but am having problems creating an HTTPS monitor.
At first I thought I could use the bigip_monitor_http module and just set the type and parent options to https but the module doesn't appear to support an option for type and if I try to set parent to https, it fails since the parent doesn't match the monitor's default type which is http. Trusty google didn't seem to provide any help and I don't see a bigip_monitor_https module in the Ansible documentation.
My guess is that this functionality is not supported based on the available modules/options in Ansible but I wanted to verify before I proceed with going down a different path.
Have you tried using iControl in Python and then use that script within Ansible ?
A bit of digression, don't use the default profiles. Create custom profiles using the default profile as the parent profile.
In the end, I decided to use Ansible to build a python script that makes cURL posts to the iControl REST API in order to build objects on the LTM. I used the requests and json libraries in python and the total work was only a few hours. I decided to go down this path so the python script could go through a review workflow before it was executed.
If anyone is interested I can provide some examples of the Ansible and Python configs.
Yes, please post your example Ansible and Python code!
@Royce, Even i am also trying to do a similar stuff , it would be great if you can share the example
You can use iControl REST API using uri module to create any object in F5. Below sample code is used to create node in F5.
- name: " Create node"