summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-18 23:39:19 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-20 02:18:10 +0200
commitee95fbc60809ecd1f615c6c109ce9bf860160bfb (patch)
tree690ffc143d20d155a039858230ab8797627beace
parent/usr/local/lib in ld.so.conf unneeded on FreeBSD. (diff)
downloadprofiles-ee95fbc60809ecd1f615c6c109ce9bf860160bfb.tar.gz
profiles-ee95fbc60809ecd1f615c6c109ce9bf860160bfb.tar.xz
Freebsd work.
-rw-r--r--manifests/common.pp48
-rw-r--r--manifests/common/kernel_freebsd.pp3
-rw-r--r--manifests/common/kernel_linux.pp37
3 files changed, 48 insertions, 40 deletions
diff --git a/manifests/common.pp b/manifests/common.pp
index 7d9fa61..94538a6 100644
--- a/manifests/common.pp
+++ b/manifests/common.pp
@@ -9,14 +9,15 @@ class profiles::common (
include "profiles::common::${os_fam}"
}
- file { '/etc/hostname':
- content => "${::hostname}\n",
+ $kernel = $facts['kernel'].downcase()
+ if defined("profiles::common::kernel_${kernel}") {
+ include "profiles::common::kernel_${kernel}"
}
file_line { 'hosts ourself':
ensure => present,
- line => "::1\t${::fqdn}\t${::hostname}",
- match => $::fqdn,
+ line => "::1\t${facts['fqdn']}\t${facts['hostname']}",
+ match => $facts['fqdn'],
path => '/etc/hosts',
}
@@ -31,32 +32,15 @@ class profiles::common (
})
}
- # TODO possibly check in /usr/share/i18n/locales if file exists
- # there
-
- $fixed_locales = ($locales.map |$locale| {
- if $locale =~ /^[^.]*\.(.*)$/ {
- "${locale} ${1}"
- } else {
- "${locale} UTF-8"
- }
- } + [ '' ])
-
- # TODO figure out proper test here
- unless $facts['operatingsystem'] == 'FreeBSD' {
- file { '/etc/locale.gen':
- content => $fixed_locales.join("\n")
- } ~> exec { 'locale-gen':
- path => [ '/bin', '/usr/bin', '/usr/sbin', ],
- refreshonly => true,
- }
- }
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
}
@@ -76,20 +60,4 @@ class profiles::common (
])
ensure_packages(['nano'], { ensure => absent })
-
- unless $facts['operatingsystem'] == 'FreeBSD' {
- file { '/etc/ld.so.conf.d/usr-local.conf':
- content => "/usr/local/lib\n",
- }
- }
-
- unless $facts['operatingsystem'] == 'FreeBSD' {
- # If a btrfs filesystem is detected, install userspace utilities.
- if $facts['filesystems'] and $facts['filesystems'] =~ 'btrfs' {
- ensure_packages([
- # Package name checked for Archlinux
- 'btrfs-progs',
- ])
- }
- }
}
diff --git a/manifests/common/kernel_freebsd.pp b/manifests/common/kernel_freebsd.pp
new file mode 100644
index 0000000..9fbc3b5
--- /dev/null
+++ b/manifests/common/kernel_freebsd.pp
@@ -0,0 +1,3 @@
+class profiles::common::kernel_freebsd (
+) {
+}
diff --git a/manifests/common/kernel_linux.pp b/manifests/common/kernel_linux.pp
new file mode 100644
index 0000000..388a38f
--- /dev/null
+++ b/manifests/common/kernel_linux.pp
@@ -0,0 +1,37 @@
+class profiles::common::kernel_linux (
+) {
+ file { '/etc/hostname':
+ content => "${::hostname}\n",
+ }
+
+ # TODO possibly check in /usr/share/i18n/locales if file exists
+ # there
+
+ $fixed_locales = ($profiles::common::locales.map |$locale| {
+ if $locale =~ /^[^.]*\.(.*)$/ {
+ "${locale} ${1}"
+ } else {
+ "${locale} UTF-8"
+ }
+ } + [ '' ])
+
+ file { '/etc/locale.gen':
+ content => $fixed_locales.join("\n")
+ } ~> exec { 'locale-gen':
+ path => [ '/bin', '/usr/bin', '/usr/sbin', ],
+ refreshonly => true,
+ }
+
+ file { '/etc/ld.so.conf.d/usr-local.conf':
+ content => "/usr/local/lib\n",
+ }
+
+
+ # If a btrfs filesystem is detected, install userspace utilities.
+ if $facts['filesystems'] and $facts['filesystems'] =~ 'btrfs' {
+ ensure_packages([
+ # Package name checked for Archlinux
+ 'btrfs-progs',
+ ])
+ }
+}