首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过安装.dotfiles

通过安装.dotfiles
EN

Stack Overflow用户
提问于 2016-04-17 16:33:58
回答 1查看 244关注 0票数 0

我试图使用ansible在远程服务器上安装以下文件([医]麦斯比尼氏斑点)。

以下是角色/dotfiles/任务/main.yml文件内容:

代码语言:javascript
复制
---
 - 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时,我得到了以下输出:

代码语言:javascript
复制
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命令。我所做的每一件事都会导致脚本在到达列表上的最后一个任务时挂起,或者使用上面的错误消息出错。

提前感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-17 18:02:06

你看过bootstrap.sh的内容了吗?你不想获取那个文件。您应该按以下方式执行它

./bootstrap.sh --force

或者,如果您确实需要获取它(可能不是作为一个不可访问的任务),您可以按照它在README.md文件中说的那样做

set -- -f; source bootstrap.sh

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36679192

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档