su root
2019-05-06 17:37 divl 阅读(342) 评论(0) 编辑 收藏 举报1. 命令行方式
ansible zabbix_agents --become --become-method=su -K -m shell -a 'whoami'
2. 变量方式
[zabbix_agents] 192.168.1.[61:64] [zabbix_agents:vars] ansible_user=ansible #ansible_become=yes #ansible_become_method=su ##ansible_become_pass=123456