gpt4 book ai didi

Ansible::[警告]:模块没有为 update_password 设置 no_log

转载 作者:行者123 更新时间:2023-12-03 17:12:20 24 4
gpt4 key购买 nike

我正在尝试使用 terraform 和 ansible 脚本创建一个 rabbitmq 节点,其他脚本正在成功执行,但是在运行这个在 rabbitmq 节点中添加用户的脚本时我遇到了一个警告。

[警告]:模块没有为 update_password 设置 no_log

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": []
}

使用 ansible 在 Rabbitmq 节点中创建用户的 main.yml 文件:
- 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

最佳答案

像这样使用

 - 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
关键是 no_log:真选项

关于Ansible::[警告]:模块没有为 update_password 设置 no_log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60720775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com