Filippo Giunchedi has submitted this change and it was merged. Change subject: swift: fix filesystem provisioning ......................................................................
swift: fix filesystem provisioning Change-Id: Ice08c75a61cd82400743398c118f1056b45e1968 --- M modules/swift_new/manifests/init_device.pp M modules/swift_new/manifests/label_filesystem.pp M modules/swift_new/manifests/mount_filesystem.pp 3 files changed, 11 insertions(+), 11 deletions(-) Approvals: Filippo Giunchedi: Verified; Looks good to me, approved diff --git a/modules/swift_new/manifests/init_device.pp b/modules/swift_new/manifests/init_device.pp index c6b8c27..632724e 100644 --- a/modules/swift_new/manifests/init_device.pp +++ b/modules/swift_new/manifests/init_device.pp @@ -10,7 +10,6 @@ $fs_label = "swift-${dev_suffix}" $parted_cmd = "parted --script --align optimal ${title}" $parted_script = "mklabel gpt mkpart ${fs_label} 0 100%" - $mkfs_cmd = "mkfs -t xfs -i size=512 ${dev}" exec { "parted-${title}": path => '/usr/bin:/bin:/usr/sbin:/sbin', @@ -19,17 +18,14 @@ creates => $dev, } - exec { "mkfs-${title}": - command => $mkfs_cmd, + exec { "mkfs-${dev}": + command => "mkfs -t xfs -L $fs_label -i size=512 ${dev}", path => '/sbin/:/usr/sbin/', - require => Package['xfsprogs'], - before => Exec["parted-${title}"], + require => [Package['xfsprogs'], Exec["parted-${title}"]], unless => "xfs_admin -l ${dev}", } - swift_new::label_filesystem { $dev: - before => Exec["mkfs-${title}"], + swift_new::mount_filesystem { $dev: + require => Exec["mkfs-${dev}"], } - - swift_new::mount_filesystem { $dev: } } diff --git a/modules/swift_new/manifests/label_filesystem.pp b/modules/swift_new/manifests/label_filesystem.pp index 65a7cee..c9d2159 100644 --- a/modules/swift_new/manifests/label_filesystem.pp +++ b/modules/swift_new/manifests/label_filesystem.pp @@ -3,7 +3,7 @@ $dev_suffix = regsubst($dev, '^\/dev\/(.*)$', '\1') $fs_label = "swift-${dev_suffix}" - exec { "fs_label-${dev}": + exec { "xfs_label-${dev}": command => "xfs_admin -L ${fs_label} ${dev}", path => '/usr/sbin:/usr/bin:/sbin:/bin', require => Package['xfsprogs'], diff --git a/modules/swift_new/manifests/mount_filesystem.pp b/modules/swift_new/manifests/mount_filesystem.pp index 4b9c13b..66235f0 100644 --- a/modules/swift_new/manifests/mount_filesystem.pp +++ b/modules/swift_new/manifests/mount_filesystem.pp @@ -14,7 +14,11 @@ } mount { $mount_point: - # XXX this won't mount the disks the first time they are added to fstab + # XXX this won't mount the disks the first time they are added to + # fstab. + # We don't want puppet to keep the FS mounted, otherwise + # it would conflict with swift-drive-auditor trying to keep FS + # unmounted. ensure => 'present', device => "LABEL=swift-${dev_suffix}", name => $mount_point, -- To view, visit https://gerrit.wikimedia.org/r/163825 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice08c75a61cd82400743398c118f1056b45e1968 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo Giunchedi <fgiunch...@wikimedia.org> Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits