Chef中的“模板”资源未创建所需的文件

时间:2019-05-10 20:42:15

标签: chef chef-recipe

我正在Chef中使用以下代码段来创建和复制内容,
将user_config_splunk.conf.erb更改为user-seed.conf。 它的执行没有任何错误,但是有些方法说明在指定路径中没有创建文件。

我在日志中看到删除了原始文件,另外还有一个隐藏文件。不确定是什么意思。

 +++ /opt/splunkforwarder/etc/system/local/.chef-user-seed20190510-3124-18cbkkv.conf  2019-05-10 20:33:46.913823000 +0000

有什么主意吗?

厨师代码

   # Deploy the seeds file
    template '/opt/splunkforwarder/etc/system/local/user-seed.conf' do
        source 'user_config_splunk.conf.erb'
        owner 'root'
        group 'root'
        mode '0777'
        force_unlink false
    end

厨师日志

 * template[/opt/splunkforwarder/etc/system/local/user-seed.conf] action create
           - create new file /opt/splunkforwarder/etc/system/local/user-seed.conf
           - update content in file /opt/splunkforwarder/etc/system/local/user-seed.conf from none to 35d6af
           --- /opt/splunkforwarder/etc/system/local/user-seed.conf     2019-05-10 20:33:46.913823000 +0000
           +++ /opt/splunkforwarder/etc/system/local/.chef-user-seed20190510-3124-18cbkkv.conf  2019-05-10 20:33:46.913823000 +0000

1 个答案:

答案 0 :(得分:0)

从Chef-Client日志看来,文件已在/opt/splunkforwarder/etc/system/local/user-seed.conf中创建,并由root拥有。当您验证文件是否存在时,请确保与有权访问该文件的用户一起执行此操作。

相关问题