[英]ansible remote server name (jenkins slave node) in the ansible host file
Please make sure you have mapped the local DNS if you are trying to ping using hostname. 如果尝试使用主机名ping通,请确保已映射本地DNS。 Or else try Ip. 否则尝试叶问。 Also you should make the password-less authentication for this. 您还应该为此进行无密码身份验证。 Use ssh-keygen and copy the pub key to the remote server in authorized hosts file. 使用ssh-keygen并将发布密钥复制到授权主机文件中的远程服务器。
The remote host you are trying to reach needs to be defined in your ansible inventory file, usually named hosts
: 您需要访问的远程主机需要在您的清单文件中定义,通常命名为hosts
:
agent007 ansible_ssh_host=<ip addr>
Then you can explicitly use this inventory file with the -i
option 然后,可以通过-i
选项显式使用此清单文件
ansible-playbook -i hosts firstplaybook.yml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.