Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh 有没有办法将Ansible与密码列表一起使用?_Ssh_Ansible - Fatal编程技术网

Ssh 有没有办法将Ansible与密码列表一起使用?

Ssh 有没有办法将Ansible与密码列表一起使用?,ssh,ansible,Ssh,Ansible,我使用Ansible与密码不同的100-200台计算机进行交互(我有列表) 我希望: password_list='["1234","5678"]' Ansible-> try to connect to IP_Adresse1 with password 1 if fail: Ansible-> try to connect to IP_Adresse1 with password 2 if not fail: Do some stuff to the con

我使用Ansible与密码不同的100-200台计算机进行交互(我有列表)

我希望:

password_list='["1234","5678"]'

Ansible-> try to connect to IP_Adresse1 with password 1

if fail:

   Ansible-> try to connect to IP_Adresse1 with password 2

if not fail:

   Do some stuff to the connected host...

我想知道这是否可能?

不要认为你所描述的是可能的。您可以在清单文件中提供每个主机的密码好的,谢谢您的回答,我将尝试从脚本启动此playbook并处理错误您为什么要重新发明轮子,何时可以为您处理所有这些?具体请参见,例如,
ansible\u密码
。如果需要的话,你可以用它来保护那些VAR。