I’ve been able to do simple things like gather facts, add/delete nodes, add/delete pools but one thing I am missing is being able to disable a node or pool. I don’t necessarily want to delete a node to in essence disable it. I can’t find any documentation stating this is possible. Has anyone come across a way to do this?
As far as I know, the modules don't support that now. Might be a feasible
addition, but keep in mind bigip has an extremely extensive API for every
object, which is not always easy to put into a 1 module.
I'd say, file a feature request, but I dont think it's something the core
team can and will support.
I wrote one of those modules, and Matt Hite most others. Not sure who else
is there to maintain/extend them.
I might have a look at that.
Perhaps file a feature request ticket, and describe in more detail what you
want to do, with which objects.
This is just a data point from a site that uses Ansible and has F5 load balancers. Our network admin has written playbooks that use ssh and invoke the F5 tmsh command-line utility to do things like add/remove/enable/disable nodes in pools.
Unfortunately, company policy won’t let me share an example. I wanted to indicate the general idea that we set up keys for ssh access to our F5 devices and use the Ansible shell module to run “tmsh” commands in them. It’s not as nice as a full module, but it seemed easier than the other API options available to us.
I took a look at ansible-module-extra\network\f5\bigip_node.py seems like it would make sense to add a couple functions called get/set_node_state. They could be invoked from the else statement that updates the attributes. I haven’t tested this yet but https://devcentral.f5.com/questions/bigsuds-how-to-enable-disable-certain-pool-members looks like it has the necessary code snippet to do this.
My understanding is that setting session state to disabled prevents new connections from being sent to the node UNLESS they match a persistence lookup. If you use simple round robin without a persistence setting for a pool, this shouldn’t matter.
However, if you are making use of client to backend node persistence, setting monitor state to disabled will also prevent persistent connections from continuing to reach said node.
I tested out the 2 pull requests. I successfully was able to set the session/monitor state for pools/nodes, non-existent nodes/pools etc. One thing I noticed is that when a node is set to monitor_state=disabled, session_state=enabled it results in forced offline. Is this intended behavior? That set of parameters isn’t in the table. I need to do more testing to see how this effects open connections but as for my use case I think this fixes my issues.
Has there been any work in looking at a module modifying a GTM?
Sorry, I realized I answer your first question but not your second.
I have not started work on GTM modules but am open to implementing this for the community. Feel free to share your specific use cases of what you would like to be able to do.