I'd like to remove a bit of duplication here (DRY).  Could you assign the template path to a variable and then use a single file { } definition?  e.g.

    $foreman_conf = $foreman::use_vhost ?
      false   => "foreman/foreman-apache.conf.erb",
      default => "foreman/foreman-vhost.conf.erb",
    }

Then use `template($foreman_conf)` in the file { } resource.