我使用的是Chef托管的服务器,工作站和节点,并且已在节点上运行食谱来安装Java,更新主机文件。我无法在网站中找到解压缩tar文件的参考。您能否在这里帮助我,或直接访问包含该信息的站点。
提前致谢。
实际上,Chef中没有任何内置工具可用于提取tar文件。您有两种选择,要么可以使用execute资源对shell进行外壳和解压缩,要么使用诸如tar Cookbook之类的社区菜谱,这些社区菜谱已定义了用于提取tar的自定义资源。
在execute
资源示例中,它可能看起来像
execute 'extract_some_tar' do
command 'tar xzvf somefile.tar.gz'
cwd '/directory/of/tar/here'
not_if { File.exists?("/file/contained/in/tar/here") }
end
而第三方tar食谱肯定读得更好
tar_package 'http://pgfoundry.org/frs/download.php/1446/pgpool-3.4.1.tar.gz' do
prefix '/usr/local'
creates '/usr/local/bin/pgpool'
end
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句