Foreman 1.24.3 ansible plugin calls a playbook as script on remote host

Problem:
Cannot run ansible role on fresh Foreman installation. It is acting like ssh command - runs on remote host (not smart proxy)

Expected outcome:
Run ansible-playbook on smart-proxy
Foreman and Proxy versions:
fresh install of 1.24.3 using foreman-installer on bionic (following foreman docs)
Foreman and Proxy plugin versions:
dpkg --list | grep ruby

Summary
ii  libruby2.5:amd64                      2.5.1-1ubuntu1.6                            amd64        Libraries necessary to run Ruby 2.5
ii  puppet-agent                          6.16.0-1bionic                              amd64        The Puppet Agent package contains all of the elements needed to run puppet, including ruby, facter, and hiera.
ii  rake                                  12.3.1-1ubuntu0.1                           all          ruby make-like utility
ii  ruby                                  1:2.5.1                                     amd64        Interpreter of object-oriented scripting language Ruby (default version)
ii  ruby-algebrick                        0.7.4-1                                     all          Algebraic types and pattern matching for Ruby
ii  ruby-ansi                             1.5.0-1                                     all          ANSI escape codes at your fingertips
ii  ruby-apipie-bindings                  0.3.0-1                                     all          Ruby bindings for Apipie documented APIs
ii  ruby-apipie-params                    0.0.5-1                                     all          DSL for describing data structures
ii  ruby-augeas                           1:0.5.0-3build6                             amd64        Augeas bindings for the Ruby language
ii  ruby-awesome-print                    1.8.0-1                                     all          pretty print Ruby objects with proper indentation and colors
ii  ruby-bcrypt-pbkdf                     1.0.0-1build2                               amd64        Ruby library for OpenBSD's bcrypt_pdkfd
ii  ruby-bundler                          1.16.1-1                                    all          Manage Ruby application dependencies (runtime)
ii  ruby-bundler-ext                      0.4.1-1                                     all          Load system gems via Bundler DSL
ii  ruby-clamp                            1.1.1-1                                     all          minimal framework for Ruby command-line utilities
ii  ruby-concurrent                       1.1.6+dfsg-2                                all          modern concurrency tools for Ruby
ii  ruby-dev:amd64                        1:2.5.1                                     amd64        Header files for compiling extension modules for Ruby (default version)
ii  ruby-did-you-mean                     1.2.0-2                                     all          smart error messages for Ruby > 2.3
ii  ruby-domain-name                      0.5.20160216-2                              all          Domain Name manipulation library for Ruby
ii  ruby-dynflow                          1.4.2-1                                     all          DYNamic workFLOW orchestration engine
ii  ruby-fast-gettext                     1.3.0-1                                     all          Fast GetText implementation for Ruby
ii  ruby-ffi                              1.9.10debian-1build4                        amd64        load dynamic libraries, bind functions from within ruby code
ii  ruby-foreman-ansible                  4.0.5-1                                     all          Foreman Ansible plugin
ii  ruby-foreman-deface                   1.5.3-1                                     all          Foreman Deface Plugin Dependency
ii  ruby-foreman-remote-execution         2.0.8-1                                     all          Foreman Remote Execution Plugin
ii  ruby-foreman-remote-execution-core    1.3.0-1                                     all          Foreman remote execution - core bits
ii  ruby-foreman-tasks                    0.17.6-1                                    all          Tasks management engine for Foreman.
ii  ruby-foreman-tasks-core               0.3.4-1                                     all          Foreman tasks - core bits
ii  ruby-gssapi                           1.2.0-1                                     all          FFI wrapper around the system GSSAPI library
ii  ruby-hammer-cli                       0.19.2-1                                    all          Universal command-line interface
ii  ruby-hammer-cli-foreman               0.19.7-1                                    all          Foreman commands for Hammer
ii  ruby-hashie                           3.5.5-2                                     all          small collection of tools that make hashes more powerful
ii  ruby-highline                         1.7.8-1                                     all          high-level interactive IO Ruby library
ii  ruby-http-cookie                      1.0.2-1                                     all          Ruby library to handle HTTP Cookies based on RFC 6265
ii  ruby-json                             2.1.0+dfsg-2                                amd64        JSON library for Ruby
ii  ruby-jwt                              2.2.1-1                                     all          JSON Web Token implementation in Ruby
ii  ruby-kafo                             4.0.0-1                                     all          Ruby gem for making installations based on puppet user friendly
ii  ruby-kafo-parsers                     1.0.0-1                                     all          Puppet module parsers
ii  ruby-kafo-wizards                     0.0.1-1                                     all          Wizard like interfaces in terminal
ii  ruby-libvirt                          0.7.0-1build2                               amd64        Ruby bindings for libvirt
ii  ruby-little-plugger                   1.1.4-1                                     all          module that provides Gem based plugin management
ii  ruby-locale                           2.1.2-1                                     all          Locale library for Ruby
ii  ruby-logging                          2.2.2-1                                     all          flexible and extendable logging library for Ruby
ii  ruby-mime-types                       3.1-1                                       all          guess MIME type of files
ii  ruby-mime-types-data                  3.2015.1120-1                               all          registry for information about MIME media type definitions
ii  ruby-minitest                         5.10.3-1                                    all          Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ii  ruby-molinillo                        0.6.4-1                                     all          generic dependency resolution algorithm
ii  ruby-multi-json                       1.12.1-1                                    all          Ruby library to provide easy switching between different JSON backends
ii  ruby-net-http-persistent              2.9.4-1                                     all          Manages persistent connections using Net::HTTP
ii  ruby-net-scp                          1.2.1-5                                     all          pure ruby implementation of the SCP protocol
ii  ruby-net-ssh                          1:4.2.0-2ubuntu1                            all          Ruby implementation of the SSH protocol
ii  ruby-net-telnet                       0.1.1-2                                     all          telnet client library
ii  ruby-netrc                            0.11.0-1                                    all          Ruby library to read and write netrc files
ii  ruby-oauth                            0.5.3-1                                     all          Ruby library for OAuth core
ii  ruby-oj:amd64                         3.4.0-1build1                               amd64        fast JSON parser and serializer for Ruby
ii  ruby-power-assert                     0.3.0-1                                     all          library showing values of variables and method calls in an expression
ii  ruby-powerbar                         1.0.18-1                                    all          progressbar library for Ruby
ii  ruby-rack                             1.6.4-4ubuntu0.1                            all          modular Ruby webserver interface
ii  ruby-rack-protection                  1.5.3-2+deb9u1build0.18.04.1                all          Protects against typical web attacks for Rack apps
ii  ruby-rb-inotify                       0.9.7-1                                     all          A Ruby wrapper for Linux's inotify, using FFI
ii  ruby-rbnacl                           5.0.0-3                                     all          Ruby binding to the Networking and Cryptography (NaCl) library
ii  ruby-rest-client                      2.0.2-3                                     all          simple REST client for Ruby
ii  ruby-rkerberos                        0.1.3-3                                     amd64        Kerberos binding for Ruby
ii  ruby-rsec                             0.4.2-1                                     all          Parser / Regexp Combinator For Ruby
ii  ruby-rubyipmi                         0.10.0-1                                    all          A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi
ii  ruby-sequel                           5.6.0-1                                     all          Simple, flexible, and powerful SQL database access toolkit for Ruby
ii  ruby-sinatra                          1.4.8-1                                     all          Ruby web-development dressed in a DSL
ii  ruby-smart-proxy-ansible              3.0.0-2                                     all          Ansible support for Foreman smart proxy
ii  ruby-smart-proxy-dynflow              0.2.4-1                                     all          Dynflow runtime for Foreman smart proxy
ii  ruby-smart-proxy-dynflow-core         0.2.4-1                                     all          Dynflow runtime for Foreman smart proxy
ii  ruby-smart-proxy-remote-execution-ssh 0.2.1-1                                     all          SSH remote execution provider for Foreman smart proxy
ii  ruby-sqlite3                          1.3.13-1build2                              amd64        SQLite3 interface for Ruby
ii  ruby-test-unit                        3.2.5-1                                     all          unit testing framework for Ruby
ii  ruby-thor                             0.19.4-1                                    all          Ruby scripting framework
ii  ruby-tilt                             2.0.1-2                                     all          Generic interface to multiple Ruby template engines
ii  ruby-unf                              0.1.4-2                                     all          Wrapper library to bring Unicode Normalization Form support to Ruby
ii  ruby-unf-ext                          0.0.7.4-1build2                             amd64        Unicode Normalization Form support library for CRuby
ii  ruby-unicode                          0.4.4-2build8                               amd64        Unicode string manipulation library for Ruby
ii  ruby-unicode-display-width            1.1.3-1                                     all          Determines the monospace display width of a string in Ruby
ii  ruby-xmlrpc                           0.3.0-2                                     all          XMLRPC library for Ruby
ii  ruby2.5                               2.5.1-1ubuntu1.6                            amd64        Interpreter of object-oriented scripting language Ruby
ii  ruby2.5-dev:amd64                     2.5.1-1ubuntu1.6                            amd64        Header files for compiling extension modules for the Ruby 2.5
ii  ruby2.5-doc                           2.5.1-1ubuntu1.6                            all          Documentation for Ruby 2.5
ii  rubygems-integration                  1.11                                        all          integration of Debian Ruby packages with Rubygems

