Plugins are tools to extend and modify the functionality of Foreman, Smart Proxy and Hammer CLI. The core Foreman applications are designed to be lean, to maximize flexibility and to minimize code bloat. Plugins offer custom functions and features so that each user can tailor their environment to their specific needs.
A plugin project may consist of a single Foreman or Smart Proxy plugin, or often a Foreman plugin, Smart Proxy plugin, and a Hammer CLI plugin working together.
Foreman plugins are implemented as Rails engines, and Foreman, Smart Proxy and Hammer CLI plugins are all packaged as gems, RPMs and Debian packages.
Full lists of plugins are available on the Foreman landscape.
Foreman, Smart Proxy and Hammer CLI plugins are packaged as gems, but the Foreman project provides RPMs and Debian packages to ease installation with standard Foreman packages. See below for the different installation methods, which depend on your platform.
The number of plugins available in the project repositories is increasing, so check the wiki to see if a package is available yet. If it’s a useful or popular plugin and not yet packaged, please file a feature request in the packaging project (see Bug Reporting for more details on reporting issues).
Some plugins can be installed using the Foreman installer, which can help with additional configuration that the plugin may require, e.g. config files or services.
To see which plugins the installer can set up, run:
# foreman-installer --help | grep enable-
--[no-]enable-foreman-plugin-discovery Enable 'foreman_plugin_discovery' puppet module (default: false)
--[no-]enable-foreman-plugin-docker Enable 'foreman_plugin_docker' puppet module (default: false)
--[no-]enable-foreman-plugin-hooks Enable 'foreman_plugin_hooks' puppet module (default: false)
Run the installer with the extra --enable...
argument to add the plugin. Any arguments given when Foreman was first installed will be kept the same, saved in the installer answers file.
Note that the installer will enforce the state of all managed configuration files, so manual changes will be reverted. Use --noop -v
first to check for any unexpected changes.
foreman-installer --noop -v --enable-foreman-plugin-discovery
Run again without noop to make the changes:
foreman-installer --enable-foreman-plugin-discovery
Some plugins have additional parameters, which can be changed using foreman-installer -i
for interactive mode or found in the foreman-installer --help
output.
To provide specific installation instructions, please select your operating system:
The repositories are available at yum.theforeman.org/plugins. Separate repositories are available for each Foreman release, containing plugins that are compatible with that particular version. Packages are not currently GPG signed.
If not already configured by foreman-release, add the repo by creating /etc/yum.repos.d/foreman-plugins.repo
with the following content:
[foreman-plugins] name=Foreman plugins baseurl=https://yum.theforeman.org/plugins/3.12/el8/x86_64/ enabled=1 gpgcheck=0
[foreman-plugins] name=Foreman plugins baseurl=https://yum.theforeman.org/plugins/3.12/el9/x86_64/ enabled=1 gpgcheck=0
The repositories are available at https://deb.theforeman.org plugins <version>
. Separate repositories are available for each Foreman release, containing plugins that are compatible with that particular version. They are signed with the Foreman APT key.
If not already configured, add the repo by editing /etc/apt/sources.list.d/deb_theforeman_org.list
and adding the following line:
deb http://deb.theforeman.org/ plugins 3.12
Change the version number in the URL to match the Foreman release in use.
To install a plugin:
yum search discovery
or by checking the plugin documentation.yum install rubygem-foreman_discovery
.systemctl restart foreman
Some plugins (e.g. foreman_default_hostgroup) may also require configuration in /etc/foreman/plugins/
, check for any .example files. Smart proxy plugins can be configured in /etc/foreman-proxy/settings.d/
.
To install a plugin:
apt-cache search discovery
apt-get install ruby-foreman-discovery
systemctl restart foreman
Some plugins (e.g. foreman_default_hostgroup) may also require configuration in /etc/foreman/plugins/
, check for any .example files. Smart proxy plugins can be configured in /etc/foreman-proxy/settings.d/
.
The naming of packages is as follows:
rubygem-foreman_
prefix.rubygem-smart_proxy_
prefix.rubygem-hammer_cli_
prefix.The naming of packages is as follows:
ruby-foreman-
prefix.ruby-smart-proxy-
prefix.ruby-hammer-cli-
prefix.Not recommended, as it’s possible for the ‘gem’ command to install other, newer dependencies, which can cause problems with the Foreman installation. Do note the install without dependencies below to avoid this problem.
Ensure the plugin you want is available from rubygems.org as a gem. Plugins that aren’t published (just git repos) can’t be installed with this method without being built as a gem.
gem install --ignore-dependencies foreman_default_hostgroup
bundler.d/Gemfile.local.rb
file as detailed below.systemctl restart foreman
If you hit problems, uninstall the added gems with gem uninstall -v VERSION GEM
It is recommended to use ~foreman/bundler.d/Gemfile.local.rb
so that it is not overwritten by future upgrades.
gem 'foreman_sample_plugin'
gem 'foreman_sample_plugin', :git => "https://github.com/example/foreman_sample_plugin.git"
foreman
(not root!), run the following command: $ /usr/bin/foreman-ruby /usr/bin/bundle install
$ /usr/bin/foreman-ruby /usr/bin/bundle update foreman_sample_plugin
to update itsystemctl restart foreman
More information about writing your own plugins is available in the wiki:
The Foreman development forum and IRC channels can be of help for plugin developers.
We are happy to help bring your plugin to the Foreman Community! We offer:
We do ask for a few things in return:
Please see plugin development documentation for more details
Foreman 3.12.0 has been released! Follow the quick start to install it.
Foreman 3.11.4 has been released! Follow the quick start to install it.