Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chef infra 使用Chef管理文件夹和文件_Chef Infra_Chef Recipe - Fatal编程技术网

Chef infra 使用Chef管理文件夹和文件

Chef infra 使用Chef管理文件夹和文件,chef-infra,chef-recipe,Chef Infra,Chef Recipe,我曾尝试搜索有关此问题的类似问题,但找不到任何解决此问题的方法 我对厨师很陌生,所以可能会弄错一些术语。请容忍我 我在chef服务器上本地有一个git回购,例如/var/my code/ 我想在里面添加所有的文件和文件夹 /var/my code/properties/到节点主机上的/app/files/properties/ 我计划这样做的一个方法是在 properties/files/default/至/var/my code/properties/,但当我运行刀上载时,此操作失败,因为re

我曾尝试搜索有关此问题的类似问题,但找不到任何解决此问题的方法

我对厨师很陌生,所以可能会弄错一些术语。请容忍我

我在chef服务器上本地有一个git回购,例如
/var/my code/

我想在里面添加所有的文件和文件夹
/var/my code/properties/
到节点主机上的
/app/files/properties/

我计划这样做的一个方法是在
properties/files/default/
/var/my code/properties/
,但当我运行刀上载时,此操作失败,因为repo位于chef服务器而不是工作站上。我在运行刀上载时出现此错误

Uploading properties     [0.1.0]
ERROR: The cookbook properties has one or more broken files
ERROR: This is probably caused by broken symlinks in the cookbook directory
ERROR: The broken file(s) are: files/default/properties
对于
remote\u目录
,就我所见,没有选项添加文件夹路径,例如
/var/my code/properties/
,作为源。它期望文件/文件夹位于cookbook的/files目录中

这是我的食谱

remote_directory '/app/files/properties' do
  source 'properties'
  owner 'root'
  group 'root'
  mode '0755'
end

提前谢谢。

Chef服务器上的git存储库不相关,Chef服务器只通过自己的API与客户端交互

你可能想要这样的东西:

git '/var/my-code' do
  repository 'http://mygitserver/my-code.git'
end

link '/app/files/properties' do
  to '/var/my-code/properties'
end

位于Chef服务器上的git存储库不相关,Chef服务器只通过自己的API与客户端交互

你可能想要这样的东西:

git '/var/my-code' do
  repository 'http://mygitserver/my-code.git'
end

link '/app/files/properties' do
  to '/var/my-code/properties'
end