Forum Discussion

Greg_Jewett's avatar
May 21, 2024

Force peer to standby using Ansible!?

So, I have read over a number of articles found online regarding determining which nodes are active and attempt to perform the "force to standby" action, thus, in turn, causes the HA peer to become active.  (Same as clicking on the button by the same name in the GUI).

So, I have successfully generated a variable that contains the node that needs to sent to standby.  That part works thus far.

However, when I then go to use "f5networks.f5_modules.bigip_node" ansible module to perform the failover, it tells me that the task resulted in a "change", but the node does not go offline and its peer does not become active.

- name: Force the failover of the B unit peer...
  f5networks.f5_modules.bigip_node:
    state: offline
    fqdn: "{{ host_to_failover.name }}"
    name: "{{ host_to_failover.name }}"
    provider:
      server: "{{ host_to_failover.name }}"
      server_port: 443
      validate_certs: false
      no_f5_teem: false
      user: admin
      password: "{{ admin_acct_password }}"
  delegate_to: localhost

Output:

TASK [debug] **********************************************************************
ok: [f5-r5900-a.its.utexas.edu] => {
    "host_to_failover": {
        "name": "f5-r5900-revprox-b.its.utexas.edu",
        "state": "active"
    }
}

TASK [Force the failover of the B unit peer...] ***************************************
changed: [f5-r5900-a.its.utexas.edu]


Some confusion about parameters:
See:  ansible module > bigip_node

It requires a "name" parameter, even though I am not adding a "node", so I just populate it with the hostname I was to "force to standby".   It also asks for It asks for an fqdn/address.   I guess this is the node I want to perform the "force to standby" on?  So I also populate that with the hostname I was to "force to standby".

There is also the "server" within the "provider", and does that have any affect on requesting this action?  I tried putting the node to failover here, as well as its peer, but it does not make any difference.

Nothing I do, actually causes a "failover" to the "A peer" from the "B peer".  

HELP!?

What is the best way (example please?) to "force to standby" a node, to cause a failover, and the HA peer to become the active peer?