Adding sudo to yum update script [on hold]

I’m pretty new to Linux and I got a question.

I want to run a yum update script through Puppet Bolt, This script needs to run as root on the server I remotely want to update through Puppet Bolt. I have seen some answers on the internet but I need a way to have the script fill in the password after running sudo yum -y update.

#!/bin/sh /usr/bin/yum -y update 

It’s a very simple script, this might sound nooby but you gotta start somewhere.

Thanks for reading.