Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350389 )

Change subject: swift: create required LV in labs
......................................................................

swift: create required LV in labs

Labs uses lvm for its virtual disks, thus introduce a labs-specific class to
create the required LV and symlink it into /dev and simulate a real
disk/partition.

Bug: T162247
Change-Id: If292ad0069ec5083959e963620bd25ad4127bf37
---
A modules/swift/manifests/storage/labs.pp
1 file changed, 27 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/89/350389/1

diff --git a/modules/swift/manifests/storage/labs.pp 
b/modules/swift/manifests/storage/labs.pp
new file mode 100644
index 0000000..64cf354
--- /dev/null
+++ b/modules/swift/manifests/storage/labs.pp
@@ -0,0 +1,27 @@
+# Create LV needed by swift and instruct udev to symlink it to its expected
+# location to simulate a disk partition.
+class swift::storage::labs {
+  include ::lvm
+
+  lvm::logical_volume { 'lv-a1':
+    volume_group => 'vd',
+    createfs     => false,
+    mounted      => false,
+    extents      => '80%FREE',
+  }
+
+  file { '/etc/udev/rules.d/99-swift-lvm.rules':
+    ensure  => present,
+    user    => 'root',
+    group   => 'root',
+    mode    => '0444',
+    content => 'ENV{DM_LV_NAME}=="lv-a1", ENV{DM_VG_NAME}=="vd", 
SYMLINK+="lv-a1"',
+    notify  => Exec['swift_udev_reload'],
+    require => Lvm::Logical_volume['lv-a1'],
+  }
+
+  exec { 'swift_udev_reload':
+    command     => '/sbin/udevadm control --reload && /sbin/udevadm trigger',
+    refreshonly => true,
+  }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If292ad0069ec5083959e963620bd25ad4127bf37
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to