ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402574 )

Change subject: restructure the snapshot dumps data directory setup
......................................................................

restructure the snapshot dumps data directory setup

Account for nfs mounts, labs lvm setups, or local partitions.
Toss the attempted labs data lvm profile created earlier today,
now there's labs specific code in a common profile (eww) but
that's the breaks.

Change-Id: I02cb6353edc49b2bd4cd0e21d36c9a2e1c309456
---
M hieradata/common.yaml
M modules/profile/manifests/dumps/generation/worker/common.pp
D modules/profile/manifests/dumps/generation/worker/labs_localdisk.pp
A modules/snapshot/manifests/dumps/datamount.pp
D modules/snapshot/manifests/dumps/nfsmount.pp
5 files changed, 47 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/74/402574/1

diff --git a/hieradata/common.yaml b/hieradata/common.yaml
index 71a9a87..24678c8 100644
--- a/hieradata/common.yaml
+++ b/hieradata/common.yaml
@@ -350,6 +350,7 @@
     external:
       - odysseus.ip6.fi.muni.cz
       - poincare.acc.umu.se
+dumps_datadir_mount_type: nfs
 dumps_nfs_server: dumpsdata1001.eqiad.wmnet
 dumps_managed_subdirs: []
 
diff --git a/modules/profile/manifests/dumps/generation/worker/common.pp 
b/modules/profile/manifests/dumps/generation/worker/common.pp
index b1d9150..ac5e011 100644
--- a/modules/profile/manifests/dumps/generation/worker/common.pp
+++ b/modules/profile/manifests/dumps/generation/worker/common.pp
@@ -1,6 +1,7 @@
 class profile::dumps::generation::worker::common(
     $nfs_server = hiera('dumps_nfs_server'),
     $managed_subdirs = hiera('dumps_managed_subdirs'),
+    $datadir_mount_type = hiera('dumps_datadir_mount_type'),
     $php = hiera('snapshot::dumps::php'),
 ) {
     # mw packages and dependencies
@@ -12,13 +13,15 @@
 
     class { '::dumpsuser': }
 
-    snapshot::dumps::nfsmount { 'dumpsdatamount':
+    snapshot::dumps::datamount { 'dumpsdatamount':
         mountpoint      => $xmldumpsmount,
+        mount_type      => $datadir_mount_type,
         server          => $nfs_server,
         managed_subdirs => $managed_subdirs,
         user            => 'dumpsgen',
         group           => 'dumpsgen',
     }
+
     # dataset server config files,
     # stages files, dblists, html templates
     class { '::snapshot::dumps::dirs':
diff --git 
a/modules/profile/manifests/dumps/generation/worker/labs_localdisk.pp 
b/modules/profile/manifests/dumps/generation/worker/labs_localdisk.pp
deleted file mode 100644
index 447fb65..0000000
--- a/modules/profile/manifests/dumps/generation/worker/labs_localdisk.pp
+++ /dev/null
@@ -1,10 +0,0 @@
-# Provide space for writing dumps to local filesystem
-#
-# filtertags: labs-common
-class profile::dumps::generation::worker::labs_localdisk {
-    $xmldumpsmount = '/mnt/dumpsdata'
-
-    labs_lvm::volume { 'data-local-disk':
-        mountat => $xmldumpsmount,
-    }
-}
diff --git a/modules/snapshot/manifests/dumps/datamount.pp 
b/modules/snapshot/manifests/dumps/datamount.pp
new file mode 100644
index 0000000..374bf6e
--- /dev/null
+++ b/modules/snapshot/manifests/dumps/datamount.pp
@@ -0,0 +1,42 @@
+define snapshot::dumps::datamount(
+    $mountpoint = undef,
+    $mount_type = undef,
+    $server = undef,
+    $managed_subdirs = [],
+    $user = undef,
+    $group = undef,
+) {
+    if ($mount_type == 'local' or $mount_type == 'nfs') {
+        file { [ $mountpoint ]:
+            ensure => 'directory',
+        }
+    }
+    elsif ($mount_type == 'labslvm') {
+        labs_lvm::volume { 'data-local-disk':
+            mountat => $mountpoint,
+        }
+    }
+
+    if ($mount_type == 'nfs') {
+        require_package('nfs-common')
+
+        mount { $mountpoint:
+            ensure   => 'mounted',
+            device   => "${server}:/data",
+            fstype   => 'nfs',
+            name     => $mountpoint,
+            options  => 'bg,hard,tcp,rsize=8192,wsize=8192,intr,nfsvers=3',
+            require  => File[$mountpoint],
+            remounts => false,
+        }
+    }
+
+    if (defined($managed_subdirs) and $managed_subdirs) {
+        file { $managed_subdirs:
+            ensure => 'directory',
+            mode   => '0755',
+            owner  => $user,
+            group  => $group,
+        }
+    }
+}
diff --git a/modules/snapshot/manifests/dumps/nfsmount.pp 
b/modules/snapshot/manifests/dumps/nfsmount.pp
deleted file mode 100644
index 86c7f21..0000000
--- a/modules/snapshot/manifests/dumps/nfsmount.pp
+++ /dev/null
@@ -1,35 +0,0 @@
-define snapshot::dumps::nfsmount(
-    $mountpoint = undef,
-    $server = undef,
-    $managed_subdirs = [],
-    $user = undef,
-    $group = undef,
-) {
-    require_package('nfs-common')
-
-    file { [ $mountpoint ]:
-        ensure => 'directory',
-    }
-
-    if (defined('$server') and $server != '') {
-        mount { $mountpoint:
-            ensure   => 'mounted',
-            device   => "${server}:/data",
-            fstype   => 'nfs',
-            name     => $mountpoint,
-            options  => 'bg,hard,tcp,rsize=8192,wsize=8192,intr,nfsvers=3',
-            require  => File[$mountpoint],
-            remounts => false,
-        }
-    }
-    else {
-        # manage some directories that the nfs server
-        # server would otherwise take care of for us
-        file { $managed_subdirs:
-            ensure => 'directory',
-            mode   => '0755',
-            owner  => $user,
-            group  => $group,
-        }
-    }
-}

-- 
To view, visit https://gerrit.wikimedia.org/r/402574
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02cb6353edc49b2bd4cd0e21d36c9a2e1c309456
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: ArielGlenn <ar...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to