diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/cowsay.pp | 14 | ||||
-rw-r--r-- | manifests/environment.pp | 15 | ||||
-rw-r--r-- | manifests/workstation.pp | 18 |
3 files changed, 30 insertions, 17 deletions
diff --git a/manifests/cowsay.pp b/manifests/cowsay.pp new file mode 100644 index 0000000..5f995c5 --- /dev/null +++ b/manifests/cowsay.pp @@ -0,0 +1,14 @@ +class profiles::cowsay ( + Array[String] $cowpath = [ + '/usr/share/cows', + '/usr/local/share/cows', + ], +) { + ensure_packages(['cowsay']) + + # TODO see profiles::environment + concat::fragment { 'Cowsay paths': + target => '/etc/environment', + content => epp('profiles/keyvalue.epp', { values => { 'COWPATH' => $cowpath.join(':') }}), + } +} diff --git a/manifests/environment.pp b/manifests/environment.pp new file mode 100644 index 0000000..6759127 --- /dev/null +++ b/manifests/environment.pp @@ -0,0 +1,15 @@ +# Manage global environment variables. +# TODO this should be moved to its own module, and provide propper +# resource types. +class profiles::environment { + concat { '/etc/environment': + ensure => 'present', + } + + $user_environment = lookup('environment', undef, 'hash', {}) + concat::fragment { 'User environment': + target => '/etc/environment', + content => epp('profiles/keyvalue.epp', { values => $user_environment }), + } + +} diff --git a/manifests/workstation.pp b/manifests/workstation.pp index a121042..a60973f 100644 --- a/manifests/workstation.pp +++ b/manifests/workstation.pp @@ -44,23 +44,7 @@ class profiles::workstation ( }}), } - $cowpath = [ - '/usr/share/cows', - '/usr/local/share/cows', - ] - - # Merge everything from hiera, but provide defeaults for - # non-overwritten values. - $default_environment = { - 'COWPATH' => $cowpath.join(':'), - } - $user_environment = lookup('environment', undef, 'hash', {}) - $environment = $default_environment + $user_environment - - file { '/etc/environment': - content => epp('profiles/keyvalue.epp', { values => $environment }), - } - + include ::profiles::cowsay include ::profiles::sudo include ::profiles::mounts } |