【发布时间】:2020-09-08 00:39:22
【问题描述】:
这是库存内容:
[osm]
osm_host ansible_port=22 ansible_host=10.20.20.11 ansible_user=ubuntu ansible_ssh_private_key_file=/path/to/key/key
这是剧本内容:
- hosts: osm
user: ubuntu
become: yes
tasks:
- name: Download the OSM installer
get_url: url=https://osm-download.etsi.org/ftp/osm-8.0-eight/install_osm.sh dest=/tmp/install_osm.sh
- name: Execute the OSM installer
shell: /tmp/install_osm.sh
当我运行ansible-playbook -i inventory play.yaml 时,我收到以下错误:
播放 [osm]
TASK [收集事实] ****************************************************** ******* 好的:[osm_host]
任务 [下载 OSM 安装程序] ************************************************ 好的:[osm_host ]
TASK [执行 OSM 安装程序] *********************************************** 致命的: [ osm_host]:失败! => {“更改”:true,“cmd”:“/tmp/install_osm.sh”,“delta”: “0:00:00.001919”,“结束”:“2020-09-04 19:26:46.510381”,“味精”: “非零返回码”,“rc”:126,“start”:“2020-09-04 19:26:46.508462", "stderr": "/bin/sh: 1: /tmp/install_osm.sh: 权限被拒绝”,“stderr_lines”:[“/bin/sh:1:/tmp/install_osm.sh: 权限被拒绝"], "stdout": "", "stdout_lines": []}
播放回顾 ****************************************************** ******************* osm_host : ok=2 已更改=0 无法访问=0
失败=1 跳过=0 救出=0 忽略=0
我尝试将true 和yes 用于become 子句,但没有任何改变。我错过了什么?
【问题讨论】: