你可以这样做:
ansible all -i "<hostname-or-ip>," -a 'uptime'
请注意,在IP地址的末尾,或者它将被视为主机库存文件名.
以下是一个参考示例:
ansible all -i "192.168.33.100," -a 'uptime' 192.168.33.100 | SUCCESS | rc=0 >> 12:05:10 up 10 min,1 user,load average: 0.46,0.23,0.08