ansible-inventory - 一个密码失败时的ansible库存尝试不同
问题描述
我还没有找到解决方案,我们有 100 台服务器,我不知道正确的密码。我有 3 个密码,但只有一个是正确的。如果无法登录,我怎么能说 ansible 然后尝试另一个密码?
inventory.yaml 文件,这不起作用。
all:
#hosts:
#192.168.100.102:
children:
my_servers:
hosts:
192.168.100.101:
ansible_password : "{{ item }}"
with_items:
- psw1
- psw2
- psw3
192.168.100.102:
...
ansible -i inventory.yaml my_servers -a "free -h" -u test
192.168.100.101 | 失败 | rc=-1 >> 字段“密码”的值无效,其中包括未定义的变量。错误是:“项目”未定义
解决方案
推荐阅读
- php - PHP中有2个相同的代码,一个是错误的
- profiling - 如何分析 LINQPad 查询?
- java - 如何在圆形语音气泡内制作带有照片的谷歌地图标记?
- r - 从函数返回 ggplot 对象
- r - 使用 fwrite r 打印时禁用指数表示法
- r - 嵌套 gapply()、dapply 或 spark_apply() 函数?
- animation - Javafx 碰撞检测 inTimeLine
- python - 如何访问存储在Python变量中的目录列表
- python - 基于 Mac 的小型 post house 希望运行 Windows 机器,但我们依赖于一些 Python 脚本
- python - 如何参数化测试函数:Pytest?