Description of problem: [Satellite 6.3] 'ansible_provisioning_callback snippet' does not set executable permission for '/root/ansible_provisioning_call.sh' Version-Release number of selected component (if applicable): Red Hat Satellite 6.3 How reproducible: Always Steps to Reproduce: 1. on GUI see the below in snippet "ansible_provisioning_callback": --------------- <% else -%> # Assume systemd is not available <%= save_to_file('/root/ansible_provisioning_call.sh', snippet('ansible_tower_callback_script')) %> (crontab -u root -l 2>/dev/null; echo "@reboot /root/ansible_provisioning_call.sh" ) | crontab -u root - <% end -%> <% end -%> --------------- In above creating the "/root/ansible_provisioning_call.sh" but without executable permission due to which after reboot cron get run but without success. Actual results: File create without executable permission. Expected results: File should create with executable permission: e.g. snippet ----------------- <% else -%> # Assume systemd is not available <%= save_to_file('/root/ansible_provisioning_call.sh', snippet('ansible_tower_callback_script')) %> (chmod +x /root/ansible_provisioning_call.sh;crontab -u root -l 2>/dev/null; echo "@reboot /root/ansible_provisioning_call.sh" ) | crontab -u root - <==== ----------------- Additional info:
Quickly looking at that, it seems the chmod is there but can fail for some reason. My guess is that the ansible_tower_callback_script does not render \n at the end, could you please ask customer to "Preview" the template for some host, so we get rendered version on his environment? Thanks
Created redmine issue https://projects.theforeman.org/issues/24981 from this bug
Sent a fix upstream for review, the chmod needs to be added explicitly.
Upstream bug assigned to mhulan
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24981 has been resolved.
This issue is not Satellite 6.3 specific therefore omitting "[Satellite 6.3]" from BZ title One can expect this BZ to be cloned for other Satellite versions as well (depends on triage team)
VERIFIED. @satellite-6.5.0-5.beta.el7sat.noarch foreman-1.20.1-1.el7sat.noarch by following manual reproducer: 1) Provision RHEL6 host with Host Parameter "ansible_tower_provisioning = true" 2) At provisioned RHEL6 host check /root/ansible_provisioning_call.sh file perms # ls -l /root/ansible_provisioning_call.sh -rwxr-xr-x. 1 root root 171 Dec 11 17:57 /root/ansible_provisioning_call.sh >>> ansible provisioning callback script has executable permission set
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, 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-2019:1222