Here it is ANSIBLE_KEEP_REMOTE_FILES=1 ansible localhost -m tempfile -a "path=/tmp/ prefix=buildproject state=directory" -vvv And I debugged it, it's not able to get data about selinux context because it's not set, it's triggering OSError with code 61. and then it's trying to build up json about failure and it's simply get to the recursion....
понеділок, 12 лютого 2024 р. о 00:36:59 UTC+1 Rilindo Foster пише: > That is gnarly. > > Can you provide the play code that attempted to perform this operation? > > Rilindo > > On Feb 11, 2024, at 5:30 PM, Sergey Glazyrin <[email protected]> > wrote: > > 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" > } > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/67c6896e-8cd1-455b-af11-280f666d2bfbn%40googlegroups.com > > <https://groups.google.com/d/msgid/ansible-project/67c6896e-8cd1-455b-af11-280f666d2bfbn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/14d47271-0e41-4499-919c-47667b87cd9dn%40googlegroups.com.
