Puppet 为什么有两种类型的木偶';执行官';木偶';执行官';
这将是一个Noob问题 为什么Puppet中有两种类型的Exec,Exec和Exec。我找不出两者之间的区别Puppet 为什么有两种类型的木偶';执行官';木偶';执行官';,puppet,Puppet,这将是一个Noob问题 为什么Puppet中有两种类型的Exec,Exec和Exec。我找不出两者之间的区别 Exec { path => ["/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin","/usr/local/sbin"] } #execute the following command exec { #this is our command name 'apt-get update'
Exec {
path => ["/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin","/usr/local/sbin"]
}
#execute the following command
exec {
#this is our command name
'apt-get update':
#the command to be executed
command => '/usr/bin/apt-get update',
#where we can find the required command
require => Exec['add php54 apt-repo']
}
只有一种resurce类型,当使用大写时,您正在进行资源引用[1],这会影响适用范围内该类型的所有资源
[1] 在代码中,您可以看到关键字exec的三种不同用法: 第一个
Exec {
path => ["/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin","/usr/local/sbin"]
}
更改资源执行器的属性路径的默认值
第二条:
#execute the following command
exec {
#this is our command name
'apt-get update':
创建资源的实例
第三条:
require => Exec['add php54 apt-repo']
使用其名称('add php54 apt repo')引用现有实例