修改文件权限:
首先需要 vi /etc/ansible/hosts
- [Client]
- 192.168.2.151 ansible_ssh_user=root ansible_ssh_pass=hadoop ansible_su_pass=hadoop
然后如果没有 sshpass, 先安装 sshpass, 装好之后
ansible Client -S -R root -m file -a "dest=/home/hadoop/test.sh mode=777 owner=root group=root"
来源: http://www.bubuko.com/infodetail-2834138.html