Advertisement
Guest User

Puppet - copy several files to directory

a guest
Oct 2nd, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.34 KB | None | 0 0
  1.  
  2.   #------------------------------------------------------------
  3.   # Now we need to build up arrays of source to be synced, this
  4.   # depends on the set of files the nginx instance serves
  5.   # @todo Combine hia & hnav, that is, there will still be
  6.   #       separate config files, but only a single parameter
  7.   #       for the nginx module
  8.   #------------------------------------------------------------
  9.   if($serve_hia == true) {
  10.     $hia_etc_source = 'puppet:///modules/nginx/hnav'
  11.   } else {
  12.     $hia_etc_source = ''
  13.   }
  14.   if($serve_hnav == true) {
  15.     $hnav_etc_source = 'puppet:///modules/nginx/hia'
  16.   } else {
  17.     $hnav_etc_source = ''
  18.   }
  19.   if($serve_firmware == true) {
  20.     $firmware_etc_source = 'puppet:///modules/nginx/firmware'
  21.   } else {
  22.     $firmware_etc_source = ''
  23.   }
  24.  
  25.   # Build up final list of sources to sync
  26.   $etc_source = split("$hia_etc_source $hnav_etc_source $firmware_etc_source", '\s+')
  27.  
  28.   #--------------------------------------------------------
  29.   # /etc files that configure nginx for particular services
  30.   #--------------------------------------------------------
  31.   file { '/etc/nginx/conf.d':
  32.     path         => '/etc/nginx/conf.d',
  33.     ensure       => directory,
  34.     require      => File['/etc/nginx/nginx.conf'],
  35.     source       => $etc_source,
  36.     sourceselect => all,
  37.     recurse      => true,
  38.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement