Madhuvishy has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/374845 )

Change subject: nfsmount: Add temporary exception to the block-for-export check
......................................................................


nfsmount: Add temporary exception to the block-for-export check

This patch adds a temporary exception for project testlabs, so that
new instances created in the project will ignore the showmount based
blocking mechanism for nfs mounts to become available, so I can test
https://gerrit.wikimedia.org/r/#/c/368223/.

This patch can be reverted as soon as the testing is done, and we can
then get rid of the block-for-export check when the updated VM images
are rolled out.

Bug: T171508
Change-Id: Ie32dcc10c81e018fd18b5b582350ee9d5e60622a
---
M modules/labstore/manifests/nfs_mount.pp
1 file changed, 21 insertions(+), 15 deletions(-)

Approvals:
  Madhuvishy: Looks good to me, approved
  Rush: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/labstore/manifests/nfs_mount.pp 
b/modules/labstore/manifests/nfs_mount.pp
index c0ad900..5ee1bad 100644
--- a/modules/labstore/manifests/nfs_mount.pp
+++ b/modules/labstore/manifests/nfs_mount.pp
@@ -130,24 +130,30 @@
 
     if ($ensure == 'present') and mount_nfs_volume($project, $mount_name) {
 
-        if $block {
-            if !defined(File['/usr/local/sbin/block-for-export']) {
-                # This script will block until the NFS volume is available
-                file { '/usr/local/sbin/block-for-export':
-                    ensure => present,
-                    owner  => 'root',
-                    group  => 'root',
-                    mode   => '0555',
-                    source => 'puppet:///modules/labstore/block-for-export',
+        # This project!=testlabs check is a super temporary check put in place 
to
+        # test new VM images that include alternative functionality to block 
until
+        # all the mounts are available, that would deprecate the following 
showmount
+        # based mechanism if it works correctly.
+        # TODO: Revert this check after testing (T174590)
+        if ($project != 'testlabs') {
+            if $block {
+                if !defined(File['/usr/local/sbin/block-for-export']) {
+                    # This script will block until the NFS volume is available
+                    file { '/usr/local/sbin/block-for-export':
+                        ensure => present,
+                        owner  => 'root',
+                        group  => 'root',
+                        mode   => '0555',
+                        source => 
'puppet:///modules/labstore/block-for-export',
+                    }
+                }
+                exec { "block-for-nfs-${name}":
+                    command => "/usr/local/sbin/block-for-export ${server} 
project/${project} ${block_timeout}",
+                    require => [File['/etc/modprobe.d/nfs-no-idmap.conf'], 
File['/usr/local/sbin/block-for-export']],
+                    unless  => "/bin/mountpoint -q ${mount_path}",
                 }
             }
-            exec { "block-for-nfs-${name}":
-                command => "/usr/local/sbin/block-for-export ${server} 
project/${project} ${block_timeout}",
-                require => [File['/etc/modprobe.d/nfs-no-idmap.conf'], 
File['/usr/local/sbin/block-for-export']],
-                unless  => "/bin/mountpoint -q ${mount_path}",
-            }
         }
-
         # 'present' is meant to manage only the status of entries in /etc/fstab
         # a notable exception to this is in the case of an entry managed as 
'present'
         # puppet will attempt to remount that entry when options change /but/ 
only

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie32dcc10c81e018fd18b5b582350ee9d5e60622a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy <[email protected]>
Gerrit-Reviewer: Madhuvishy <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to