aboutsummaryrefslogtreecommitdiff
path: root/scripts/os
diff options
context:
space:
mode:
authorCullum Smith <cullum@sacredheartsc.com>2024-10-22 22:01:49 -0400
committerCullum Smith <cullum@sacredheartsc.com>2024-10-22 22:01:49 -0400
commitf9301e0fe52313581920026a186955c78fcbe831 (patch)
tree9a9d8ea8df1bbf2e5d1253d2398ad469acd96b12 /scripts/os
parent39358af4e65a0bcd193797ac5003b0adc9b4225b (diff)
downloadinfrastructure-f9301e0fe52313581920026a186955c78fcbe831.tar.gz
zfs autosnapshots, syncthing, pam cleanup
Diffstat (limited to 'scripts/os')
-rw-r--r--scripts/os/80-zfs1
-rw-r--r--scripts/os/freebsd/20-zfs2
-rw-r--r--scripts/os/freebsd/50-idm17
-rw-r--r--scripts/os/freebsd/90-snapshots10
4 files changed, 27 insertions, 3 deletions
diff --git a/scripts/os/80-zfs b/scripts/os/80-zfs
new file mode 100644
index 0000000..1a24852
--- /dev/null
+++ b/scripts/os/80-zfs
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/scripts/os/freebsd/20-zfs b/scripts/os/freebsd/20-zfs
index 1cdc465..5d86df4 100644
--- a/scripts/os/freebsd/20-zfs
+++ b/scripts/os/freebsd/20-zfs
@@ -7,5 +7,5 @@ create_dataset -o mountpoint=none "$state_dataset"
# If this is baremetal host or a VM, trim the zpools periodically.
if [ "$BOXCONF_VIRTUALIZATION_TYPE" != jail ]; then
- install_file -m 0644 /etc/cron.d/zfs-trim
+ install_file -m 0644 /etc/cron.d/zfs
fi
diff --git a/scripts/os/freebsd/50-idm b/scripts/os/freebsd/50-idm
index ab7c2fd..1585c6f 100644
--- a/scripts/os/freebsd/50-idm
+++ b/scripts/os/freebsd/50-idm
@@ -15,14 +15,20 @@ pkg install -y \
pam_krb5 \
perl5 \
p5-perl-ldap \
- p5-Authen-SASL
+ p5-Authen-SASL \
+ pam_mkhomedir
# Configure PAM/NSS integration.
install_file -m 0644 \
/etc/nsswitch.conf \
+ /etc/pam.d/system \
/etc/pam.d/login \
/etc/pam.d/sshd \
- /etc/pam.d/sudo
+ /etc/pam.d/sudo \
+ /etc/pam.d/su \
+ /etc/pam.d/other
+
+install_template -m 0644 /etc/login.access
install_template -m 0644 \
/etc/krb5.conf \
@@ -30,6 +36,13 @@ install_template -m 0644 \
/usr/local/etc/openldap/ldap.conf \
/usr/local/etc/nslcd.conf
+# Ensure /home exists and configure skel files.
+install_directory -m 0755 /home
+install_file -m 0644 \
+ /usr/share/skel/dot.login \
+ /usr/share/skel/dot.profile \
+ /usr/share/skel/dot.shrc
+
# Create ldap.conf symlink.
ln -snfv /usr/local/etc/openldap/ldap.conf /usr/local/etc/ldap.conf
diff --git a/scripts/os/freebsd/90-snapshots b/scripts/os/freebsd/90-snapshots
new file mode 100644
index 0000000..fce9c34
--- /dev/null
+++ b/scripts/os/freebsd/90-snapshots
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Don't run autosnapshot within jails. Otherwise we will create duplicate
+# snapshots with the host system.
+if [ "$BOXCONF_VIRTUALIZATION_TYPE" = jail ]; then
+ return 0
+fi
+
+pkg install -y zfstools
+install_file -m 0644 /etc/cron.d/zfs-autosnapshot