Solvedansible HaProxy drain mode 'bool' object is not callable error
✔️Accepted Answer
@alikins I looked into the issue today, and it looks like it's caused by a name collision between a variable and function in the module created for handling the new drain
state and parameter. I've submitted PR #30947 to hopefully address this, but have not been able to test this against an HAProxy-managed cluster. I probably won't have time to set up/test against an HAProxy cluster (mock or otherwise) for a couple weeks.
The main noticeable change brought by this PR is tweaking the interface so that draining
replaces drain
as a valid state. (My rationale for this is in the linked PR.)
@stewartwebb: Do you have an HAProxy setup that you wouldn't mind testing the PR changes against? If you change state: drain
to state: draining
and pull down the PR, it will (hopefully!) work as expected.
ISSUE TYPE
COMPONENT NAME
HaProxy Module
ANSIBLE VERSION
CONFIGURATION
ansible-config dump --only-changed
returned nothing. I have changed no config.OS / ENVIRONMENT
Running from OSX 10.10.5
Trying to control HaProxy 1.5.8 on Debian 8
SUMMARY
I am able to enable and disable HaProxy backends correctly but when I try to use the "drain" state type I get this error. The playbook works when I use enabled and disabled but fails with the below error when I use drain.
It says,
'bool' object is not callable
. I might just be configuring this wrong but I believe I am doing everything correctly and using the correct Ansible version.STEPS TO REPRODUCE
EXPECTED RESULTS
I expect the HaProxy backend to change to the drain state.
ACTUAL RESULTS