Ansible trouble running

Hi,
I have new foreman installation on Ubuntu 18.
Remote ssh is running ok.
but when I try to use Ansible, for example a simple task as Remote action: Package vim: present with Ansible, it fails and I don’t understand why.
The logs are not clear for me.
In dynflow console I get:
proxy_output:
result:
- output_type: stdout
output: “/var/tmp/foreman-ssh-cmd-ebd263f5-7f50-47eb-af0e-47cffe2b88c1/script:
2: /var/tmp/foreman-ssh-cmd-ebd263f5-7f50-47eb-af0e-47cffe2b88c1/script: —:
not found\r\n/var/tmp/foreman-ssh-cmd-ebd263f5-7f50-47eb-af0e-47cffe2b88c1/script:
3: /var/tmp/foreman-ssh-cmd-ebd263f5-7f50-47eb-af0e-47cffe2b88c1/script: -:
not found\r\n”

in input I have:
ansible_connection: ssh
ansible_ssh_private_key_file: “~/.ssh/id_rsa_foreman_proxy”
ansible_winrm_server_cert_validation: validate
ansible_user: philippe
ansible_become_method: sudo
ansible_port: ‘22’
ansible_host: tin.rtech
ansible_become_user: root
ansible_become: true
ansible_ssh_port: ‘22’
ansible_ssh_user: philippe
remote_execution_ssh_user: philippe
remote_execution_effective_user_method: sudo

Thanks

Apparently it is trying to execute the playbook as if it was a shell script. Could you make sure you have the ruby-foreman-ansible-core package installed?

Thanks,
yes I have , I had to remove ruby-smart-proxy-ansible to have it, but I still get the error

I have this bug Bug #24879: ruby-foreman-ansible-core '/usr/lib/ruby/vendor_ruby/foreman_ansible_core.rb' conflicts with ruby-smart-proxy-ansible - Ansible - Foreman
I can’t have ruby-smart-proxy-ansible and ruby-foreman-ansible-core
but foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible
insist to have ruby-smart-proxy-ansible

fresh foreman install on ubuntu 18 with ansible plugin:

sudo foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible --enable-foreman-plugin-remote-execution --enable-foreman-proxy-plugin-remote-execution-ssh

leads to use ansible-playbook as ssh cmd, foreman-proxy log:

2020-09-17T14:47:06  [D] start runner 04ef9a29-82a5-4fc8-bec4-3bcde166d80a
2020-09-17T14:47:06  [D] copying script to /var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/script:
  | ---
  | - hosts: all
  |   remote_user: root
  |   tasks:
  |     - name: test connection
  |       ping:
  |       remote_user: root
2020-09-17T14:47:06  [D] opening session to root@foreman.tpondemand.net
2020-09-17T14:47:06  [D] Sending data to /var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/script on remote host:
---
- hosts: all
  remote_user: root
  tasks:
    - name: test connection
      ping:
      remote_user: root
2020-09-17T14:47:06  [D] executing script:
  | sh <<WRAPPER
  | (/var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/script < /dev/null; echo \$?>/var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/exit_code) | /usr/bin/tee /var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/output
  | exit \$(cat /var/tmp/foreman-ssh-cmd-04ef9a29-82a5-4fc8-bec4-3bcde166d80a/exit_code)
  | WRAPPER

and it’s doesn’t work. Do you know how to fix it on ubuntu18? Please help.