Did you manage to fix this issue, I'm getting the same error On Tuesday, 19 June 2018 20:26:42 UTC+1, [email protected] wrote: > > 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 > =========== > > attempted to contact: [rabbit@localhost] > rabbit@localhost: > * connected to epmd (port 4369) on localhost > * epmd reports node 'rabbit' running on port 25672\n * TCP connection > succeeded but Erlang distribution failed > * Hostname mismatch: node \"rabbit@db1\" believes its host is different. > Please ensure that hostnames resolve the same way locally and on > \"rabbit@db1\" > > > current node details: > - node name: 'rabbitmq-cli-74@localhost'\n > - home dir: /var/lib/rabbitmq\n > - cookie hash: pD9UkaDbh5qROT8GfbNTrA==\n\n > ", "stderr_lines": ["Error: unable to connect to node rabbit@localhost: > nodedown", "", "DIAGNOSTICS", "===========", "", "attempted to contact: > [rabbit@localhost]", "", "rabbit@localhost:", " * connected to epmd (port > 4369) on localhost" > * epmd reports node 'rabbit' running on port 25672", " * TCP connection > succeeded but Erlang distribution failed", "", " * Hostname mismatch: node > \"rabbit@db1\" believes its host is different. Please ensure that hostnames > resolve the same way locally and on \"rabbit@db1\"", "", "", "current node > details:", "- node name: 'rabbitmq-cli-74@localhost'", "- home dir: > /var/lib/rabbitmq", "- cookie hash: pD9UkaDbh5qROT8GfbNTrA==", ""], > "stdout": "", "stdout_lines": []} > > > I'm not sure where I've gone wrong, but it seems like *rabbit@localhost *and > *rabbit@db-1 *(*where db-1 is my hostname) *don't seem to match. I've > managed to get around it by forcing the node name to include the correct > hostname: > > - name: Ensure RabbitMQ virtual host exists > rabbitmq_vhost: > name: "{{ item.name|slugify }}" > node: "rabbit@{{ ansible_hostname }}" > state: present > > > >
-- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4e3901a-b0e7-404f-b30f-0e5193d29690%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
