- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
最近,我在现有项目中创建了名为 spd 的新角色。而其他脚本在设置中运行良好。这个新创建的失败。请指出这里出了什么问题
ansible/roles
spd
tasks
templates
defaults
部署-spd.yml
- hosts:
roles:
- spd
库存文件
[kube-master]
kubernetes-master-1 ansible_host=10.20.0.225 ansible_user=centos ansible_become=true
kubernetes-master-2 ansible_host=10.20.0.226 ansible_user=centos ansible_become=true
kubernetes-master-3 ansible_host=10.20.0.227 ansible_user=centos ansible_become=true
故障
bash-4.3# ansible-playbook -i inventory/inventory deploy-test-ms.yml --ask-vault-pass
Vault password:
PLAY [kube-master] *************************************************************
TASK [setup] *******************************************************************
Thursday 16 March 2017 13:32:05 +0000 (0:00:00.026) 0:00:00.026 ********
fatal: [kubernetes-master-1]: FAILED! => {"failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}
fatal: [kubernetes-master-2]: FAILED! => {"failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}
fatal: [kubernetes-master-3]: FAILED! => {"failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program"}
PLAY RECAP *********************************************************************
kubernetes-master-1 : ok=0 changed=0 unreachable=0 failed=1
kubernetes-master-2 : ok=0 changed=0 unreachable=0 failed=1
kubernetes-master-3 : ok=0 changed=0 unreachable=0 failed=1
更新:
**With failed script**
Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
<10.20.0.227> ESTABLISH SSH CONNECTION FOR USER: centos
Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
<172.23.169.137> ESTABLISH SSH CONNECTION FOR USER: centos
<10.20.0.225> ESTABLISH SSH CONNECTION FOR USER: centos
<10.20.0.226> ESTABLISH SSH CONNECTION FOR USER: centos
**With successfull script**
Thursday 16 March 2017 14:03:49 +0000 (0:00:00.066) 0:00:00.066 ********
Using module file /usr/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
<10.20.0.237> ESTABLISH SSH CONNECTION FOR USER: centos
<10.20.0.237> SSH: EXEC ssh -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=30m -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=centos -o ConnectTimeout=30 -o 'ControlPath=~/.ssh/ansible-%r@%h:%p' 10.20.0.237 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1489673029.48-15997231643297
4 `" && echo ansible-tmp-1489673029.48-159972316432974="` echo $HOME/.ansible/tmp/ansible-tmp-1489673029.48-159972316432974 `" ) && sleep 0'"'"''
<10.20.0.237> PUT /tmp/tmpnHJPbc TO /home/centos/.ansible/tmp/ansible-tmp-1489673029.48-159972316432974/setup.py
<10.20.0.237> SSH: EXEC scp -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=30m -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=centos -o ConnectTimeout=30 -o 'ControlPath=~/.ssh/ansible-%r@%h:%p' /tmp/tmpnHJPbc '[10.20.0.237]:/home/centos/.ansible/tmp/ansible-tmp-1489673029.48-159972316432974/setup.py'
<10.20.0.237> ESTABLISH SSH CONNECTION FOR USER: centos
<10.20.0.237> SSH: EXEC ssh -F ./ssh.cfg -o ControlMaster=auto -o ControlPersist=30m -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=centos -o ConnectTimeout=30 -o 'ControlPath=~/.ssh/ansible-%r@%h:%p' 10.20.0.237 '/bin/sh -c '"'"'chmod u+x /home/centos/.ansible/tmp/ansible-tmp-1489673029.48-159972316432974/ /home/cento
s/.ansible/tmp/ansible-tmp-1489673029.48-159972316432974/setup.py && sleep 0'"'"''
最佳答案
是主机需要sshpass
程序安装。对于16.04这样的Ubuntu机器,就很简单apt-get install sshpass
.再次,此错误消息:
ERROR! to use the 'ssh' connection type with passwords, you must install the sshpass program
sshpass
在供应商上。
关于Ansible:要使用带密码的 'ssh' 连接类型,您必须安装 sshpass 程序”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42835626/
我正在尝试在 java 中执行一个简单的 sshpass 命令: String command = "sshpass -p password ssh user@host 'echo test' ";
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
有没有办法在使用 sshpass 命令时尝试多个密码?我有一个名为 hosts.txt 的 txt 文件,其中列出了多个系统的 IP 地址,每个系统都使用不同的密码(例如 - 'mypasswd'、'
我在 ubuntu 11.04 上使用 sshpass 以非交互方式传递密码。 当我使用 sshpass 和 scp 时 sshpass -p '123' scp sayuj@192.168.1.51
我正在尝试自动执行从一台服务器到另一台服务器的文件传输或 FTP。 #!/bin/bash ### In this model, the same filename is processed on e
语境 我有一个应用程序,我在其中使用单元测试,我需要持续交付它。我选择使用github + travis + docker。 我的 Docker 容器是一个带有 openSSL 的 Ubuntu 12
我想在不输入密码的情况下使用 bash 脚本列出远程机器上的文件。 我正在使用以下命令来做到这一点 sshpass -p password ssh user@ubuntusite.net "ls /
我有一个 Python 脚本,它使用 sshpass 对机器进行 ssh 访问 Popen(["sshpass","-p", "test!@#", "ssh", "-o UserKnownHostsF
我正在尝试创建一个登录到另一台服务器并检查一些不同文件夹的磁盘使用情况的脚本 (test.sh): 测试.sh: DIRS="dir_A dir_B dir_C" for DIR in $DIRS d
我有一个包含以下函数的 python 脚本: def upload2server(file): host_name = 'example.ex.am.com' port_num = '
我有一个包含以下行的脚本 sshpass -p 'password' ssh user@server "touch /tmp/test" 这在我运行脚本时有效,但如果我将脚本放入 cron 中,它就不
我是 Linux-SA 服务器自动化工具环境的新手。我正尝试按如下方式验证 sshpass: 在 linux 环境中,我在终端中使用以下代码并正确获取文件列表: sshpass -p Password
ssh 远程网关 sshpass -p gatewaypwd -t user@gateway sshpass -p targetpwd ssh user2@target这是 origin 命令,我把它
我是 bash 的新手,目前正在编写脚本。我正在使用两台远程机器并通过 sshpass 访问它们(我知道硬编码密码不好,但我应该这样做)。因此,如果我想将内容从本地计算机复制到远程计算机,我会这样做:
Closed. This question is not reproducible or was caused by typos。它当前不接受答案。 想改善这个问题吗?更新问题,以便将其作为on-to
我想从我的 Mac 自动进行 ssh 登录。 它确实有一个简单的解决方案: sshpass -p my_password ssh m_username@hostname 但我的问题是在我的 Mac 上
在我们的环境中,我们有几台服务器在生产中。每次我想搜索某些东西时,它可能在 4 个不同的服务器中的 1 个中。 我正在创建一个脚本来自动执行此搜索,以便我直接知道涉及哪个服务器。 我正在通过 jump
我有一个 bash 脚本需要在远程机器上启动一些进程。我已经使用 sshpass 做到了这一点命令。 我需要存储那个远程进程的 PID。 我用脚本尝试了以下操作: sshpass -p passwor
好吧,这可能听起来很荒谬,但是如何删除 sshpass 包??? 我安装的方式是这样的: $ tar -zxvf sshpass-1.05.tar.gz $ cd ./sshpass-1.05 $ .
我想从我的 Windows 运行 sshpass 命令到远程 Linux 服务器。我使用这个命令: sshpass -p 'password' ssh ldap.nextstep4it.com -l
我是一名优秀的程序员,十分优秀!