Share Pastebin
Guest
Public paste!

erlingre

By: a guest | Sep 6th, 2010 | Syntax: None | Size: 2.89 KB | Hits: 46 | Expires: Never
Copy text to clipboard
  1.  
  2.  
  3. node 'testnode001.local' inherits linuxhost-test {
  4.  
  5.     $environment="Test"
  6.  
  7.     include foobar_cifs_shares_mount
  8.  
  9. }
  10.  
  11.  
  12.  
  13. node 'qassnode001.local' inherits linuxhost-qass {
  14.  
  15.     $environment="Qass"
  16.  
  17.     include foobar_cifs_shares_mount
  18.  
  19. }
  20.  
  21.  
  22.  
  23. #----------------------------------------------------------------------------------------------------------------------------------------------------
  24.  
  25.  
  26.  
  27.  
  28.  
  29. class foobar_cifs_shares_mount {
  30.  
  31.  
  32.  
  33.    $folders = [ "/was_app/cache/xyz-foobar/applog", "/was_app/config/xyz-foobar/transport/cpa", "/was_app/config/xyz-foobar/transport/security" ]
  34.  
  35.        
  36.  
  37.    file { $folders:
  38.  
  39.       ensure => directory
  40.  
  41.    }
  42.  
  43.  
  44.  
  45.    mount { "/was_app/cache/xyz-foobar/applog":
  46.  
  47.       device => $environment ? {
  48.  
  49.          Test => "//test-nas001.local/Prog\$/xyz-foobar/applog",
  50.  
  51.          Qass => "//qass-nas001.local/Prog\$/xyz-foobar/applog",
  52.  
  53.          default => "",
  54.  
  55.       },
  56.  
  57.       fstype => cifs,
  58.  
  59.       ensure => mounted,
  60.  
  61.       options => "defaults,acl,soft,uid=wasadm,gid=foobar,umask=0027,file_mode=0640,dir_mode=0750,credentials=/root/cifs_cred_linux.txt,sec=ntlmv2",
  62.  
  63.       pass => "0",
  64.  
  65.       dump => "0",
  66.  
  67.       remounts => "true",
  68.  
  69.       require => File["/was_app/cache/xyz-foobar/applog"],
  70.  
  71.       require => File["/root/cifs_cred_linux.txt"],
  72.  
  73.    }
  74.  
  75.  
  76.  
  77.    mount { "/was_app/config/xyz-foobar/transport/cpa":
  78.  
  79.       device => $environment ? {
  80.  
  81.          Test => "//test-nas001.local/Prog\$/xyz-foobar/transport/cpa",
  82.  
  83.          Qass => "//qass-nas001.local/Prog\$/xyz-foobar/transport/cpa",
  84.  
  85.          default => "",
  86.  
  87.       },
  88.  
  89.       fstype => cifs,
  90.  
  91.       ensure => mounted,
  92.  
  93.       options => "defaults,acl,soft,uid=wasadm,gid=foobar,umask=0027,file_mode=0660,dir_mode=0770,credentials=/root/cifs_cred_linux.txt,sec=ntlmv2",
  94.  
  95.       pass => "0",
  96.  
  97.       dump => "0",
  98.  
  99.       remounts => "true",
  100.  
  101.       require => File["/was_app/config/xyz-foobar/transport/cpa"],
  102.  
  103.       require => File["/root/cifs_cred_linux.txt"],
  104.  
  105.    }
  106.  
  107.  
  108.  
  109.    mount { "/was_app/config/xyz-foobar/transport/security":
  110.  
  111.       device => $environment ? {
  112.  
  113.          Test => "//test-nas001.local/Prog\$/xyz-foobar/transport/security",
  114.  
  115.          Qass => "//qass-nas001.local/Prog\$/xyz-foobar/transport/security",
  116.  
  117.          default => "",
  118.  
  119.       },
  120.  
  121.       fstype => cifs,
  122.  
  123.       ensure => mounted,
  124.  
  125.       options => "defaults,acl,soft,uid=wasadm,gid=foobar,umask=0027,file_mode=0660,dir_mode=0770,credentials=/root/cifs_cred_linux.txt,sec=ntlmv2",
  126.  
  127.       pass => "0",
  128.  
  129.       dump => "0",
  130.  
  131.       remounts => "true",
  132.  
  133.       require => File["/was_app/config/xyz-foobar/transport/security"],
  134.  
  135.       require => File["/root/cifs_cred_linux.txt"],
  136.  
  137.    }
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.    file { "/root/cifs_cred_linux.txt":
  152.  
  153.       ensure => present,
  154.  
  155.       mode => 700,
  156.  
  157.       owner => root,
  158.  
  159.       group => root,
  160.  
  161.       source => "puppet://$server/files/cifs_cred_linux_$environment.txt"
  162.  
  163.    }
  164.  
  165.  
  166.  
  167.  
  168.  
  169. }