Hello guys
I do use linux on local pc and selinux enabled, though there’s no context for the folders/files/etc
And I am getting following issue:
Recursion error when ansible trying to build the json it failed with.
I am getting it when I am trying to create directory using tempfile module, with parameters:
“invocation”: {
“module_args”: {
“path”: “/tmp/”,
“prefix”: “buildproject-Bk4mnluds1J6XoC28KyR0QzUgSVVpgSJBxQ7JlWf”,
“state”: “directory”,
“suffix”: “”
}
},
Traceback:
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 679, in selinux_context
self.fail_json(path=path, msg=‘failed to retrieve selinux context’)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1531, in fail_json
self._return_formatted(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1459, in _return_formatted
self.add_path_info(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1212, in add_path_info
kwargs[‘secontext’] = ‘:’.join(self.selinux_context(path))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 679, in selinux_context
self.fail_json(path=path, msg=‘failed to retrieve selinux context’)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1531, in fail_json
self._return_formatted(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1459, in _return_formatted
self.add_path_info(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1212, in add_path_info
kwargs[‘secontext’] = ‘:’.join(self.selinux_context(path))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 679, in selinux_context
self.fail_json(path=path, msg=‘failed to retrieve selinux context’)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1531, in fail_json
self._return_formatted(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1459, in _return_formatted
self.add_path_info(kwargs)
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 1212, in add_path_info
kwargs[‘secontext’] = ‘:’.join(self.selinux_context(path))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py”, line 674, in selinux_context
ret = selinux.lgetfilecon_raw(to_native(path, errors=‘surrogate_or_strict’))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/compat/selinux.py”, line 95, in lgetfilecon_raw
rc = _selinux_lib.lgetfilecon_raw(path, byref(con))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ctypes.ArgumentError: argument 1: RecursionError: maximum recursion depth exceeded
fatal: [127.0.0.1]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“path”: “/tmp/”,
“prefix”: “buildproject-Bk4mnluds1J6XoC28KyR0QzUgSVVpgSJBxQ7JlWf”,
“state”: “directory”,
“suffix”: “”
}
},
“msg”: “argument 1: RecursionError: maximum recursion depth exceeded”
}