文件我已經成功地建立了一個最小的Ansible劇本在我的機器上執行一些腳本執行shell:使用參數從混帳
- name: Execute CLI on remote servers
hosts: webserver
tasks:
- name: Get metrics
shell: /home/user1/bin/cli.sh --file=script.cli
唯一的問題是,這依賴於文件系統來存儲腳本。我想保存我的腳本在存儲庫(如GIT)和作爲參數傳遞的引用來的shell.Something,如:
shell: /home/user1/bin/cli.sh --file=ssh://[email protected]/mylogin/script.cli
任何建議高度讚賞!
這是一個真正的問題嗎?或者你應該教'cli.sh'來接受git-uri作爲參數,或者在調用'cli.sh'之前將'script.cli'(例如'git'模塊)傳遞給主機。 –