大网数据广告活动
服务器运维问答

Hide my password in Ansible Playbook

· 52CE 我爱测

I would like to run mysqldump in the Ansible playbook by the shell module. Trying to find a way to hide my MySQL root password in the ansible playbook or Ubuntu. I currently have a file that was encrypted by ansible-vault to stor…

问题原文

原帖链接 · ITnewbie · CC BY-SA 4.0

I would like to run mysqldump in the Ansible playbook by the shell module. Trying to find a way to hide my MySQL root password in the ansible playbook or Ubuntu.

I currently have a file that was encrypted by ansible-vault to store my mysql root password then I can call the password as a variable in the playbook. But I would like crontab to run my ansible-playbook every day. So it is impossible to enter the vault password manually. I found ansible-vault can create a Vault Password File to store the vault password then we don't have to manually type the password when we run the ansible-playbook. But the content in the Vault Password File is still plain-text.......

How do I fully hide my password in the Ansible playbook and my Ubuntu system?

I am very new to Ansible, any help is appreciated!

已采纳解答

原帖链接 · Gerald Schneider · CC BY-SA 4.0

That's not possible. At some point you need to store something that allows you to decrypt the password.

Use credentials that are generated specifically for this process, no personal credentials.
Restrict access to the password file to people who have to use it. There is nothing more you can do.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-11-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。