Use puppet to install latest version of ssh server

I am using foreman to manage my puppet server.
I have the ssh module installed and it is managing the server config just fine.
I also need it to upgrade the current version to the latest version, how can I do that?
Puppet has an “ensure => latest” option but I don’t know how to tell foreman how to use it.

I am running foreman 1.14.3

How can I make it upgrade services on the managed nodes?

For puppet to update the ssh-server (let’s assume its redhat), just specify a package ressource:

class managed_hosts {
  package { "openssh-server":
    ensure => latest,

You import the class to foreman.
You then are free to put this class in any host known to foreman.