Skip to content
SSH remote execution provider for Foreman smart proxy
Branch: master
Clone or download
mvollmer and iNecas Fixes #26958 - ssh/session: Don't use a closed, hijacked socket
This avoids spurious error messages when Webrick tries to use a closed
socket.  The error itself seems to be harmless, but it makes it into
the log file as a backtrace, which is misleading.
Latest commit a72da5e Apr 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Record the timestamp of the lines Jul 16, 2015
bundler.plugins.d Refs #16438 - extract code to foreman-remote-execution Sep 8, 2016
lib Fixes #26958 - ssh/session: Don't use a closed, hijacked socket Jun 10, 2019
settings.d Fixes #16991 - Mention general log level relation Mar 19, 2018
test Do not use mocha methods outside of tests May 22, 2018
.gitignore Fixes #14901 - Separate dynflow parts Jun 1, 2016
.rubocop.yml Enable rubocop Jul 29, 2015
Gemfile
LICENSE Basic plugin structure Jul 16, 2015
README.md Refs #16438 - extract code to foreman-remote-execution Sep 8, 2016
Rakefile Refs #16438 - extract code to foreman-remote-execution Sep 8, 2016
smart_proxy_remote_execution_ssh.gemspec Refs #26110 - replace monkey patching with wrapper classes Apr 24, 2019

README.md

Build Status Gem Version Code Climate GPL License

Smart-proxy Ssh plugin

This a plugin for foreman smart-proxy allowing using ssh for the remote execution

Installation

Add this line to your smart proxy bundler.d/ssh.rb gemfile:

gem 'smart_proxy_dynflow', :git => 'https://github.com/theforeman/smart_proxy_dynflow.git'
gem 'smart_proxy_dynflow_core', :git => 'https://github.com/theforeman/smart_proxy_dynflow.git'
gem 'foreman_remote_execution_core', :git => 'https://github.com/theforeman/foreman_remote_execution.git'
gem 'smart_proxy_remote_execution_ssh', :git => 'https://github.com/theforeman/smart_proxy_remote_execution_ssh.git'

Enable the plugins in your smart proxy:

cat > config/settings.d/dynflow.yml <<EOF
---
:enabled: true
EOF

cat > config/settings.d/remote_execution_ssh.yml <<EOF
---
:enabled: true
EOF

Install the dependencies

$ bundle

Usage

To configure this plugin you can use template from settings.d/remote_execution_ssh.yml.example. You must place remote_execution_ssh.yml config file (based on this template) to your smart-proxy config/settings.d/ directory.

Also, you need to have the dynflow plugin enabled to be able to trigger the tasks.

The simplest thing one can do is just to trigger a command:

curl http://my-proxy.example.com:9292/dynflow/tasks \
      -X POST -H 'Content-Type: application/json'\
      -d '{"action_name":  "Proxy::RemoteExecution::Ssh::CommandAction",
           "action_input": {"task_id" : "1234'$RANDOM'",
                            "script": "/usr/bin/ls",
                            "hostname": "localhost",
                            "effective_user": "root"}}'
You can’t perform that action at this time.