使用puppet下载Nexus文件

时间:2016-02-08 19:09:53

标签: puppet nexus

我正在寻找一个从nexus存储下载文件的木偶脚本。我有以下脚本运行没有任何问题,但文件没有下载。

这是nexus.pp类:

class nexus ( 

  $url ="http://nexus.repoexp" ,

  $username = "xxxxx",

  $password =  "xxxxx"

) {   

}

node "Nexus_Application" {

                include nexus

}

==============================================

This is separate artifact.pp file

define nexus::artifact (

  $gav,

  $repository,

  $output,

  $packaging  = 'jar',

  $classifier = undef,

  $ensure     = update,

  $timeout    = undef,

  $owner      = undef,

  $group      = undef,

  $mode       = undef

) {

  include nexus

if $ensure == present {

    exec { "Download ${name}":

      command => $cmd,

      creates => $output,

      timeout => $timeout,

    }

elsif $ensure == absent {

    file { "Remove ${name}":

      ensure => absent,

      path   => $output,

    }

  } else {

    exec { "Download ${name}":

      command => $cmd,

      timeout => $timeout,

    }

if $ensure != absent {

    file { $output:

      ensure  => file,

      require => Exec["Download ${name}"],

      owner   => $owner,

      group   => $group,

      mode    => $mode,

    }

}
==============================================================
A module class by name nexus 
nexus::artifact {'chameleon web distribution':
   gav        => "org.ow2.chameleon:distribution-web:0.3.0-SNAPSHOT",
   classifier => 'distribution',`enter code here`
   packaging  => 'zip',
   repository => "public-snapshots",
   output     => "/tmp/distribution-web-0.3.0-SNAPSHOT.z`enter code here`ip"
}

0 个答案:

没有答案