
上QQ阅读APP看书,第一时间看更新
Need to specify different ssh logon user
Sometimes you may need to ssh to target machines using a different logon user. In this case, you can append the ansible_user parameter to an inpidual host in hosts.ini. For example:
- Use the username kirito to ssh to my-master-1
- Use the username asuna to ssh to my-node-1
In this case, change hosts.ini, as shown in the following code:
my-master-1 ansible_ssh_host=10.128.0.2 ansible_user=kirito
my-node-1 ansible_ssh_host=10.128.0.4 ansible_user=asuna