Foreman 1.23.0 installs puppet agent 3.6?

I believe that code will only activate if you set enable-puppetlabs-repo enable-puppetlabs-puppet6-repo or enable-puppetlabs-puppet5-repo to true, which you would normally do at a OS or Hostgroup level.

Otherwise, the code will skip the snippet ‘puppetlabs_repo’ section and proceed onto snippet ‘puppet_setup’.

Note that I had a similar issue with Ubuntu, which led to some downstream errors that were hard to figure out. See: Foreman vs. puppetlabs::puppet_agent: `he puppet_agent module does not support pre-Puppet 4 upgrades`