ansible become与sudo
ansible sudo 即将变更为become
配置
[s21] #192.168.1.21 ansible_ssh_user=i ansible_ssh_pass=i 192.168.1.21 ansible_ssh_user=i ansible_ssh_private_key_file=/home/i/.ssh/id_rsa ansible_become=true ansible_become_user=root ansible_become_pass='i'
测试
命令运行用户root
ssh用户i
切换sudo为root