Forum Discussion

Tom_K_185554's avatar
Tom_K_185554
Icon for Nimbostratus rankNimbostratus
Jul 27, 2018

best way add an irule to every virtual server

I have a need to add an existing IRULE to execute first at the top of the list of irules (could be 0-4 already existing irules) to every virtual service in all partitions (except Common) in 10 pairs of viprion vcmp guests that are currently running version 12.1.3.4 - there are approximately 1200 virtual servers that would be impacted. What would you suggest be the best way to accomplish this ? We have used ansible a little, I am not very proficient with it and I also have not seen how I can make sure that the new irule that I am adding will be at the top.

 

1 Reply

  • First iRules have a priority, default is 500, so edit your iRule event and add a priority lower value than 500 to the events e.g.

    when HTTP_REQUEST priority 10 {    
    

    This means the order of the assigned iRules is not important. I highly recommend you assign priorities to all your iRules if ordering is important, which it normally is when you have multiple iRule with the same event in them.

    If you have Enterprise Mnager or BIG-IQ I would look to utilise one of these to assign the iRule to all your VSs.

    If not then you could script something to loop over each partition on an F5, excluding Common, and add to all VSs. Should be a single tmsh command per partition.

    Or you could use Ansible or simply iControl REST and Postman to do the same.