I have a cron job the is run by the user called "taskmanager" every day and I need to reset a configuration every time.
the user taskmanager has NOPASSWD on /etc/sudoer
I also have a private repository where I made an RPM of my configuration. Whenever I ran the bash script manually the yum -y works flawlessly, however when the script is ran by cron the exit code is 1, manual execution's exit code returns 0.
/usr/bin/sudo /usr/bin/yum -y reinstall --disablerepo="*" --enablerepo=codevault project-configuration
echo $?