RabbitMQ Hostname Mismatch

Farily new to ansible, so apologies if I’m missing something obvious.

Ansible version: 2.5.5

Issue: My task throws a hostname mismatch error when adding a new vhost on a server that contains a fresh installation of rabbitMQ:

`

  • name: Ensure RabbitMQ virtual host exists
    rabbitmq_vhost:
    name: “{{ item.name|slugify }}”
    state: present
    when: inventory_hostname in groups[‘db-servers’]

`

Error description:

`
fatal: [my-server-address]: FAILED! => {“changed”: false, “cmd”: “/usr/sbin/rabbitmqctl -q -n rabbit list_vhosts name tracing”, “msg”: "Error:********@localhost

  • home dir: /var/lib/rabbitmq
  • cookie hash: pD9UkaDbh5qROT8GfbNTrA==",
    “rc”: 69, “stderr”: "Error: unable to connect to node rabbit@localhost: nodedown

DIAGNOSTICS

Is SSL enabled on the rabbitmq server?

It’s a stock standard Ubuntu 18.04 server, all I did was install rabbitmq-server via apt. I have not changed any of the config files, so I’m assuming SSL is disabled by default.

Did you manage to fix this issue, I’m having the same problem