Distribution and version:
Ubuntu server 18.04 Bionic
Other relevant data:
Here is the log where you can see tha playbook was copied to Provisioned host and run as a script (!) . I have verified it acts exactly the same as if I run a job Run Command - SSH Default
smart proxy logs:
2020-07-02T11:45:16 [D] opening session to root@00000000-0000-0000-ffff-000000029175.bic.local
2020-07-02T11:45:16 f3dca61e [I] Finished POST /dynflow/tasks/ with 200 (21.36 ms)
2020-07-02T11:45:16 [D] close: 192.168.168.105:59294
2020-07-02T11:45:17 [D] Sending data to /var/tmp/foreman-ssh-cmd-0a6927e3-cf7f-48e3-a7e4-ca9455af23e7/script on remote host:
---
- hosts: all
gather_facts: no
pre_tasks:
- name: Display all parameters known for the Foreman host
debug:
var: foreman
tasks:
- name: Apply roles
include_role:
name: "{{ role }}"
loop: "{{ foreman_ansible_roles }}"
loop_control:
loop_var: role
2020-07-02T11:45:17 [D] executing script:
| sh <<WRAPPER
| (/var/tmp/foreman-ssh-cmd-0a6927e3-cf7f-48e3-a7e4-ca9455af23e7/script < /dev/null; echo \$?>/var/tmp/foreman-ssh-cmd-0a6927e3-cf7f-48e3-a7e4-ca9455af23e7/exit_code) | /usr/bin/tee /var/tmp/foreman-ssh-cmd-0a6927e3-cf7f-48e3-a7e4-ca9455af23e7/output
| exit \$(cat /var/tmp/foreman-ssh-cmd-0a6927e3-cf7f-48e3-a7e4-ca9455af23e7/exit_code)
| WRAPPER

