我想从tar文件中提取一个目录。
在Linux中,安装目录解压缩--我只是这样做:
tar -xvf ingres.tar install对于ansible,我试过:
unarchive:
remote_src: yes
src: /ingres/ingres.tar
dest: /ingres
extra_opts:
- "install"但这当然行不通。有什么想法吗?
发布于 2019-01-22 10:20:34
GNU命令可以选择存档成员:--add-file。手册第6.2节提到了它:
如果文件名以破折号(
-)开头,则在其前面加上--add-file选项,以防止将其视为选项。
但是,它也适用于其他文件,这意味着您可以在任务的extra_opts中指定此选项,以选择要提取的文件或目录:
unarchive:
remote_src: yes
src: /ingres/ingres.tar
dest: /ingres
extra_opts:
- "--add-file"
- "install"https://stackoverflow.com/questions/52382830
复制相似问题