Virtualbox를 통해서 우분투 OS 설치하고 책 실습을 진행하는 데 ansible 돌려보면 아래와 같은 에러가 발생합니다.
아래 에러 메시지에서 ubun20-01 서버만 failed=0 통과되는 이유는 “Failed to update apt cache: unknown reason” 메시지를 찾아보면 추측할 수 있는데 현재 ubun20-01 서버에만 NAT Device 할당이 되어 있어서 외부 통신이 가능한 상태이기 때문입니다.
정리하면 아래 메시지는 apt-get update 명령어 수행이 가능해야 통과되는 체크 항목이고 apt-get update는 NAT Device를 통해서 외부 인터넷과 연결이 되어야 하기 때문에 NAT Device가 없는 ubun20-02, ubun20-03 서버는 에러가 발생하는 것이 맞습니다.
fatal: [ubun20-03]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}
fatal: [ubun20-02]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}
NO MORE HOSTS LEFT **********************************************************************************************************************************************************************************************************************
PLAY RECAP ******************************************************************************************************************************************************************************************************************************
localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ubun20-01 : ok=75 changed=0 unreachable=0 failed=0 skipped=92 rescued=0 ignored=0
ubun20-02 : ok=60 changed=0 unreachable=0 failed=1 skipped=79 rescued=0 ignored=0
ubun20-03 : ok=60 changed=0 unreachable=0 failed=1 skipped=79 rescued=0 ignored=0
Shell