问题
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