次のファイル(mathiasbynens dotfiles)をリモートサーバにインストールしようとしています。ここでMathiasインストーラを使用して.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": []}
どれでも私が間違ってやっているアイデア?ドットファイルディレクトリ(source /home/path/dotfiles/bootstrap.sh
)に入っているとき、シェルコマンドのsource
を引数bootstrap.sh
で実行するだけです。いずれかを試してみると、スクリプトがリストの最後のタスクに到達したときにハングするか、上記のエラーメッセージでエラーになります。
ありがとうございます!