I am doing a fresh install of Ubuntu 18.04 via automated methods which runs a script under the
ubuntu user programmatically. However when the script tries to run sudo it prompts for the users password. I know I can prevent prompting for the ubuntu password on sudo by doing:
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers > /dev/null
However, this fails as I need sudo without password to update
How can I accomplish this? I know on Amazon EC2 the Ubuntu AMI uses cloudinit to automatically enable passwordless sudo. It seems like cloudinit is running, how can I configure it to mirror what Amazon EC2 Ubuntu AMI does?