我试图使用ansible在远程服务器上安装以下文件([医]麦斯比尼氏斑点)。
以下是角色/dotfiles/任务/main.yml文件内容:
---
- name: Flag if dotfiles directory exists
stat: path=/home/path/dotfiles
register: dotfilesdirectory
- name: Remove old dotfiles directory
file: path=/home/path/dotfiles state=absent
when: dotfilesdirectory.stat.exists
register: olddirectoryremoved
- name: Clone repository
git: repo=https://github.com/mathiasbynens/dotfiles.git dest=/home/path/dotfiles
when: not dotfilesdirectory.stat.exists or olddirectoryremoved|success
register: repositorycloned
- name: Instantiate dotfiles
shell: source bootstrap.sh
args:
chdir: /home/path/dotfiles
executable: /bin/bash
when: repositorycloned|success在运行剧本并使用-vvvv时,我得到了以下输出:
fatal: [ready]: FAILED! => {"changed": true, "cmd": "bootstrap.sh", "delta": "0:00:00.003190", "end": "2016-04-17 12:25:22.480491", "failed": true, "invocation": {"module_args": {"_raw_params": "bootstrap.sh", "_uses_shell": true, "chdir": "/home/path/dotfiles", "creates": null, "executable": "/bin/bash", "removes": null, "warn": true}, "module_name": "command"}, "rc": 127, "start": "2016-04-17 12:25:22.477301", "stderr": "/bin/bash: bootstrap.sh: command not found", "stdout": "", "stdout_lines": [], "warnings": []}知道我做错了什么吗?我所要做的就是在dotfiles目录(即source )中运行带有bootstrap.sh参数的shell命令。我所做的每一件事都会导致脚本在到达列表上的最后一个任务时挂起,或者使用上面的错误消息出错。
提前感谢!
发布于 2016-04-17 18:02:06
你看过bootstrap.sh的内容了吗?你不想获取那个文件。您应该按以下方式执行它
./bootstrap.sh --force
或者,如果您确实需要获取它(可能不是作为一个不可访问的任务),您可以按照它在README.md文件中说的那样做
set -- -f; source bootstrap.sh
https://stackoverflow.com/questions/36679192
复制相似问题