aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-03-29 20:36:31 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-03-29 20:36:31 -0300
commit20969de4049a02a9a05c26985ba8cdfd4e78e20a (patch)
tree1034c6fad7fcf16534711560ac6d6f23f7a1b618
parent6a1332a1b08cddeb791d1210f119ac8d26dd593d (diff)
downloadpuppet-nodo-20969de4049a02a9a05c26985ba8cdfd4e78e20a.tar.gz
puppet-nodo-20969de4049a02a9a05c26985ba8cdfd4e78e20a.tar.bz2
Adding media::folders class
-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",
+ }
+}