我正在尝试下载并解压远程计算机中的tar存档,如果不存在,则必须创建远程目标。但这是不可能的。
错误:目标目录不存在
MYCODE:
- unarchive:
src: http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
dest: /opt/tomcat/
creates: yes
remote_src: True 注:*以根用户身份运行剧本。
提前感谢
发布于 2017-06-23 11:47:40
在使用解压缩模块时,最重要的路径应该是现有目录的路径,而创建的路径应该是文件的路径,而不是布尔型路径。
- name: ensure tomcat directory exists
file:
path: /opt/tomcat
state: directory
- unarchive:
src: http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
dest: /opt/tomcat/ # already existing path
creates: /opt/tomcat/config # some path to make sure that the archive has already been unpacked
remote_src: yeshttps://stackoverflow.com/questions/44719303
复制相似问题