SHARE
TWEET

Untitled

a guest Jan 24th, 2013 599 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
  2.  
  3. define cron_job( $enable = "true", $interval = "daily", $script = "", $package = "" ) {
  4.         file { "/etc/cron.$interval/$name":
  5.                 content         => $script,
  6.                 ensure          => $enable ? {
  7.                         "false" => absent,
  8.                         default => file,
  9.                 },
  10.                 force           => true,
  11.                 owner           => root,
  12.                 group           => root,
  13.                 mode            => $interval ? {
  14.                         "d"     => 644,
  15.                         default => 755,
  16.                 },
  17.                 require         => $package ? {
  18.                         ""      => undef,
  19.                         default => Package[$package],
  20.                 },
  21.         }
  22. }
  23.  
  24. class netbooks {
  25.     package { "nodejs": ensure => "installed" }
  26.  
  27.     cron_job { "shutdown_at_night":
  28.         interval        => "d",
  29.         script          => "0 22 * * * root /usr/bin/apt-get update && /sbin/shutdown -h now
  30. "
  31.     }
  32. }
  33.  
  34. exec { "apt-update":
  35.     command => "/usr/bin/apt-get update",
  36.     refreshonly => true,
  37. }
  38.  
  39. Exec["apt-update"] -> Package <| |>
  40.  
  41. class workstations {
  42.  
  43.     package { "google-chrome-stable":
  44.        ensure => "latest",
  45.     }
  46.  
  47.     cron_job { "dpkg_check":
  48.         interval        => "d",
  49.         script          => "@reboot root /usr/bin/dpkg --configure -a
  50. "
  51.     }
  52.  
  53.  exec { "fixcx12":
  54.   command => "/bin/ln -s /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C^3A_users_crossover_Start+Menu/ /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C^5E3A^5Fusers^5Fcrossover^5FStart^2BMenu
  55. /bin/ln -s /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft+Office
  56. /bin/ln -s /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft\ Word\ 2010.lnk /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft+Word+2010.lnk
  57. /bin/ln -s /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft\ Excel\ 2010.lnk /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft+Excel+2010.lnk
  58. /bin/ln -s /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft\ PowerPoint\ 2010.lnk /opt/cxoffice/support/Microsoft_Office_2010/desktopdata/cxmenu/StartMenu.C\^5E3A\^5Fusers\^5Fcrossover\^5FStart\^2BMenu/Programs/Microsoft\ Office/Microsoft+PowerPoint+2010.lnk",
  59.   refreshonly => true
  60.  }
  61.  
  62.   file { "/opt/debs":
  63.     ensure => directory
  64.   }
  65.  
  66.   file { "/opt/puppet":
  67.    ensure => directory
  68.   }
  69.  
  70.   exec { "create_needed_directory":
  71.     command => "/usr/bin/touch /opt/puppet/aptupdate20130110 && /usr/bin/apt-get update",
  72.     creates => "/opt/puppet/aptupdate20130110"
  73.   }
  74.  
  75.   exec { "fixjava":
  76.     command => "/usr/bin/touch /opt/puppet/20130110fixjava && /usr/sbin/update-binfmts --remove jar /usr/bin/jexec --package update-sun-jre",
  77.     creates => "/opt/puppet/20130110fixjava"
  78.   }
  79.  
  80.   file { "/opt/debs/crossover_12.0.0-1_i386.deb":
  81.     owner   => root,
  82.     group   => root,
  83.     mode    => 644,
  84.     ensure  => present,
  85.     source  => "puppet:///files/debs/crossover_12.0.0-1_i386.deb"
  86.   }
  87.  
  88.  package { "crossover":
  89.   provider => dpkg,
  90.   ensure   => latest,
  91.   source   => "/opt/debs/crossover_12.0.0-1_i386.deb",
  92.   notify => Exec["fixcx12"],
  93.   require => File["/opt/debs/crossover_12.0.0-1_i386.deb"],
  94.  }
  95.  
  96. }
RAW Paste Data
Want to get better at Ruby?
Learn to code Ruby in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top