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