I have set the
/etc/security/limits.conf is set set with:
* soft core unlimited
* hard core unlimited
to give all users permission to set coredump size.
when i an trying to run ansible code :
- name: Launch my code
shell:
python3 script.py
become: yes
become_user: AAA
content of the script.py:
import resource
resource.getrlimit(resource.RLIMIT_CORE)
resource.setrlimit(
resource.RLIMIT_CORE,
(resource.RLIM_INFINITY, resource.RLIM_INFINITY)
)
it failes
but when i connect to the remote host using ssh and connect then running:
sudo su
python3 script.py
the code works.
the difference that i found is that ansible connect to the remote host using:
sudo -i -u AAA /bin/bash
any idea how i can change the way ansible connects and uses the environment ?
both host and target are ubuntu 22.04