From 767cd82e42b4c81c10ea41a346b5b3c421303aa6 Mon Sep 17 00:00:00 2001 From: Adrian Likins Date: Wed, 9 Aug 2017 10:43:16 -0400 Subject: [PATCH] Fix module failure with pacemaker_cluster: state=cleanup (#27846) * Fix module failure with pacemaker_cluster: state=cleanup If state=cleanup was used, set_cluster() was being called with 'cleanup' state which it doesn't handle. Instead use existing clean_cluster() method. Fixes #27799 * get and return cluster_state on state=clean as well --- lib/ansible/modules/clustering/pacemaker_cluster.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/clustering/pacemaker_cluster.py b/lib/ansible/modules/clustering/pacemaker_cluster.py index 4d0761f6741..79c44defec5 100644 --- a/lib/ansible/modules/clustering/pacemaker_cluster.py +++ b/lib/ansible/modules/clustering/pacemaker_cluster.py @@ -219,9 +219,10 @@ def main(): module.fail_json(msg="Failed during the restart of the cluster, the cluster can't be stopped") if state in ['cleanup']: - set_cluster(module, state, timeout, force) + clean_cluster(module, timeout) + cluster_state = get_cluster_status(module) module.exit_json(changed=True, - out=cluster_state) + out=cluster_state) if __name__ == '__main__':