aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp1
-rw-r--r--manifests/personal.pp42
-rw-r--r--manifests/subsystems/media.pp42
3 files changed, 45 insertions, 40 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 3499bfc..cbc16af 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -91,6 +91,7 @@ import "subsystems/hosts.pp"
import "subsystems/locales.pp"
import "subsystems/onion.pp"
import "subsystems/tunnel.pp"
+import "subsystems/media.pp"
import "subsystems/monkeysphere.pp"
import "subsystems/keyboard.pp"
import "subsystems/profile.pp"
diff --git a/manifests/personal.pp b/manifests/personal.pp
index 8a7cbe2..7ab1662 100644
--- a/manifests/personal.pp
+++ b/manifests/personal.pp
@@ -20,46 +20,8 @@ class nodo::personal {
use_nagios => hiera('nodo::personal::use_nagios', false),
}
- # Removable media folder
- file { [ "/media/usb", "/media/cdrom", "/media/tablet", "/media/phone" ]:
- ensure => directory,
- mode => 0755,
- }
-
- # Mountpoint for encrypted home folders
- file { [ '/mnt/crypt/', '/mnt/crypt/home' ]:
- ensure => directory,
- }
-
- # Media cache
- file { "/var/cache/media":
- ensure => directory,
- mode => 0755,
- }
-
- # Data folder is a cache
- file { "/var/data":
- ensure => "/var/cache/media",
- }
-
- # Misc user data
- file { [ "/var/data/code", "/var/data/crypt", "/var/data/crypt/home", "/var/data/load" ]:
- ensure => directory,
- mode => 0755,
- require => File['/var/cache/media'],
- }
-
- # Hostname cache for general use
- file { "/var/cache/${::hostname}":
- ensure => directory,
- mode => 0755,
- }
-
- # Link to the media cache, useful to have unique remotes
- # for git-annex in removable media
- file { "/var/cache/${::hostname}/media":
- ensure => "/var/cache/media",
- }
+ # Media folders
+ class { 'media::folders': }
# Development
file { [ "/var/cache/vagrant", "/var/cache/virtualbox" ]:
diff --git a/manifests/subsystems/media.pp b/manifests/subsystems/media.pp
new file mode 100644
index 0000000..4b78f07
--- /dev/null
+++ b/manifests/subsystems/media.pp
@@ -0,0 +1,42 @@
+class media::folders {
+ # Removable media folder
+ file { [ "/media/usb", "/media/cdrom", "/media/tablet", "/media/phone" ]:
+ ensure => directory,
+ mode => 0755,
+ }
+
+ # Mountpoint for encrypted home folders
+ file { [ '/mnt/crypt/', '/mnt/crypt/home' ]:
+ ensure => directory,
+ }
+
+ # Media cache
+ file { "/var/cache/media":
+ ensure => directory,
+ mode => 0755,
+ }
+
+ # Data folder is a cache
+ file { "/var/data":
+ ensure => "/var/cache/media",
+ }
+
+ # Misc user data
+ file { [ "/var/data/code", "/var/data/crypt", "/var/data/crypt/home", "/var/data/load" ]:
+ ensure => directory,
+ mode => 0755,
+ require => File['/var/cache/media'],
+ }
+
+ # Hostname cache for general use
+ file { "/var/cache/${::hostname}":
+ ensure => directory,
+ mode => 0755,
+ }
+
+ # Link to the media cache, useful to have unique remotes
+ # for git-annex in removable media
+ file { "/var/cache/${::hostname}/media":
+ ensure => "/var/cache/media",
+ }
+}