# set the motd class profiles::base::motd ( String $enc_role = pick($facts['enc_role'], 'undefined'), String $enc_env = pick($facts['enc_env'], 'undefined'), String $fqdn = $facts['networking']['fqdn'], String $addr = $facts['networking']['ip'], String $nic = $facts['networking']['primary'], String $os_name = $facts['os']['name'], String $os_release = $facts['os']['release']['full'], ) { # Use the regsubst function to remove the 'roles::' prefix from the role name $clean_role = regsubst($enc_role, '^roles::', '') # Manage the content of the /etc/motd file file { '/etc/motd': ensure => file, content => template('profiles/base/motd/motd.erb'), } }