2020-07-02T11:45:17  [D] refresh runner 0a6927e3-cf7f-48e3-a7e4-ca9455af23e7
2020-07-02T11:45:17  [D] refreshing runner
2020-07-02T11:45:17  [D] planning to refresh 0a6927e3-cf7f-48e3-a7e4-ca9455af23e7
2020-07-02T11:45:18  [D] Ticker ticking for 1 events
2020-07-02T11:45:18  [D] refresh runner 0a6927e3-cf7f-48e3-a7e4-ca9455af23e7
2020-07-02T11:45:18  [D] refreshing runner
2020-07-02T11:45:18  [D] finish runner 0a6927e3-cf7f-48e3-a7e4-ca9455af23e7
2020-07-02T11:45:18  [D] closing session for command [0a6927e3-cf7f-48e3-a7e4-ca9455af23e7],0 actors left
2020-07-02T11:45:18  [D] terminate 0a6927e3-cf7f-48e3-a7e4-ca9455af23e7
2020-07-02T11:45:18  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 2 got event #<ForemanTasksCore::Runner::Update:0x000055e1c3f13b28>
2020-07-02T11:45:18  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 2 suspended >>   running in phase      Run ForemanRemoteExecutionCore::Actions::RunScript
2020-07-02T11:45:18  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 2   running >>   success in phase      Run ForemanRemoteExecutionCore::Actions::RunScript
2020-07-02T11:45:18  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 5   pending >>   running in phase      Run SmartProxyDynflowCore::Callback::Action
2020-07-02T11:45:19  [D] Executor heartbeat
2020-07-02T11:45:21  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 5   running >>   success in phase      Run SmartProxyDynflowCore::Callback::Action
2020-07-02T11:45:21  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 3   pending >>   running in phase Finalize ForemanRemoteExecutionCore::Actions::RunScript
2020-07-02T11:45:21  [E] Script execution failed
2020-07-02T11:45:21  [D]          Step ef1ddb3a-8831-4db1-90bc-c0c2734e7eac: 3   running >>     error in phase Finalize ForemanRemoteExecutionCore::Actions::RunScript
2020-07-02T11:45:21  [D] ExecutionPlan ef1ddb3a-8831-4db1-90bc-c0c2734e7eac      running >>   stopped

Hi,
that is most likely caused by not having ruby-foreman-ansible-core installed.

Hi Adam,
thanks for quick reply. What is the proper way of installing ruby-foreman-ansible-core ?
I have installed everything using foreman-installer so far.
Installation using apt is not working

