How to Install a Smart-Proxy Plugin » History » Version 2
Anonymous, 07/23/2014 12:18 PM
1 | 1 | Anonymous | h1. How to Install a Smart-Proxy Plugin |
---|---|---|---|
2 | |||
3 | Smart-Proxy plugins are ruby gems. Below are recommended methods for installation. |
||
4 | |||
5 | h2. RPM Installations |
||
6 | |||
7 | Some plugins are available from Foreman repositories packaged as rpms. The repos are available at [[yum.theforeman.org/plugins]]. Separate repos are available for each Foreman release, containing plugins that are compatible with that particular version. Packages are not currently GPG signed. |
||
8 | |||
9 | Configure the repo by creating /etc/yum.repos.d/foreman_plugins.repo: |
||
10 | |||
11 | <pre> |
||
12 | [foreman-plugins] |
||
13 | name=Foreman plugins |
||
14 | baseurl=http://yum.theforeman.org/plugins/nightly/el6/x86_64/ |
||
15 | enabled=1 |
||
16 | gpgcheck=0 |
||
17 | </pre> |
||
18 | |||
19 | Find the package for the plugin: |
||
20 | <pre>yum search rubygem-smart-proxy</pre> |
||
21 | |||
22 | Install the package, e.g. |
||
23 | <pre>yum install rubygem-smart_proxy_pulp</pre> |
||
24 | |||
25 | Restart Smart-Proxy with <pre>service foreman-proxy restart</pre> |
||
26 | Some plugins may require configuration in /etc/foreman-proxy/settings.d/, check for any .example files. |
||
27 | 2 | Anonymous | |
28 | |||
29 | h2. Installing from Gems |
||
30 | |||
31 | Use install without dependencies below to avoid building native extensions. 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. |
||
32 | <pre> gem install --ignore-dependencies smart_proxy_pulp</pre> |
||
33 | |||
34 | If you need other dependencies (see the rubygems.org page), check the yum repo above or install the same way with 'gem'. Smart-Proxy relies on bundler for loading of dependencies; you'll need to update bundler configuration as detailed below. |
||
35 | Restart Smart-Proxy with <pre>service foreman-proxy restart</pre> |
||
36 | |||
37 | If you hit problems, uninstall the added gems with <pre>gem uninstall -v VERSION GEM</pre> |
||
38 | |||
39 | h2. From Source Installations |
||
40 | |||
41 | Chances are plugin that developers already created bundler configuration file that you can use. Check bundler.d/ directory located in plugin gem source directory. Otherwise, It is recommended to use ~foreman-proxy/bundler.d/Gemfile.local.rb so that it is not overwritten by future upgrades. If it's published on rubygems.org, just add the name and the latest released version will be downloaded. Add to bundler.d/Gemfile.local.rb: |
||
42 | <pre> |
||
43 | gem 'smart_proxy_pulp' |
||
44 | </pre> |
||
45 | |||
46 | Bundler can install the plugin from a git repository. Add to bundler.d/Gemfile.local.rb: |
||
47 | <pre> |
||
48 | gem 'smart_proxy_pulp', :git => "https://github.com/theforeman/smart-proxy-pulp" |
||
49 | </pre> |
||
50 | |||
51 | Next, as a Foreman user (not root), run the following command: |
||
52 | <pre> |
||
53 | $ bundle update foreman_sample_plugin |
||
54 | </pre> |