Ansible:将存档提取到用户目录 [英] Ansible: extract archive to user's dir
本文介绍了Ansible:将存档提取到用户目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试构建一个Ansible剧本,该剧本在用户的主目录中要创建的文件夹下提取存档(可通过http获取). 到目前为止,我想出了:
I'm trying to build an ansible playbook which extracts an archive (available through http) under a folder to be created in the user's home directory. So far I've come up with:
- name: Extract archive
unarchive:
creates: wildfly
src: "http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip"
dest: "{{ ansible_user_dir }}"/wildfly
remote_src: yes
但是,通过运行它,我得到了一个语法错误:这是令人反感的行:
However by running it, I get a syntax error: here is the offending line:
dest: "{{ ansible_user_dir }}"/wildfly
^ here
我也尝试了不带引号的问题,但是问题仍然存在. 通过对用户的主目录进行硬编码,除了没有创建文件夹"wildfly"外,它都可以工作.有帮助吗?
I've tried also without quotes, but the issue stays the same. By hardcoding the user's home dir it works- except that no folder "wildfly" is created. Any help ?
推荐答案
引用整个表达式:
dest: "{{ ansible_user_dir }}/wildfly"
这篇关于Ansible:将存档提取到用户目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文