这是我的任务。它基本上将文件解压缩到目录/ usr / local / hadoop中。
hadoop文件夹不存在,我收到此错误 -
错误: -
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "dest 'dest=/usr/local/ creates=/usr/local/hadoop copy=no' must be an existing dir"}
- name: Unarchive a file
unarchive:
src: /home/hduser/hadoop-2.7.1.tar.gz
dest: dest=/usr/local/ creates=/usr/local/hadoop copy=no
remote_src: yes
答案 0 :(得分:1)
您的任务存在一些语法问题。您无法将遗留key=value
语法与YAML语法结合使用。特别是这条线......
dest: dest=/usr/local/ creates=/usr/local/hadoop copy=no
...只是将一个非常长的字符串传递给dest
键。你想要:
- name: Unarchive a file
unarchive:
src: /home/hduser/hadoop-2.7.1.tar.gz
dest: /usr/local/
creates: /usr/local/hadoop
copy: no
remote_src: yes