# This class manages the installation and configuration of Puppet 7 # # Parameters: # - $managed_repos: An array of additional repositories to manage (optional) # - $mirror: The base URL of the repository mirror # - $repo: The repository name # - $release: The release name # # Dependencies: # - Puppet facts: The class relies on certain facts about the target system, # including the OS release, architecture, and distribution codename. # # Description: # This class installs Puppet 7 on the target system by managing the repository # configuration and installing the appropriate package. It also supports the # management of additional repositories specified in the $managed_repos parameter. # The class retrieves necessary information from Puppet facts, such as the OS # release version, architecture, and distribution codename. It downloads the # Puppet release deb file from the specified mirror and installs it using dpkg. # Additionally, it configures the main Puppet repository using the apt::source resource. # # Example usage: # class { 'profiles::apt::puppet7': # managed_repos => ['extra-repo'], # mirror => 'http://mirror.example.com', # release => 'puppet7', # repo => 'bullseye', # } class profiles::apt::puppet7 ( Array[String] $managed_repos, String $mirror, String $repo, ) { $codename = $facts['os']['distro']['codename'] if 'puppet7' in $managed_repos { # deb http://apt.puppet.com bullseye puppet7 apt::source { 'puppet7': location => $mirror, repos => $repo, release => $codename, include => { 'src' => false, 'deb' => true, }, } } }