ansible 遠程以普通用戶執行命令
1. ansible 10.0.0.1 -m raw -a "date" -u www
2.在ansible的主機配置文件中指定ssh_user
vi/etc/ansible/hosts
10.0.0.1 ansible_ssh_user=www
用一個例子來演示會更加清晰
ansible test-hosts -m file -a "path=/root/fstab owner=root group=root mode=600"