summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-09-28 04:15:43 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-09-28 04:15:43 +0200
commit346774d3d5e4cf47aa044efb10673a6845978315 (patch)
treec67f82f433f05323d4924c52fa5ad90ee19592c4
parentFix systemd command. (diff)
downloadprofiles-346774d3d5e4cf47aa044efb10673a6845978315.tar.gz
profiles-346774d3d5e4cf47aa044efb10673a6845978315.tar.xz
Add group profiles.
-rw-r--r--manifests/group_profile.pp16
-rw-r--r--manifests/workstation.pp2
2 files changed, 18 insertions, 0 deletions
diff --git a/manifests/group_profile.pp b/manifests/group_profile.pp
new file mode 100644
index 0000000..2025a4b
--- /dev/null
+++ b/manifests/group_profile.pp
@@ -0,0 +1,16 @@
+class profiles::group_profile {
+ file { '/etc/profile.d/group-env.sh':
+ ensure => 'file',
+ content => @(EOF)
+ for group in $(groups $(id -nu))
+ do
+ f="/etc/profile.d/group.d/${group}"
+ test -f "$f" && . $f
+ done
+ | EOF
+ }
+
+ file { '/etc/profile.d/group.d':
+ ensure => 'directory',
+ }
+}
diff --git a/manifests/workstation.pp b/manifests/workstation.pp
index f276957..724a1b5 100644
--- a/manifests/workstation.pp
+++ b/manifests/workstation.pp
@@ -1,4 +1,6 @@
class profiles::workstation {
$os = $facts['os']['name'].downcase()
include "::profiles::workstation::${os}"
+
+ include ::profiles::group_profile
}