sudo_user is the user you become, not the user executing sudo, remove
it and it will default to root or set sudo_user: root
I know this is confusing if you know about the sudo environment
variables that is why we deprecated this syntax in favor of
become_user: in newer versions.
--
Brian Coca
When I try to run the command:
- name: update apt-get
apt: update_cache=yes
I get:
msg: Failed to lock apt for exclusive operation
Even though my users are configured
---
- hosts: ec2
remote_user: ubuntu
sudo_user: ubuntu
sudo: yes
gather_facts: true
tasks:
and I can ssh into