coren has uploaded a new change for review.

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


Change subject: Transition class for switch to Labs NFS
......................................................................

Transition class for switch to Labs NFS

This overrides LDAP autofs setup to transition to NFS storage
for a project; most of this will end up in LDAP from OpenStack
in the future.

Change-Id: Id838b76e21d8fab11462d99f892b86c1aeb9f6d4
---
A files/labsnfs/nfs-noidmap.conf
A manifests/role/labsnfs.pp
A templates/labsnfs/auto.master.erb
A templates/labsnfs/auto.space.erb
A templates/labsnfs/auto.time.home.erb
A templates/labsnfs/auto.time.project.erb
6 files changed, 70 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/78/61578/1

diff --git a/files/labsnfs/nfs-noidmap.conf b/files/labsnfs/nfs-noidmap.conf
new file mode 100644
index 0000000..102a139
--- /dev/null
+++ b/files/labsnfs/nfs-noidmap.conf
@@ -0,0 +1,12 @@
+# nfs-noidmap - disable idmap for cross-project NFS
+#
+# This task disables the kernel's automatic idmap for NFSv4
+# to allow conflicting group names accross projects
+
+description "disable idmap for cross-project NFS"
+
+start on starting autofs
+
+task
+
+exec echo 1 >/sys/module/nfs/parameters/nfs4_disable_idmapping
diff --git a/manifests/role/labsnfs.pp b/manifests/role/labsnfs.pp
new file mode 100644
index 0000000..edfad17
--- /dev/null
+++ b/manifests/role/labsnfs.pp
@@ -0,0 +1,45 @@
+# This is a transition role - Eventually this will end up
+# in LDAP once transition is over.
+
+class role::labsnfs::client {
+       $nfscluster = "labnfs.pmtpa.wmnet"
+
+       exec { "/sbin/initctl start nfs-noidmap":
+               refreshonly => true
+       }
+
+       file {
+               "/etc/auto.master":
+                       ensure => file,
+                       owner => root,
+                       group => root,
+                       mode => 0444,
+                       content => template("labsnfs/auto.master.erb");
+               "/etc/auto.space":
+                       ensure => file,
+                       owner => root,
+                       group => root,
+                       mode => 0444,
+                       content => template("labsnfs/auto.space.erb");
+               "/etc/auto.time.home":
+                       ensure => file,
+                       owner => root,
+                       group => root,
+                       mode => 0444,
+                       content => template("labsnfs/auto.time.home.erb");
+               "/etc/auto.time.project":
+                       ensure => file,
+                       owner => root,
+                       group => root,
+                       mode => 0444,
+                       content => template("labsnfs/auto.time.project.erb");
+               "/etc/init/nfs-noidmap.conf":
+                       ensure => file,
+                       owner => root,
+                       group => root,
+                       mode => 0444,
+                       notify => Exec["/sbin/initctl start nfs-noidmap"],
+                       source => "puppet:///files/labsnfs/nfs-noidmap.conf";
+       }
+}
+
diff --git a/templates/labsnfs/auto.master.erb 
b/templates/labsnfs/auto.master.erb
new file mode 100644
index 0000000..ee24175
--- /dev/null
+++ b/templates/labsnfs/auto.master.erb
@@ -0,0 +1,5 @@
+#
+# Managed by PUPPET (role::labs-nfs-client)
+#
+/-                     file:/etc/auto.space    
port=0,nfsvers=4,ro,hard,rsize=65536,wsize=65536,sec=sys
+#+auto.master
diff --git a/templates/labsnfs/auto.space.erb b/templates/labsnfs/auto.space.erb
new file mode 100644
index 0000000..331043e
--- /dev/null
+++ b/templates/labsnfs/auto.space.erb
@@ -0,0 +1,6 @@
+/home  / -rw   <%= nfscluster %>:/<%= instanceproject %>/home \
+       /.snapshot -fstype=autofs,ghost file:/etc/auto.time.home
+/data  /project -rw    <%= nfscluster %>:/<%= instanceproject %>/project \
+       /project/.snapshot -fstype=autofs,ghost file:/etc/auto.time.project
+/public        /keys   -nfsvers=3,ro,ghost labstore1.pmtpa.wmnet:/keys \
+       /datasets -nfsvers=3,ro,ghost labstore1.pmtpa.wmnet:/publicdata-project
diff --git a/templates/labsnfs/auto.time.home.erb 
b/templates/labsnfs/auto.time.home.erb
new file mode 100644
index 0000000..50e3ae1
--- /dev/null
+++ b/templates/labsnfs/auto.time.home.erb
@@ -0,0 +1 @@
+*      -fstype=nfs4,ghost      <%= nfscluster %>:/<%= instanceproject 
%>/.snapshot/&/home
diff --git a/templates/labsnfs/auto.time.project.erb 
b/templates/labsnfs/auto.time.project.erb
new file mode 100644
index 0000000..74d9c79
--- /dev/null
+++ b/templates/labsnfs/auto.time.project.erb
@@ -0,0 +1 @@
+*      -fstype=nfs4,ro,ghost   <%= nfscluster %>:/<%= instanceproject 
%>/.snapshot/&/project

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id838b76e21d8fab11462d99f892b86c1aeb9f6d4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren <mpellet...@wikimedia.org>

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

Reply via email to