I am trying to enable/disable existing individual virtual server using ansible. The following code is working properly when the type of VIP is standard. But, if the type is different like Performance-l4 it is asking for additional parameters(profiles) to be passed. Is this normal behavior(it is trying to overwrite the existing values.) or is my way of doing it not right. How to preserve the existing state and simply enable/disable the VIP in F5. Kindly guide me.
tasks:
- name: Change state of virtual server
bigip_virtual_server:
provider: "{{ provider }}"
name: /App/vip1
destination: 198.51.100.1
port: 443
snat: "Automap"
state: "enabled"
I just tried this and the Performance L4 server type requires a protocol profile and it does not apply a default one like it does for certain things with a Standard one. ie. when you specific port 443, it automatically throws in a http profile.
I checked in the GUI and when you specify the Performance L4 profile, it does apply the fastL4 profile as the default.
In your situation, if you wanted you could just use the REST API: https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ltm_virtual.html
PATCH https://IP-of-BIGIP/mgmt/tm/ltm/virtual/{nameofvip}
Body:
{ "disable": true }
Also worth double checking in the #ansible on the Slack support channel: https://f5cloudsolutions.herokuapp.com/