简体   繁体   English

使用人偶模块“ maestrodev / puppet-wget”的人偶资源订购?

[英]Puppet resource ordering with puppet module “maestrodev/puppet-wget”?

Puppet allows resource ordering to specify the order in which resources are installed/created. Puppet允许资源排序以指定安装/创建资源的顺序。

My ruby script uses package to install an application. 我的ruby脚本使用package来安装应用程序。

$app_firefox_name = "Firefox-0-DL"
$app_firefoxt_dmg = "/tmp/$app_firefox_name.dmg"

package { $app_firefoxt_app:
     ensure => installed,
     provider => appdmg,
 source => $app_firefoxt_dmg,
     require => wget::fetch[$app_firefoxt_app],
 }

Prior installation, the script requires to download the application. 在安装之前,该脚本需要下载该应用程序。 The script uses puppet module https://github.com/maestrodev/puppet-wget to fetch the application. 该脚本使用puppet模块https://github.com/maestrodev/puppet-wget来获取应用程序。

wget::fetch { $app_firefox_name:
    source      => "http://download.mozilla.org/?product=firefox-21.0&os=osx&lang=en-GB",
    destination => $app_firefox_dmg,
    timeout     => 0,
    verbose     => true
}

I don't know if maestrodev/puppet-wget module defines a type. 我不知道maestrodev / puppet-wget模块是否定义了类型。

Does the following code define a type that can be used to describe resource ordering (as defined in the Puppet's resource ordering document) ? 以下代码是否定义了可用于描述资源排序的类型(如Puppet的资源排序文档中所定义)?

define wget::fetch (
  $source,
  $destination,
  $timeout            = '0',
  $verbose            = false,
  $redownload         = false,
  $nocheckcertificate = false,
  $execuser           = 'root',
) { ... }

If yes, how can I use puppet's before metaparameter to express the relationship download app -> install app package ? 如果是, 我该如何使用puppet中的metaparameter来表达下载应用程序->安装应用程序包的关系?

我可能会遗漏您的问题,但是如果需求无法解决,请尝试将其大写:

require => Wget::Fetch[$app_firefoxt_app]

I workaround the issue using Puppet's package resource to download the application. 我使用Puppet的package资源来解决该问题,以下载该应用程序。

package { $app_firefoxt_app:
 ensure => installed,
 provider => appdmg,
 source => "http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/mac/en-GB/Firefox%2021.0.dmg"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM