# Common settings which all hosts should have applied class profiles::common ( String $timezone = 'UTC', Array[String] $locales = [ 'en_US.UTF-8', ], ) { $os_fam = $facts['os']['family'].downcase() if defined("profiles::common::${os_fam}") { include "profiles::common::${os_fam}" } $kernel = $facts['kernel'].downcase() if defined("profiles::common::kernel_${kernel}") { include "profiles::common::kernel_${kernel}" } file_line { 'hosts ourself': ensure => present, line => "::1\t${facts['fqdn']}\t${facts['hostname']}", match => $facts['fqdn'], path => '/etc/hosts', } file { '/etc/localtime': ensure => link, target => "../usr/share/zoneinfo/${timezone}", } if $facts['os']['name'] == 'Debian' { ensure_packages (['locales'], { before => Exec['locale-gen'], }) } file { 'Default locales': path => '/etc/locale.conf', content => @(EOF) LANG=en_US.UTF-8 LC_TIME=sv_SE.UTF-8 LC_MEASURMENT=sv_SE.UTF-8 LC_PAPER=sv_SE.UTF-8 LC_TELEPHONE=sv_SE.UTF-8 | EOF } # Min priority, so it can still be overwritten file { '/etc/profile.d/00-terminal-name.sh': source => 'puppet:///modules/profiles/terminal-name.sh', } if $facts['virtual'] == 'systemd_nspawn' { include ::profiles::nspawned } ensure_packages([ 'tree', 'lsof', 'unzip', ]) ensure_packages(['nano'], { ensure => absent }) }