Ansible python2 drop

Sbae·2024년 7월 31일
post-thumbnail

현재 k8s 클러스터 자동 프로비저닝 툴을 개발 중입니다.

에러가 생겼다

Ansible playbook을 테스트 하려는데 redhat 7계열, ubuntu2004 등
python3이 설치되지않은 곳에서 해당 에러가 생겼다.

TASK [Gathering Facts] *********************************************************
fatal: [worker-1]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "failed": true, "module_stderr": "/bin/sh: /usr/bin/python3: 그런 파일이나 디렉터리가 없습니다\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127, "warnings": ["No python interpreters found for host worker-1 (tried ['python3.12', 'python3.11', 'python3.10', 'python3.9', 'python3.8', 'python3.7', '/usr/bin/python3', 'python3'])"]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}
fatal: [master-1]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "failed": true, "module_stderr": "/bin/sh: /usr/bin/python3: 그런 파일이나 디렉터리가 없습니다\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127, "warnings": ["No python interpreters found for host master-1 (tried ['python3.12', 'python3.11', 'python3.10', 'python3.9', 'python3.8', 'python3.7', '/usr/bin/python3', 'python3'])"]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

뭐가 문제지?

최근에 한거라고는 ansible 버전을 올렸던거 말고는 건든게 없는데?

ansible --version
ansible [core 2.17.x]

그러면 버전을 내려볼까?

# 삭제하고
pip uninstall ansible
# 새로 설치하고
pip install ansible-core==2.16.5

ansible --version
ansible [core 2.16.5]

이게 되네?

Ansible이 2.17으로 넘어가면서 python2는 아예 지원이 안되게 Drop 해버린걸 찾을 수 있었다.

그럼 앞으로 ansible 버전을 올리면 새로운 노드에 클러스터를 프로비저닝한다면
python2가 기본적으로 깔린애들은 실행이 불가능한데 이러한 부분들을 해결하는 방법을 지금부터 생각해 놔야 할 것 같다.

profile
끄적이는 일반인

0개의 댓글