diff --git a/changelogs/fragments/6949-ejabberdctl-error.yml b/changelogs/fragments/6949-ejabberdctl-error.yml new file mode 100644 index 0000000000..be2294ffa3 --- /dev/null +++ b/changelogs/fragments/6949-ejabberdctl-error.yml @@ -0,0 +1,2 @@ +bugfixes: + - ejabberd_user - provide meaningful error message when the ``ejabberdctl`` command is not found (https://github.com/ansible-collections/community.general/pull/7028, https://github.com/ansible-collections/community.general/issues/6949). diff --git a/plugins/modules/ejabberd_user.py b/plugins/modules/ejabberd_user.py index 397207ae61..a8872cacc3 100644 --- a/plugins/modules/ejabberd_user.py +++ b/plugins/modules/ejabberd_user.py @@ -122,7 +122,7 @@ class EjabberdUser(object): """ This method will run the any command specified and return the returns using the Ansible common module """ - cmd = [self.module.get_bin_path('ejabberdctl'), cmd] + options + cmd = [self.module.get_bin_path('ejabberdctl', required=True), cmd] + options self.log('command: %s' % " ".join(cmd)) return self.module.run_command(cmd)