ansible-collections / community.rabbitmq

Manage RabbitMQ with Ansible
http://galaxy.ansible.com/community/rabbitmq
Other
31 stars 50 forks source link

Do not append -n 'rabbit' parameter by default to rabbitmq_user module invocation #32

Open seki98 opened 4 years ago

seki98 commented 4 years ago
SUMMARY

As also reported and fixed in https://github.com/ansible/ansible-modules-extras/pull/1417/commits/3013f059616a7d018c9794be076217c9fa2bd206 the rabbitmq_user module adds -n parameter by default with a default value "rabbit":

The latest stable version line of code responsible for the "bug": https://github.com/ansible/ansible/blame/ff7bbbcaf1e8f434432075bc9c55626a9dd3091d/lib/ansible/modules/messaging/rabbitmq/rabbitmq_user.py#L252

ISSUE TYPE
COMPONENT NAME

rabbitmq_user messaging module

ANSIBLE VERSION
ansible 2.9.7
CONFIGURATION

Not relevant, problem identified in the code.

OS / ENVIRONMENT

Not relevant, problem identified in the code.

STEPS TO REPRODUCE
- name: "[810] delete guest"
  rabbitmq_user:
    user:  "guest"
    state: "absent"
EXPECTED RESULTS

No default "-n 'rabbit'' parameter is used and user is removed.

ACTUAL RESULTS

output:

{
    "changed": false,
    "cmd": "/opt/rabbitmq/sbin/rabbitmqctl -q -n rabbit list_users",
    "msg": "\n07:********@bcd0cc70bfa9'. Please see diagnostics information and suggestions below.\n\nMost common reasons for this are:\n\n * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)\n * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)\n * Target node is not running\n\nIn addition to the diagnostics info below:\n\n * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n * Consult server logs on node rabbit@bcd0cc70bfa9\n\nDIAGNOSTICS\n===========\n\nattempted to contact:********@bcd0cc70bfa9:\n  * connected to epmd (port 4369) on bcd0cc70bfa9\n  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic \n  * TCP connection succeeded but Erlang distribution failed \n  * suggestion: check if the Erlang cookie identical for all server nodes and CLI tools\n  * suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other\n  * suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that\n   * suggestion: see the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n\n\nCurrent node details:********@dev20-rabbitmq-1.argos-test.merlin'\n * effective user's home directory: /var/lib/rabbitmq\n * Erlang cookie hash: fwFzSmDgSM91iqx2okyVOg==",
    "rc": 69,
    "stderr": "\n07:52:49.335 [error] ** System running to use fully qualified hostnames **\n** Hostname bcd0cc70bfa9 is illegal **\n\n\n07:52:49.348 [error] ** System running to use fully qualified hostnames **\n** Hostname bcd0cc70bfa9 is illegal **\n\nError: unable to perform an operation on node 'rabbit@bcd0cc70bfa9'. Please see diagnostics information and suggestions below.\n\nMost common reasons for this are:\n\n * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)\n * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)\n * Target node is not running\n\nIn addition to the diagnostics info below:\n\n * See the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n * Consult server logs on node rabbit@bcd0cc70bfa9\n\nDIAGNOSTICS\n===========\n\nattempted to contact: [rabbit@bcd0cc70bfa9]\n\nrabbit@bcd0cc70bfa9:\n  * connected to epmd (port 4369) on bcd0cc70bfa9\n  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic \n  * TCP connection succeeded but Erlang distribution failed \n  * suggestion: check if the Erlang cookie identical for all server nodes and CLI tools\n  * suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other\n  * suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that\n   * suggestion: see the CLI, clustering and networking guides on http://rabbitmq.com/documentation.html to learn more\n\n\nCurrent node details:\n * node name: 'rabbitmqcli-989-rabbit@dev20-rabbitmq-1.argos-test.merlin'\n * effective user's home directory: /var/lib/rabbitmq\n * Erlang cookie hash: fwFzSmDgSM91iqx2okyVOg==\n\n",
    "stderr_lines": [
        "",
        "07:52:49.335 [error] ** System running to use fully qualified hostnames **",
        "** Hostname bcd0cc70bfa9 is illegal **",
...
rockandska commented 3 years ago

@seki98, are you sure to not have configured NODENAME env somewhere ? All module use the same behavior without problem and only encounter you error when I changed defaultnode name with NODENAME env var