Description of problem: Ansible temporary files are not removed from the /tmp directory when running ansible job roles via remote execution on Satellite 6.7. Version-Release number of selected component (if applicable): Satellite 6.6+ How reproducible: Run the Ansible Job template on the Satellite 6.6 against the Satellite Clients. Steps to Reproduce: 1. Hosts > Job Template > Ansible Roles - Ansible Default > Run 2. Select some hosts via Search Query 3. Submit Actual results: The temporary ansible-files are not removed from the TMP directory, in some cases where the remote execution is used many times the file system that the /tmp is mounted is growing up. Expected results: This file would be removed after the task finishes. Additional info: ### From Satellite 6.6 ~~~ [root@sat66b ~]# ls -lht /tmp |grep foreman-proxy | head drwxr-xr-x. 2 foreman-proxy foreman-proxy 24K May 19 13:54 foreman-inventories -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-a395c352-43ce-4c99-83c9-2aaffefffddf.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-bae7e93b-ab43-4ca5-850b-5e38abce697c.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-4c24f7da-3efd-4481-8917-08d0e7793964.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-ccde61f5-3395-4392-871c-40889a6a03be.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-65a7c49d-7ab3-4877-be5d-21240a31df25.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-41f59b9b-2fb2-4c22-8daa-86edccbb3bbf.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-76f64005-a025-4f1b-938a-f1cf65b3dcf5.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-3585cf90-d073-428a-a54a-cba244cf9918.yml -rw-r--r--. 1 foreman-proxy foreman-proxy 150 May 19 13:54 foreman-playbook-eba18bf5-b674-4f4c-b90d-b36f38cab0cb.yml [root@sat66b ~]# ls -lht /tmp |grep foreman-proxy | wc -l ~~~ ### From Satellite 6.7 ~~~ [root@sat67a ~]# ls -lht /tmp | grep foreman-proxy drwx------. 5 foreman-proxy foreman-proxy 67 May 19 13:45 d20200519-20798-bo32v drwx------. 5 foreman-proxy foreman-proxy 67 May 19 13:45 d20200519-20798-8m3wmo drwx------. 5 foreman-proxy foreman-proxy 67 May 19 13:44 d20200519-20798-1g197z0 ~~~
Created redmine issue https://projects.theforeman.org/issues/30518 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30518 has been resolved.
FailedQA. @Satellite 6.8.0 Snap16 tfm-rubygem-foreman_ansible_core-3.0.3-1.el7sat.noarch by the following reproducer: 1) Monitor /tmp directory for foreman-proxy content: # watch "ls -lt /tmp | grep foreman-proxy" 2) Run ansible REX command "sleep 60" against a host while monitoring /tmp directory Before run: <empty> During run: drwx------. 3 foreman-proxy foreman-proxy 29 Sep 21 19:06 ansible-local-186745lJmoV drwx------. 5 foreman-proxy foreman-proxy 67 Sep 21 19:06 d20200921-2455-19kslzo After run: drwx------. 5 foreman-proxy foreman-proxy 67 Sep 21 19:06 d20200921-2455-19kslzo >>> d<date>-* dirs are not deleted
Oops. The fix is not present, rel-eng failure: # grep -A3 'def close' /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible_core-*/lib/foreman_ansible_core/runner/ansible_runner.rb <empty> I miss these lines being added: --- def close super FileUtils.remove_entry(@root) if @tmp_working_dir end ---
Hey Guys, Thank you for working hard on this BZ, we appreciate it. Working on further case issues, we had the necessity to use those files to troubleshoot some ansible-runner/execution issues. Is there a possibility to add an option on the Satellite settings to keep those files? Like an option to debug those files if we need it. regards rbertol
Hi rberol, unfortunatelly this is not possible as of now. Could you please create separate BZ for that?
Hey Ondřej, We have filled the RFE https://bugzilla.redhat.com/show_bug.cgi?id=1915394 requesting this new feature. Thank you. rbertol
VERIFIED. @Satellite 6.9.0 Snap13 tfm-rubygem-foreman_ansible_core-4.0.0-1.el7sat.noarch by the following reproducer: 1) Monitor /tmp directory for foreman-proxy content: # watch "ls -lt /tmp | grep foreman-proxy" 2) Run ansible REX command "sleep 60" against a host while monitoring /tmp directory Before run: <empty> During run: drwx------. 3 foreman-proxy foreman-proxy 29 Feb 15 07:26 ansible-local-285640GtC4z drwx------. 5 foreman-proxy foreman-proxy 67 Feb 15 07:26 d20210215-10703-1uz4wsf After run: <empty> >>> temporary working dirs are deleted after the job finished
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:1313