Closed vilu closed 5 years ago
Hello,
In order to run ansible, the machines (including the destination machines) need python and some basic modules.
"ImportError: No module named zipfile"
As per: https://stackoverflow.com/questions/46722521/i-deploy-my-project-by-ansible-i-always-get-the-error-importerror-no-module-n
try:
apt-get install sudo python-minimal python-setuptools
Would it make sense to add this in the playbook that it actually checks the state of this before and installs it if necessary?
If so I don't mind giving it a go. I might need some minor guidance though since I've never worked with Ansible before.
Well, these are Ansible prerequisites, not something that ansible itself can do. I suggest we close this one for now, hope all will go well once you set it up.
$ ansible-playbook -i hosts site.yml
PLAY [all] **
TASK [Install python2 for Ansible (usually required on ubuntu, which defaults to python3)] ** ok: [host1] ok: [host2]
TASK [setup] **** fatal: [host1]: FAILED! => {"changed": false, "module_stderr": "Shared connection to host1 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1555243336.45-116694223037840/setup.py\", line 17, in\r\n import zipfile\r\nImportError: No module named zipfile\r\n", "msg": "MODULE FAILURE", "rc": 1}
fatal: [host2]: FAILED! => {"changed": false, "module_stderr": "Shared connection to host2 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1555243336.45-241833399039407/setup.py\", line 17, in \r\n import zipfile\r\nImportError: No module named zipfile\r\n", "msg": "MODULE FAILURE", "rc": 1}
to retry, use: --limit @/home/vilu/code/infra/mono/ansible/kubeadm-playbook/site.retry
PLAY RECAP ** host2 : ok=1 changed=0 unreachable=0 failed=1
host1 : ok=1 changed=0 unreachable=0 failed=1