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

Change subject: nfs_mount: Remove showmount based blocking check for nfs shares
......................................................................

nfs_mount: Remove showmount based blocking check for nfs shares

This change removes the check, the block parameter, and references
to it. It also removes the block-for-export script.

Bug: T171508
Change-Id: I321c0316e3118eeffea24e79978985bad45d249f
---
D modules/labstore/files/block-for-export
M modules/labstore/manifests/nfs_mount.pp
M modules/role/manifests/labs/nfsclient.pp
3 files changed, 0 insertions(+), 60 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/70/391970/1

diff --git a/modules/labstore/files/block-for-export 
b/modules/labstore/files/block-for-export
deleted file mode 100644
index dd8c9e7..0000000
--- a/modules/labstore/files/block-for-export
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-#
-# This file is installed by puppet.
-#
-#  Block until a specified volume is available.  This
-#  is used during a puppet run to prevent premature config
-#  of a non-existent volume.
-#
-#  Args are server, volpath, timeout in seconds.  Example:
-#
-#     block-for-export labstore.svc.eqiad.wmnet project/testlabs 120
-#
-set -u
-
-NFS_SERVER=$1
-VOLUME=$2
-TIMEOUT=$3
-
-if [ "$#" -ne 3 ]; then
-    echo "Usage:  ${0} <server> <project> <timeout>"
-    exit 1
-fi
-
-# query openstack metadata service
-ip=`curl http://169.254.169.254/1.0/meta-data/local-ipv4 2> /dev/null`
-domain=`hostname -d | sed -r 's/.*\.([^.]+\.[^.]+)$/\1/'`
-for i in `seq 1 ${TIMEOUT}`; do
-    prod_domain=`echo $domain | sed 's/wmflabs/wmnet/'`
-    echo $(showmount -e ${NFS_SERVER} | egrep ^/exp/${VOLUME}\\s), | fgrep -q 
$ip,
-    if [ $? -eq 0 ];  then
-        exit 0
-    fi
-    sleep 1
-done
-
-exit 2
diff --git a/modules/labstore/manifests/nfs_mount.pp 
b/modules/labstore/manifests/nfs_mount.pp
index a722f89..094f8de 100644
--- a/modules/labstore/manifests/nfs_mount.pp
+++ b/modules/labstore/manifests/nfs_mount.pp
@@ -27,9 +27,6 @@
 # [*options]
 #  Array of options to combine with the standard options
 #
-# [*block]
-#  boolean to determine if we should block to wait for share
-#
 # [*block_timeout]
 #  timeout to block for share availability
 
@@ -41,7 +38,6 @@
     $share_path = undef,
     $server = undef,
     $options = [],
-    $block=false,
     $block_timeout = 180,
     $lookupcache='none',
 )
@@ -129,24 +125,6 @@
     }
 
     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',
-                }
-            }
-            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'
diff --git a/modules/role/manifests/labs/nfsclient.pp 
b/modules/role/manifests/labs/nfsclient.pp
index baa33db..28cfcc9 100644
--- a/modules/role/manifests/labs/nfsclient.pp
+++ b/modules/role/manifests/labs/nfsclient.pp
@@ -10,7 +10,6 @@
         mount_path  => '/mnt/nfs/labstore-secondary-project',
         share_path  => "/project/${::labsproject}/project",
         server      => 'nfs-tools-project.svc.eqiad.wmnet',
-        block       => true,
         lookupcache => $lookupcache,
     }
 
@@ -21,7 +20,6 @@
         mount_path  => '/mnt/nfs/labstore-secondary-home',
         share_path  => "/project/${::labsproject}/home",
         server      => 'nfs-tools-project.svc.eqiad.wmnet',
-        block       => true,
         lookupcache => $lookupcache,
     }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I321c0316e3118eeffea24e79978985bad45d249f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy <mviswanat...@wikimedia.org>

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

Reply via email to