Dduvall has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/305737

Change subject: labs: Allow LVM mount permissions to remain unmanaged
......................................................................

labs: Allow LVM mount permissions to remain unmanaged

Although ownership and mode of the LVM mount point can be provided, the
file resource can conflict with those of other modules that must also
manage the mount-point directory ownership/mode, e.g. `mariadb::config`.
Providing a `$mountmanage` flag for whether to define the file resource
will allow for conflicts to be easily resolved.

It may be better long-run to remove management of ownership and
mode from labs_lvm::volume altogether, as this can be achieved more
flexibly with a `labs_lvm::volume -> file` pattern, but this change has
less overall impact.

Change-Id: Ifb888366755b47f9973163e7e59fbc4914b0be8b
---
M modules/labs_lvm/manifests/volume.pp
1 file changed, 37 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/305737/1

diff --git a/modules/labs_lvm/manifests/volume.pp 
b/modules/labs_lvm/manifests/volume.pp
index 6e9b593..97a3a54 100644
--- a/modules/labs_lvm/manifests/volume.pp
+++ b/modules/labs_lvm/manifests/volume.pp
@@ -4,20 +4,25 @@
 # created by the labs_lvm class.
 #
 # Parameters:
-#   volname  => arbitrary identifier used to construct the volume
-#               name, and the default mountpoint.  Needs to be
-#               unique in the instance.  Defaults to the resource
-#               title.
-#   mountat  => point where the volume is to be mounted
-#   size     => size of the volume, using the lvcreate(8) syntax.
-#               defaults to allocate all of the available space
-#               in the volume group.  Note that if you use the
-#               default value, any /other/ volumes must be created
-#               before that one and should be marked as dependencies.
-#   fstype   => filesystem type.  Defaults to ext4.
-#   mkfs_opt => options for the mkfs if the filesystem needs to
-#               be created.
-#   options  => mount options
+#   volname     => arbitrary identifier used to construct the volume
+#                  name, and the default mountpoint.  Needs to be
+#                  unique in the instance.  Defaults to the resource
+#                  title.
+#   mountat     => point where the volume is to be mounted
+#   mountmanage => whether to define a file resource to manage
+#                  ownership/mode of the mount point.
+#   mountowner  => mount point owner.
+#   mountgroup  => mount point group.
+#   mountmode   => mount point mode/permissions.
+#   size        => size of the volume, using the lvcreate(8) syntax.
+#                  defaults to allocate all of the available space
+#                  in the volume group.  Note that if you use the
+#                  default value, any /other/ volumes must be created
+#                  before that one and should be marked as dependencies.
+#   fstype      => filesystem type.  Defaults to ext4.
+#   mkfs_opt    => options for the mkfs if the filesystem needs to
+#                  be created.
+#   options     => mount options
 #
 # Requires:
 #   The node must have included the labs_lvm class.
@@ -27,15 +32,16 @@
 #
 
 define labs_lvm::volume(
-    $volname    = $title,
-    $mountat    = "/mnt/${volname}",
-    $mountowner = 'root',
-    $mountgroup = 'root',
-    $mountmode  = '755',
-    $size       = '100%FREE',
-    $fstype     = 'ext4',
-    $mkfs_opt   = '',
-    $options    = 'defaults',
+    $volname     = $title,
+    $mountat     = "/mnt/${volname}",
+    $mountmanage = true,
+    $mountowner  = 'root',
+    $mountgroup  = 'root',
+    $mountmode   = '755',
+    $size        = '100%FREE',
+    $fstype      = 'ext4',
+    $mkfs_opt    = '',
+    $options     = 'defaults',
 ) {
     include labs_lvm
 
@@ -73,12 +79,14 @@
         ],
     }
 
-    file { $mountat:
-        ensure  => directory,
-        owner   => $mountowner,
-        group   => $mountgroup,
-        mode    => $mountmode,
-        require => Mount[$mountat],
+    if $mountmanage {
+        file { $mountat:
+            ensure  => directory,
+            owner   => $mountowner,
+            group   => $mountgroup,
+            mode    => $mountmode,
+            require => Mount[$mountat],
+        }
     }
 
     labs_lvm::extend { $mountat:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb888366755b47f9973163e7e59fbc4914b0be8b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dduvall <dduv...@wikimedia.org>

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

Reply via email to