ansible 普通用户执行root权限 su,ansibleroot


[root@web-10 ~]# ansible  -i /etc/ansible/hosts rt01 -s -m shell -a "netstat -tunpl"


加-s


hosts配置文件添加ansible_su_pass

10.0.0.177 ansible_ssh_pass=xxxxx   ansible_su_pass=xxxx

相关内容

    暂无相关文章