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