角色/任務/main.yml 代碼
- name: Download and unpack node exporter binary to /usr/local/bin
unarchive:
src: https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz
dest: /usr/local/bin/
remote_src: yes
extra_opts: [--strip-components=1]
owner: "ec2-user"
group: "ec2-user"
node-exporter.yml 代碼
---
- hosts: node-exporter
become: false
gather_facts: false
roles:
- roles
錯誤資訊
fatal: [ip]: FAILED! => {"changed": false, "msg": "Failure downloading https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz, Request failed: <urlopen error [Errno -2] Name or service not known>"}
如果我運行“ansible -m ping node-exporter”,我會收到 pong。并且“ping www.google.com”運行良好
但是,這段代碼不起作用
幫助我如何解決這個問題或向我推薦任何代碼....
(我使用亞馬遜 linux)
uj5u.com熱心網友回復:
那里正在發生一些奇怪的事情。在您擁有的角色代碼https://github.com/和錯誤ssh://github.com中,您確定您使用的是最新版本的代碼或類似的東西嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/520039.html
上一篇:自動更新本地倉庫
