wget
으로 전화를 걸어 재현 할 수 없습니다. 내 gravatar args URL로 사용하고 있습니다. 다음은 샘플 호출입니다. 여기
TASK: [shell wget -O /dev/null https://www.gravatar.com/avatar/cad260683598a6e41608b91a9b57099b?s=24] ***
그리고
디버깅 출력입니다 :
<hostname> REMOTE_MODULE command wget -O /dev/null https://www.gravatar.com/avatar/cad260683598a6e41608b91a9b57099b?s=24 #USE_SHELL
... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 1089 (1.1K) [image/jpeg]\nSaving to: `/dev/null'\n\n 0K . 100% 1.93M=0.001s\n\n2014-10-31 16:52:00 (1.93 MB/s) - `/dev/null' saved [1089/1089]", "stdout": ""}
는 일반적으로
command
,
shell
를 사용하여, 말하기,
lineinfile
코드 냄새의 한 형태입니다. 이 경우
the get_url
module 또는
the uri
module을 사용하는 것을 의미합니다.
wget
은 일반적으로
get_url
을 의미하지만 출력을 버리므로
curl
과 같은 문자를 사용하므로
uri
모듈이 더 좋습니다.
내 플레이 북입니다. httplib가 테스트 호스트에 설치되지 않았으므로 pip
을 추가해야했습니다.
tasks:
- debug: var=hostvars
- pip: name=httplib2
sudo: yes
- uri: url=https://www.gravatar.com/avatar/cad260683598a6e41608b91a9b57099b?s=24
자세한 출력에서 올바른 호출을 확인할 수 있습니다.
ok: [hostname] => {"accept_ranges": "bytes", "access_control_allow_origin": "*", "cache_control": "max-age=300", "changed": false, "content_disposition": "inline; filename=\"cad260683598a6e41608b91a9b57099b.jpeg\"", "content_length": "1089", "content_location": "https://www.gravatar.com/avatar/cad260683598a6e41608b91a9b57099b?s=24", "content_type": "image/jpeg", "date": "Fri, 31 Oct 2014 16:58:42 GMT", "expires": "Fri, 31 Oct 2014 17:03:42 GMT", "last_modified": "Fri, 04 Nov 2011 16:27:09 GMT", "link": "<https://www.gravatar.com/avatar/cad260683598a6e41608b91a9b57099b?s=24>; rel=\"canonical\"", "redirected": false, "server": "ECS (ams/49F2)", "source_age": "81", "status": 200, "via": "1.1 varnish", "x_cache": "HIT", "x_varnish": "3775458975 3775177699"}
http://stackoverflow.com/questions/15783701/which-characters-need-to-be-escaped-in-bash-how-do-we-know-it – vaso123
:) 문제는 배시가 피할 수없는 문제입니다. 문제는 비공개 놀음 책에서 벗어납니다. – Kron