Puppet Exec what “<| |>” means?

半城伤御伤魂 提交于 2019-12-12 12:32:42

问题


I'm learning puppet language and noticed one very intriguing line of code: Exec["apt-update"] -> Package <| |> on following context:

class manifest::module {

  exec { "apt-update":
      command => "/usr/bin/apt-get -y update",
      timeout => 3600;
  }

  package {
    ["alien", "bc", "libaio1", "unixodbc", "unzip", "rlwrap"]:
      ensure => installed;
  }

  Exec["apt-update"] -> Package <| |>
}

Why Exec is followed by the ->? And most important, what's the meaning of <| |> ???


回答1:


This expression essentially instructs Puppet to have any package resource require the "apt-update" exec resource. In other words Puppet will be sure to execute apt-get update before installing/purging/... a package.




回答2:


It matches any package, see http://docs.puppetlabs.com/puppet/latest/reference/lang_collectors.html for more details



来源:https://stackoverflow.com/questions/20593368/puppet-exec-what-means

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!