`apt install ruby-foreman-ansible-core`
`Reading package lists... Done`
`Building dependency tree`

Reading state information... Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
ruby-foreman-ansible-core
0 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
Need to get 0 B/8200 B of archives.
After this operation, 47.1 kB of additional disk space will be used.
(Reading database ... 172408 files and directories currently installed.)
Preparing to unpack .../ruby-foreman-ansible-core_3.0.1-1_all.deb ...
Unpacking ruby-foreman-ansible-core (3.0.1-1) ...
dpkg: error processing archive /var/cache/apt/archives/ruby-foreman-ansible-core_3.0.1-1_all.deb (--unpack):
trying to overwrite '/usr/bin/json_inventory.sh', which is also in package ruby-smart-proxy-ansible 3.0.0-2
Errors were encountered while processing:
/var/cache/apt/archives/ruby-foreman-ansible-core_3.0.1-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I’m not a debian/ubuntu person, but isn’t there some flag you could use to force the installation? The conflicting file is actually the same in both of the packages

I can force the install, but I guess it is not a proper way. There is a foreman-installer package which cannot bring you working Foreman with ansible unless you do some tweaks with apt install :frowning: . I was asking if there is some parameter for foreman-installer which would install foreman-ansible-core itself.
Anyway thanks for your help

There is still an error with dynflow. Any hints, please ?

