编写我的第一个 Ansible 脚本。我正在尝试安装 GVM。
当我直接在盒子上运行 gvm 版本时,我安装 GVM ok(我登录到盒子并检查)我得到: Go Version Manager v1.0.22 installed at /d1/golang/gvm
但是当我在 Ansible 中将它作为命令运行时:
- name: GVM Version
shell: gvm version
become: yes
我收到以下错误:
failed: [prod2] => {"changed": true, "cmd": "gvm version", "delta": "0:00:00.002081", "end": "2015-10-19 13:41:54.123575", "rc": 127, "start": "2015-10-19 13:41:54.121494", "warnings": []}
stderr: /bin/bash: gvm: command not found
FATAL: all hosts have already failed -- aborting
我正在运行一个 bash 脚本,其中包含:source /d1/golang/gvm/scripts/gvm应该确保您不必重新启动终端 - 请参阅下面的 ansible 命令。
- name: Run gvm source
shell: . /etc/profile.d/golang.sh executable=/bin/bash
become: yes
任何想法我做错了什么?
PIPIONE
相关分类