Installing foreman from source

Greeting all,

issue: Not sure how to install Plugins after installing foreman from source.

I followed the steps to install Foreman from source:

git clone https://github.com/theforeman/foreman.git -b 1.19-stable etc…

But the instructions to install a plugin after foreman from source is up and running a vague as to where to create the directory to clone the plugin.

Does the the directory need to be a sub directory of the foreman cloned directory or do I create it outside the foreman cloned directory?

I appreciate any help.

To add a plugin, you need to add it to a gemfile inside the bundler.d folder indicating the path to the file. For example, create a file Gemfile.local.rb containing:

gem 'foreman-tasks', :path => '/home/tbrisker/gits/foreman-tasks'

You can clone the source of the plugin to any place you wish, just be sure to indicate the correct path and run bundle install after updating the file.

You can also use plugins as a gem from rubygems or from source in github if you don’t want to modify them:

gem 'foreman_ansible' # will install foreman_ansible gem from rubygems
gem 'foreman_discovery', :git => "https://github.com/theforeman/foreman_discovery.git" # will install discovery direct from github
1 Like

Hi tbrisker,

Thank you for the help. I’m still learning Ruby on Rails so appreiciate the help.

Where would you like to find this information do you don’t have to ask? And if the answer is manual, would you mind updating it? We tried to keep manual isolated from plugins, but this would probably be a good addition.

Hi Mark,

I would be happy to help updating the manual. it sounds like something I can’t break. :). I think I see it on git-hub at (https://github.com/theforeman/theforeman.org/tree/gh-pages/manuals)/ 1.19 . is that correct?

I tried to install the foreman_ansible plugin version 2.2.6 and seeing some errors. The foreman_remote_execution dependency requires foreman 1.20.

  1. Which version of ansible should I use with 1.19
  2. If I want to test foreman_ansible 2.2.6 " “Ansible Variables can be imported as LookupKeys” on foreman 1.20 what is the link to download it? Can’t seem to find it on git-hub.

=> Booting Puma
=> Rails 5.1.6 application starting in production
=> Run rails server -h for more startup options
API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache.
Exiting
/mnt/c/Users/flaporta/Desktop/LearnRuby/foreman/app/registries/foreman/plugin.rb:177:in requires_foreman': ERF72-1799 [Foreman::PluginRequirementError]: foreman_remote_execution plugin requires Foreman >= 1.20 but current is 1.19.0 (Foreman::PluginRequirementError) from /mnt/c/Users/flaporta/Desktop/LearnRuby/foreman_remote_execution/lib/foreman_remote_execution/engine.rb:37:inblock (2 levels) in class:Engine
from /mnt/c/Users/flaporta/Desktop/LearnRuby/foreman/app/registries/foreman/plugin.rb:72:in instance_eval' from /mnt/c/Users/flaporta/Desktop/LearnRuby/foreman/app/registries/foreman/plugin.rb:72:inregister’
from /mnt/c/Users/flaporta/Desktop/LearnRuby/foreman_remote_execution/lib/foreman_remote_execution/engine.rb:36:in `block in class:Engine

The URL is correct, just update the nighly and then propagate the change to 1.19 or older versions. When we’ll build 1.20, we copy the stuff from nightly, so this will make sure, it won’t be dropped.

Thanks!

If you look at plugin versions that are released in 1.19 repos it should give you a good starting point. The ansible variables are not yet released in any foreman_ansible version, so for that, you’d have to update to latest commit in master. But that should still work with 1.19 AFAICT. So in your case, you just probably need to downgrade remote_execution, probably to 1.5.5 (which seems to be compatible with 1.18+)

Hope this helps

I’ll give that a try thank you.