Problem:
I upgraded our foreman+katello from version 1.20.2 to 1.22 (1.20.2->1.21.3->1.22.0) and after the upgrade the ansible callback is not working anymore (also if used as a recurring logics)
All the VM are out of sync or in error state.
Previously the job was running properly since last August 2018.
Expected outcome:
When I run an ansible roles (callback) the execution will work.
Foreman and Proxy versions:
Foreman 1.2.0
Katello 3.12
Foreman and Proxy plugin versions:
Ansible plugin 3.0.2
Ansible 2.8.0/python 2.7.5
Other relevant data:
Our callback job template, who was working on 1.18/1.19/1.20.x, is:
---
- hosts: all
tasks:
- name: Display all parameters known for the Foreman host
debug:
var: foreman_params
roles:
<%- if @host.all_ansible_roles.present? -%>
<%= @host.all_ansible_roles.map { |role| " - #{role.name.strip}" }.join("\n") %>
<%- end -%>
When I run a “Play Ansible Roles” it failed and the log is:
2019-06-14T15:39:09 [I|app|722580a9] Current user set to admin (admin)
2019-06-14T15:39:09 [I|app|722580a9] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.7.0/app/views/job_invocations/show.js.erb
2019-06-14T15:39:09 [I|app|f8fd5d37] Started POST "/foreman_tasks/api/tasks/callback" for 10.140.16.230 at 2019-06-14 15:39:09 +0100
2019-06-14T15:39:09 [I|app|f8fd5d37] Processing by ForemanTasks::Api::TasksController#callback as */*
2019-06-14T15:39:09 [I|app|f8fd5d37] Parameters: {"callback"=>{"task_id"=>"fc661d82-591a-4971-ba7e-31523b1902ac", "step_id"=>3}, "data"=>{"result"=>[{"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 1: ---: command not found\r\n", "timestamp"=>1560523149.5836625}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 2: -: command not found\r\n", "timestamp"=>1560523149.5838606}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 3: tasks:: command not found\r\n", "timestamp"=>1560523149.5841339}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 4: -: command not found\r\n", "timestamp"=>1560523149.5851808}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 5: debug:: command not found\r\n", "timestamp"=>1560523149.5855129}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 6: var:: command not found\r\n", "timestamp"=>1560523149.5857708}, {"output_type"=>"stdout", "output"=>"/var/tmp/foreman-ssh-cmd-31f1e247-044d-4dad-a8fb-632b9852c8ff/script: line 7: roles:: command not found\r\n", "timestamp"=>1560523149.5859997}], "runner_id"=>"31f1e247-044d-4dad-a8fb-632b9852c8ff", "exit_status"=>127}, "task"=>{}}
2019-06-14T15:39:09 [I|app|722580a9] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.7.0/app/views/job_invocations/_host_status_td.html.erb (1.2ms)
2019-06-14T15:39:09 [I|app|722580a9] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.7.0/app/views/job_invocations/show.js.erb (64.4ms)
2019-06-14T15:39:09 [I|app|722580a9] Completed 200 OK in 135ms (Views: 57.6ms | ActiveRecord: 26.9ms
It seems foreman or katello is no more able to use that template.