Первоначально при выполнении ansible playbook для запуска на сервере я получал следующую ошибку
/usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<171.16.3.112> (1, '', 'Traceback (most recent call last):\n File "<stdin>", line 133, in ?\n File "<stdin>", line 38, in invoke_module\n File "/usr/lib64/python2.4/subprocess.py", line 1050, in communicate\n stdout, stderr = self._communicate_with_poll(input)\n File "/usr/lib64/python2.4/subprocess.py", line 1113, in _communicate_with_poll\n input_offset += os.write(fd, chunk)\nOSError: [Errno 32] Broken pipe\n')
The full traceback is:
Traceback (most recent call last):
File "<stdin>", line 133, in ?
File "<stdin>", line 38, in invoke_module
File "/usr/lib64/python2.4/subprocess.py", line 1050, in communicate
stdout, stderr = self._communicate_with_poll(input)
File "/usr/lib64/python2.4/subprocess.py", line 1113, in _communicate_with_poll
input_offset += os.write(fd, chunk)
OSError: [Errno 32] Broken pipe
fatal: [171.16.3.112]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 133, in ?\n File \"<stdin>\", line 38, in invoke_module\n File \"/usr/lib64/python2.4/subprocess.py\", line 1050, in communicate\n stdout, stderr = self._communicate_with_poll(input)\n File \"/usr/lib64/python2.4/subprocess.py\", line 1113, in _communicate_with_poll\n input_offset += os.write(fd, chunk)\nOSError: [Errno 32] Broken pipe\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 1
}
to retry, use: --limit @/root/ansible-setup/users.retry
PLAY RECAP ********************************************************************************************************************************************************************************************************
171.16.3.112 : ok=0 changed=0 unreachable=0 failed=1
Поэтому я решил исправить эту проблему, обновив версию Python на сервере 171.16.3.112 с версии 2.4.От 3 до 2.7.5
Я следовал: https://techglimpse.com/linux-how-to-upgrade-python-2-4-to-2-7-or-higher-manually/
После завершения обновления теперь, когда я выполняю ansible, я получаю эту ошибку:
"insertbefore": null,
"line": "%users ALL=(isas1) NOPASSWD: ALL",
"mode": null,
"owner": null,
"path": "/etc/sudoers",
"regexp": "^%users",
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "present",
"unsafe_writes": null,
"validate": null
}
},
"msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"
}
to retry, use: --limit @/root/ansible-setup/users.retry
PLAY RECAP ********************************************************************************************************************************************************************************************************
171.16.3.112 : ok=2 changed=0 unreachable=0 failed=1
Я пыталсяyum установить libselinux-python, но это не сработало.
Есть предложения, пожалуйста?