2020-07-02T14:15:25  [D]          Step 36ae864a-d83a-4e01-80be-874b3363e4e6: 2   pending >>   running in phase      Run ForemanTasksCore::BatchRunnerAction
2020-07-02T14:15:25  [W] Error details
TypeError: no implicit conversion of Dynflow::Utils::IndifferentHash into String
/usr/lib/ruby/vendor_ruby/json/common.rb:156:in `initialize'
/usr/lib/ruby/vendor_ruby/json/common.rb:156:in `new'
/usr/lib/ruby/vendor_ruby/json/common.rb:156:in `parse'
/usr/lib/ruby/vendor_ruby/foreman_ansible_core/runner/ansible_runner.rb:123:in `block in rebuild_inventory'
/usr/lib/ruby/vendor_ruby/foreman_ansible_core/runner/ansible_runner.rb:123:in `map'
/usr/lib/ruby/vendor_ruby/foreman_ansible_core/runner/ansible_runner.rb:123:in `rebuild_inventory'
/usr/lib/ruby/vendor_ruby/foreman_ansible_core/runner/ansible_runner.rb:8:in `initialize'
/usr/lib/ruby/vendor_ruby/foreman_tasks_core/batch_runner_action.rb:11:in `new'
/usr/lib/ruby/vendor_ruby/foreman_tasks_core/batch_runner_action.rb:11:in `initiate_runner'
/usr/lib/ruby/vendor_ruby/foreman_tasks_core/runner/action.rb:40:in `init_run'
/usr/lib/ruby/vendor_ruby/foreman_tasks_core/runner/action.rb:10:in `run'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:563:in `block (3 levels) in execute_run'
/usr/lib/ruby/vendor_ruby/dynflow/middleware/stack.rb:27:in `pass'
/usr/lib/ruby/vendor_ruby/dynflow/middleware.rb:19:in `pass'
/usr/lib/ruby/vendor_ruby/dynflow/action/progress.rb:31:in `with_progress_calculation'
/usr/lib/ruby/vendor_ruby/dynflow/action/progress.rb:17:in `run'
/usr/lib/ruby/vendor_ruby/dynflow/middleware/stack.rb:23:in `call'
/usr/lib/ruby/vendor_ruby/dynflow/middleware/stack.rb:27:in `pass'
/usr/lib/ruby/vendor_ruby/dynflow/middleware.rb:19:in `pass'
/usr/lib/ruby/vendor_ruby/dynflow/middleware.rb:32:in `run'
/usr/lib/ruby/vendor_ruby/dynflow/middleware/stack.rb:23:in `call'
/usr/lib/ruby/vendor_ruby/dynflow/middleware/world.rb:31:in `execute'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:562:in `block (2 levels) in execute_run'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:561:in `catch'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:561:in `block in execute_run'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:475:in `block in with_error_handling'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:475:in `catch'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:475:in `with_error_handling'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:556:in `execute_run'
/usr/lib/ruby/vendor_ruby/dynflow/action.rb:285:in `execute'
/usr/lib/ruby/vendor_ruby/dynflow/execution_plan/steps/abstract_flow_step.rb:18:in `block (2 levels) in execute'
/usr/lib/ruby/vendor_ruby/dynflow/execution_plan/steps/abstract.rb:167:in `with_meta_calculation'
/usr/lib/ruby/vendor_ruby/dynflow/execution_plan/steps/abstract_flow_step.rb:17:in `block in execute'
/usr/lib/ruby/vendor_ruby/dynflow/execution_plan/steps/abstract_flow_step.rb:32:in `open_action'
/usr/lib/ruby/vendor_ruby/dynflow/execution_plan/steps/abstract_flow_step.rb:16:in `execute'
/usr/lib/ruby/vendor_ruby/dynflow/director.rb:68:in `execute'
/usr/lib/ruby/vendor_ruby/dynflow/executors/parallel/worker.rb:15:in `block in on_message'
/usr/lib/ruby/vendor_ruby/dynflow/executors.rb:12:in `run_user_code'
/usr/lib/ruby/vendor_ruby/dynflow/executors/parallel/worker.rb:14:in `on_message'
/usr/lib/ruby/vendor_ruby/concurrent/actor/context.rb:46:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/executes_context.rb:7:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/dynflow/actor.rb:106:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/awaits.rb:15:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/sets_results.rb:14:in `on_envelope'
/usr/lib/ruby/vendor_ruby/dynflow/actor.rb:47:in `block in on_envelope'
/usr/lib/ruby/vendor_ruby/dynflow/actor.rb:59:in `with_backtrace'
/usr/lib/ruby/vendor_ruby/dynflow/actor.rb:47:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/buffer.rb:38:in `process_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/buffer.rb:31:in `process_envelopes?'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/buffer.rb:20:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/termination.rb:55:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/removes_child.rb:10:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/abstract.rb:25:in `pass'
/usr/lib/ruby/vendor_ruby/concurrent/actor/behaviour/sets_results.rb:14:in `on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/core.rb:162:in `process_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/core.rb:96:in `block in on_envelope'
/usr/lib/ruby/vendor_ruby/concurrent/actor/core.rb:119:in `block (2 levels) in schedule_execution'
/usr/lib/ruby/vendor_ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
/usr/lib/ruby/vendor_ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/usr/lib/ruby/vendor_ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/usr/lib/ruby/vendor_ruby/concurrent/actor/core.rb:116:in `block in schedule_execution'
/usr/lib/ruby/vendor_ruby/concurrent/executor/serialized_execution.rb:18:in `call'
/usr/lib/ruby/vendor_ruby/concurrent/executor/serialized_execution.rb:96:in `work'
/usr/lib/ruby/vendor_ruby/concurrent/executor/serialized_execution.rb:77:in `block in call_job'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:353:in `run_task'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:342:in `block (3 levels) in create_worker'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `loop'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `block (2 levels) in create_worker'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `catch'
/usr/lib/ruby/vendor_ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `block in create_worker'
/usr/lib/ruby/vendor_ruby/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2020-07-02T14:15:25  [E] no implicit conversion of Dynflow::Utils::IndifferentHash into String (TypeError)
2020-07-02T14:15:25  [D]          Step 36ae864a-d83a-4e01-80be-874b3363e4e6: 2   running >>   success in phase      Run ForemanTasksCore::BatchRunnerAction
2020-07-02T14:15:25  [D] ExecutionPlan b884970f-b40f-4cff-a6ad-98c54704a2e1      planned >>   running
2020-07-02T14:15:25 92d37ade [I] Finished POST /dynflow/tasks/launch with 200 (68.13 ms)
2020-07-02T14:15:25  [D]          Step b884970f-b40f-4cff-a6ad-98c54704a2e1: 2   pending >>   running in phase      Run ForemanTasksCore::SingleRunnerBatchAction
2020-07-02T14:15:25  [D]          Step b884970f-b40f-4cff-a6ad-98c54704a2e1: 2   running >> suspended in phase      Run ForemanTasksCore::SingleRunnerBatchAction
2020-07-02T14:15:25  [D]          Step 36ae864a-d83a-4e01-80be-874b3363e4e6: 3   pending >>   running in phase Finalize ForemanTasksCore::BatchRunnerAction
2020-07-02T14:15:25  [E] Script execution failed
2020-07-02T14:15:25  [D]          Step 36ae864a-d83a-4e01-80be-874b3363e4e6: 3   running >>     error in phase Finalize ForemanTasksCore::BatchRunnerAction
2020-07-02T14:15:25  [D] ExecutionPlan 36ae864a-d83a-4e01-80be-874b3363e4e6      running >>   stopped
2020-07-02T14:15:25  [D] close: 192.168.168.105:47464

[/details]

It stucks at 25% forever and the task is not run inside provisioned host.