scrtipt_dist]# ansible-playbook dist.yml

PLAY [all] ******************************************************************************************************************************************************************

TASK [Gathering Facts] ******************************************************************************************************************************************************
fatal: [서버 아이피 ]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 서버 아이피closed.\r\n", "module_stdout": "  File \"/root/.ansible/tmp/ansible-tmp-1556259206.06-242213350336107/AnsiballZ_setup.py\", line 39\r\n    with open(module, 'wb') as f:\r\n            ^\r\nSyntaxError: invalid syntax\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
        to retry, use: --limit @/root/ansible/scrtipt_dist/dist.retry

PLAY RECAP ******************************************************************************************************************************************************************
1.234.83.50                : ok=0    changed=0    unreachable=0    failed=1    skipped=0  

 

 

위와같은 에러가 발생

 

원인은 파이썬 버전이 낮아서 그렇다고 한다.

엔서블 2.4 버전부터는 파이썬 2.4/2.5 버전에 대한 지원을 하지 않는다고 한다. 따라서 파이썬 2.6버전 이상으로 올려야 된다.

 

위의 내용까지가 구글링하면 깃헙이나 스택오버플로우에 나왔던 내용이다... 한글문서로도 있었고...

근데 클라이언트의 파이썬 버전까지 맞춰야하는줄은 몰랐다.

 

엔써블 처음 접할 때 클라이언트는 ssh 접속만 되면 된다했건만... 여튼...

클라이언트(cent5버전)에 yum 으로 파이썬 2.6 설치(기존 파이썬은 냅두고...)후

엔써블 옵션을 ansible_python_interpreter=/usr/bin/python2.6 추가하였더니 잘 된다.

'job > ansible' 카테고리의 다른 글

ansible 공부한 모듈들 정리  (0) 2019.05.02
ansible - 디렉토리 구조  (0) 2019.05.02
ansible-3 playbook  (0) 2019.04.25
ansible-2 hosts(그룹), 멱등성  (0) 2019.04.22
ansible-1  (0) 2019.04.10

+ Recent posts