ansible - 如何在 Ansible 中加密剧本中的变量?
问题描述
我正在运行一本剧本,其中我从外部 hashcorp 保险库传递密码。问题是当我运行 playbook 时,密码以纯文本形式显示在 ansible 提供的输出中。
我希望日志可见,所以我不喜欢 no_logs 作为解决方案
例子
changed: [Server IP] => {
"changed": true,
"cmd": "config.cmd --windowsLogonPassword **Password is passed here but displayed in plain text** ,
"delta": "0:00:06.218698",
"end": "2021-07-16 05:32:07.845560"...
有没有办法直接在剧本中加密密码,所以这个输出上不会显示纯文本?
解决方案
放
no_log: true
在任务或整个剧本上。这会抑制在编写剧本时对调试有用的信息,但应该在需要 IMO 的生产剧本上。
推荐阅读
- azure - 如何使 azure external.metrics.k8s 适配器工作?
- reactjs - 不清楚 React Pixi 的“withPixiApp”的含义/用法
- laravel - laravel 6.0 belongsTo 与 ApplicationService
- django - django中的多数据库实现
- c++ - 不能在 Catch 测试中使用重载比较运算符
- python - 使用 Python 在 Windows 中运行 linux 可执行文件
- apache-spark - 在 spark 中读取多个 csv 文件时跳过多行标题
- jenkins - Kubernetes部署后如何访问应用程序
- firebase - Cloud Firebase 分析在 Xamarin.iOS 中不起作用?
- json-ld - Json-ld 未按预期转换为 RDF