My issue with some of my virtual machines is that I don’t pay much attention to them as long as they are running. So they don’t get their updates regularly.
$ sudo yum -y install yum-cron
I will go on with the defaults. Activate it
$ sudo systemctl enable yum-cron.service
and start it.
$ sudo systemctl start yum-cron.service
Or use this simple playbook for ansible.