Skip to Content
Ansible: 시작부터 끝까지, 3판
book

Ansible: 시작부터 끝까지, 3판

by Bas Meijer, Lorin Hochstein, René Moser
May 2025
Beginner to intermediate
472 pages
7h 11m
Korean
O'Reilly Media, Inc.
Book available
Content preview from Ansible: 시작부터 끝까지, 3판

8장. 앤서블 플레이북 디버깅

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

현실을 직시하세요: 실수는 일어납니다. 플레이북의 버그든 제어 시스템의 구성 파일에 잘못된 구성 값이 있든, 결국에는 뭔가 잘못될 수밖에 없습니다. 이 장에서는 이러한 오류를 추적하는 데 사용할 수 있는 몇 가지 기술을 검토해 보겠습니다.

인도적 오류 메시지

Ansible 작업이 실패하면 출력 형식이 문제를 디버깅하려는 사람에게는 그다지 친숙하지 않습니다. 다음은 이 책에서 작업하는 동안 생성된 오류 메시지의 예입니다:

TASK [mezzanine : check out the repository on the host]
	************************
fatal: [web]: FAILED! => {"changed": false, "cmd": "/usr/bin/git ls-remote
'' -h refs/heads/master", "msg": "Warning:********@github.com: Permission
denied (publickey).\r\nfatal: Could not read from remote
repository.\n\nPlease make sure you have the correct access rights\nand the
repository exists.", "rc": 128, "stderr": "Warning: Permanently added
'github.com,140.82.121.4' (RSA) to the list of known
hosts.\r\ngit@github.com: Permission denied (publickey).\r\nfatal: Could not
read from remote repository.\n\nPlease make sure you have the correct access
rights\nand the repository exists.\n", "stderr_lines": ["Warning:
Permanently added 'github.com,140.82.121.4' (RSA) to the list of known
hosts.", "git@github.com: Permission denied (publickey).", "fatal: Could not
read from remote repository.", "", "Please make sure you have the correct
access rights", "and the repository exists."], "stdout": "", "stdout_lines":
[]}

18장에서 언급했듯이 디버그 콜백 플러그인을 사용하면 이 출력을 사람이 훨씬 쉽게 읽을 수 있습니다:

 TASK [mezzanine : check out the repository on the host] ************************ fatal: [web]: FAILED! ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes 오퍼레이터

Kubernetes 오퍼레이터

Jason Dobies, Joshua Wood

Publisher Resources

ISBN: 9798341653900Supplemental Content