2014-01-07 44 views
3

这将是一个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': 

    #the command to be executed 
    command => '/usr/bin/apt-get update', 

    #where we can find the required command 
    require => Exec['add php54 apt-repo'] 
} 

回答

5

在你的代码,你可以看到关键字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'] 

指现有实例使用他的名字(“添加php54 APT-回购')