# F5 disable pool/node

**URL:** <https://forum.ansible.com/t/f5-disable-pool-node/17577>\
**Category:** Ansible Project\
**Created:** [February 20, 2015, 4:47pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577 "2015-02-20T16:47:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [February 20, 2015, 4:47pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/1 "2015-02-20T16:47:54Z")

</div>

We are looking into automating our network failover between datacenters using the F5 network modules. [http://docs.ansible.com/list\_of\_network\_modules.html](http://docs.ansible.com/list_of_network_modules.html).

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?

Thanks.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 20, 2015, 6:50pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/2 "2015-02-20T18:50:01Z")

</div>

​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.

Perhaps Brian C can assign that ticket to me?

&nbsp;&nbsp;Serge

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [February 20, 2015, 7:42pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/3 "2015-02-20T19:42:12Z")

</div>

Thanks for the response. I filled out issue [https://github.com/ansible/ansible/issues/10307](https://github.com/ansible/ansible/issues/10307). Let me know if this unclear. I can take a look at the bigip api and see what I find.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 20, 2015, 8:38pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/4 "2015-02-20T20:38:58Z")

</div>

​Doesn't this needs to be filed in  
[https://github.com/ansible/ansible-modules-extras](https://github.com/ansible/ansible-modules-extras) ?​

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [February 20, 2015, 9:36pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/5 "2015-02-20T21:36:04Z")

</div>

Yes my apologies. Is it possible to move it over or should it just be closed and a new one opened?

---

<div class="post-metadata">

**Author:** ![Greg\_Andrews](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@Greg\_Andrews](https://forum.ansible.com/u/Greg_Andrews)\
**Post date:** [February 21, 2015, 1:11am UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/6 "2015-02-21T01:11:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 21, 2015, 2:58pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/7 "2015-02-21T14:58:10Z")

</div>

​Greg,​

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 21, 2015, 2:58pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/8 "2015-02-21T14:58:35Z")

</div>

​You'll need to do that manually.​

---

<div class="post-metadata">

**Author:** ![Greg\_Andrews](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@Greg\_Andrews](https://forum.ansible.com/u/Greg_Andrews)\
**Post date:** [February 21, 2015, 7:42pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/9 "2015-02-21T19:42:55Z")

</div>

Hi Serge,

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.

-Greg

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [February 22, 2015, 9:37am UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/10 "2015-02-22T09:37:29Z")

</div>

​Ah, ok, I thought you intended to provide an example. No problem.

Did you manage to make those ` command: tmsh​` somehow idempotent?

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [February 22, 2015, 2:22pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/11 "2015-02-22T14:22:40Z")

</div>

I opened a new issue at [https://github.com/ansible/ansible-modules-extras/issues/276](https://github.com/ansible/ansible-modules-extras/issues/276) in the correct repository.

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](https://devcentral.f5.com/questions/bigsuds-how-to-enable-disable-certain-pool-members) looks like it has the necessary code snippet to do this.

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [February 24, 2015, 2:08am UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/12 "2015-02-24T02:08:01Z")

</div>

I’ll get a PR up soon to address this.

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [February 25, 2015, 1:19am UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/13 "2015-02-25T01:19:06Z")

</div>

I’ve posted a P.R. which needs some volunteers to test.

[https://github.com/ansible/ansible-modules-extras/pull/282](https://github.com/ansible/ansible-modules-extras/pull/282)

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [February 25, 2015, 2:40am UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/14 "2015-02-25T02:40:12Z")

</div>

BTW, once I can get some testers on this change, I can incorporate a similar one that works on the pool  
-member level.

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [February 25, 2015, 5:13pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/15 "2015-02-25T17:13:48Z")

</div>

Nice that would be my next request.I can test this out but I’m confused by the table at [https://devcentral.f5.com/questions/icontrol-equivalent-call-for-b-node-down](https://devcentral.f5.com/questions/icontrol-equivalent-call-for-b-node-down)

Does that mean even with the session and monitor disabled active connections aren’t broken?

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [February 25, 2015, 6:13pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/16 "2015-02-25T18:13:40Z")

</div>

Michael,

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.

Does that help?

-M

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [February 25, 2015, 11:55pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/17 "2015-02-25T23:55:04Z")

</div>

BTW, I’ve greated a P.R. for doing the same on the pool member level:

[https://github.com/ansible/ansible-modules-extras/pull/288](https://github.com/ansible/ansible-modules-extras/pull/288)

Again, could use some testers.

---

<div class="post-metadata">

**Author:** ![Michael\_Perzel](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Michael\_Perzel](https://forum.ansible.com/u/Michael_Perzel)\
**Post date:** [March 3, 2015, 7:41pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/18 "2015-03-03T19:41:57Z")

</div>

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?

Thanks,

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [March 5, 2015, 7:00pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/19 "2015-03-05T19:00:48Z")

</div>

I think so, although keep in mind that the API doesn’t always map to things in the UI.

---

<div class="post-metadata">

**Author:** ![Matt\_Hite](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@Matt\_Hite](https://forum.ansible.com/u/Matt_Hite)\
**Post date:** [March 6, 2015, 5:56pm UTC](https://forum.ansible.com/t/f5-disable-pool-node/17577/20 "2015-03-06T17:56:28Z")

</div>

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.

[Next page](https://forum.ansible.com/t/f5-disable-pool-node/17577.md?page=2)
