Puppet agent errors running manifest

Foreman 2.1 on CentOS 7 with puppet 5:

[root@foreman2 ~]# rpm -qa|grep puppet
puppetserver-5.3.14-1.el7.noarch
puppet-agent-oauth-0.5.1-3.el7.noarch
puppet5-release-5.0.0-11.el7.noarch
puppet-agent-5.5.21-1.el7.x86_64
puppetlabs-release-22.0-2.noarch

I provisioned a brand new host running CentOS 7.8. In the provisioning I also added some simple puppet modules. The host provisions fine but the puppet modules never get on the host. On this host when I run:

puppet agent --onetime --no-daemonize

I get lots of the following errors:

Sep 1 18:17:08 p62 puppet-agent[15071]: Could not set ‘file’ on ensure: incorrect header check
Sep 1 18:17:08 p62 puppet-agent[15071]: Could not set ‘file’ on ensure: incorrect header check
Sep 1 18:17:08 p62 puppet-agent[15071]: Wrapped exception:
Sep 1 18:17:08 p62 puppet-agent[15071]: incorrect header check
Sep 1 18:17:08 p62 puppet-agent[15071]: (/File[/var/lib/puppet/lib/puppet/parser/functions/slice_array.rb]/ensure) change from absent to file failed: Could not set ‘file’ on ensure: incorrect header check

I provisioned a second host also running CentOS 7.8. Same puppet issues. However, this time I followed the following page: https://cstan.io/?p=11478&lang=en and upgrade puppet on the second host and connected it back to the puppet master on Foreman.

On this second host I can now run puppet agent --onetime --no-daemonize and I get no errors in the logs.

So this begs the question how can I upgrade puppet during its provisioning stage. Unless the best way is to use the post install phase of the kickstart to upgrade puppet.