Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible :: [WARNING]: Module did not set no_log for update_password

I am trying to create a rabbitmq node using terraform and ansible scripts,Other scripts are executing successfully but I am facing a warning while running this script of adding a user in rabbitmq node.

[WARNING]: Module did not set no_log for update_password

failed: [rabbit-node1] (item=admin) => {
    "ansible_loop_var": "item", 
    "changed": false, 
    "cmd": "/usr/sbin/rabbitmqctl -q -n rabbit list_users", 
    "invocation": {
        "module_args": {
            "configure_priv": ".*", 
            "force": false, 
            "node": "rabbit", 
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "permissions": [
                {
                    "configure_priv": ".*", 
                    "read_priv": ".*", 
                    "vhost": "/", 
                    "write_priv": ".*"
                }
            ], 
            "read_priv": ".*", 
            "state": "present", 
            "tags": "administrator,admin", 
            "update_password": "on_create", 
            "user": "admin", 
            "vhost": "/", 
            "write_priv": ".*"
        }
    }, 
    "item": "admin", 
    "msg": "Error:********@rabbit-node1.\n * Suggestion: start it with \"rabbitmqctl start_app\" and try again", 
    "rc": 70, 
    "stderr": "Error: rabbit application is not running on node rabbit@rabbit-node1.\n * Suggestion: start it with \"rabbitmqctl start_app\" and try again\n", 
    "stderr_lines": [
        "Error: rabbit application is not running on node rabbit@rabbit-node1.", 
        " * Suggestion: start it with \"rabbitmqctl start_app\" and try again"
    ], 
    "stdout": "", 
    "stdout_lines": []
}

main.yml file for Creating user in Rabbitmq node using ansible:

- name: add user
  rabbitmq_user:
    user: "{{ item }}"
    password: "{{ ADMIN_PASS }}"
    tags: administrator,{{item}}
    vhost: /
    configure_priv: .*
    write_priv: .*
    read_priv: .*
    state: present
  with_items:
  - admin
like image 828
Dhaval Patel Avatar asked Mar 17 '20 10:03

Dhaval Patel


2 Answers

use like this

 - name: add user
      no_log: true
      rabbitmq_user:
        user: "{{ item }}"
        password: "{{ ADMIN_PASS }}"
        tags: administrator,{{item}}
        vhost: /
        configure_priv: .*
        write_priv: .*
        read_priv: .*
        state: present
      with_items:
      - admin

the key point is no_log: true option

like image 168
Alex Avatar answered Nov 20 '22 09:11

Alex


Alex's answer is correct... but it doesn't parse. I don't think it matters but I always put task controls on the bottom.

- name: add user
  rabbitmq_user:
    user: "{{ item }}"
    password: "{{ ADMIN_PASS }}"
    tags: administrator,{{item}}
    vhost: /
    configure_priv: .*
    write_priv: .*
    read_priv: .*
    state: present
  no_log: true
  with_items:
  - admin
like image 2
Quin Avatar answered Nov 20 '22 11:11

Quin