Puppet中的`file` URI方案是什么?

时间:2014-11-11 11:13:42

标签: file puppet uri-scheme

The documentation for the source attribute for the file resource type说:

  

可用的URI方案是puppetfilepuppet URI将...

然后解释了puppet URI方案,但没有说明file URI方案。它是什么?将"file://foo/bar/baz"分配给source资源上的file属性意味着什么?

1 个答案:

答案 0 :(得分:2)

文件路径始终是绝对的。它指的是运行目录的系统上的文件。这是agent系统,或您调用puppet apply的计算机。

file {
    '/etc/motd':
        source => "file:///media/shared-storage0/motd/${fqdn}.motd";
}

例如,上述资源将使代理同步motd内容和文件元数据来自共享存储。

您可以省略file://,只使用完整路径作为来源。

source => "/media/shared-storage0/motd/${fqdn}.motd";