An array is passed to aegir::platform_directory causing it to invoke
the define aegir::platform_directory multiple times.  In the define I
set namevar of the exec to "unpack-drupal-${name}" in order to to
avoid the error "Duplicate definition: Exec[unpack-drupal]".


class aegir::platform::dev inherits aegir::platform {

 $environments = [ "dev", "qa" ]
 if $environments {
   aegir::platform_directory { $environments:
     platform_dir => $platform_dir,
   }
 }

}


define aegir::platform_directory (
    ensure = "directory",
    source = "puppet:///aegir/empty"
) {

  file {"${name}":
    ensure => $ensure,
    recurse => true,
    force => $ensure ? {
      "absent" => true,
      default => false
    },
    source => $source,
    owner => $aegir_unix_user,
    group => $aegir_unix_group,
    #TODO: selinux
    mode => 775,
  }

  /*
   * setting namevar "unpack-drupal-${name}" to avoid "Duplicate
definition:
   * Exec[unpack-drupal]" resulting from passing an array to this
define.
   *
   * tar.gz files seem to be automatically cleaned up--no need to
remove them.
   */
  exec { "unpack-drupal-${name}":
    command => "/bin/tar zxf *.gz && /bin/rm *.gz",
    cwd => $name,
    onlyif => "test -e *.gz",
    require => File[$name],
  }

}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to