Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install this plugin on Centos7 #82

Closed
csecsi opened this issue May 2, 2019 · 14 comments
Closed

How to install this plugin on Centos7 #82

csecsi opened this issue May 2, 2019 · 14 comments
Labels
enhancement New feature or request
Milestone

Comments

@csecsi
Copy link

csecsi commented May 2, 2019

I am confused about installing this plugin on Centos7 (like: fog-proxmox requires Ruby version >= 2.3).
Could someone add a Centos install howto to the manual?

@tristanrobert
Copy link
Collaborator

tristanrobert commented May 2, 2019

Ruby 2.3 installation:

sudo yum install centos-release-scl
sudo yum install rh-ruby23
sudo scl enable rh-ruby23 bash

Or use rvm, rbenv, etc.

Foreman and its plugin installation form packages: https://www.theforeman.org/manuals/1.21/index.html#3.3InstallFromPackages

@csecsi
Copy link
Author

csecsi commented May 2, 2019

THX for the help.

So this is what I did:

installing the necessary packages:
sudo yum install centos-release-scl rh-ruby23 rh-ruby23-ruby-devel gcc zlib-devel -y

As /usr/share/foreman is owned by root I need as a quick and dirty solution: setfacl -R -m u:foreman:rxw /usr/share/foreman

sudo -u foreman scl enable rh-ruby23 bash
gem install foreman_fog_proxmox

and after restart:
Gem loading error: Unable to activate fog-1.42.1, because fog-core-2.1.2 conflicts with fog-core (~> 1.45) (RuntimeError)

What I am doing wrong?

@Yamakasi
Copy link

I have issues like this at the moment:

Building native extensions.  This could take a while...
ERROR:  Error installing foreman_fog_proxmox:
        ERROR: Failed to build gem native extension.

    current directory: /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/nokogiri-1.10.3/ext/nokogiri
/opt/rh/rh-ruby23/root/usr/bin/ruby -r ./siteconf20190511-14749-10daj7j.rb extconf.rb
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby23/root/usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/nokogiri-1.10.3 for inspection.
Results logged to /opt/rh/rh-ruby23/root/usr/local/lib64/gems/ruby/nokogiri-1.10.3/gem_make.out
`

@tristanrobert
Copy link
Collaborator

@Yamakasi Please post a distinct issue and describe precisely what you did in order to reproduce it.

@tristanrobert
Copy link
Collaborator

tristanrobert commented May 11, 2019

@csecsi gem installation is not recommended by foreman team. Please read carefully the doc §2.3: https://theforeman.org/plugins/

@Yamakasi
Copy link

@tristanrobert exactly your commands posted above and after that a gem install...

I don't see the 0.8.0 version available in repo's that's why I tried Gem.

@tristanrobert
Copy link
Collaborator

@Yamakasi 0.8.0 packages PR to foreman-packaging have just been posted.

@Yamakasi
Copy link

@tristanrobert OK looking forward to it :)

@brindapabari
Copy link

THX for the help.

So this is what I did:

installing the necessary packages:
sudo yum install centos-release-scl rh-ruby23 rh-ruby23-ruby-devel gcc zlib-devel -y

As /usr/share/foreman is owned by root I need as a quick and dirty solution: setfacl -R -m u:foreman:rxw /usr/share/foreman

sudo -u foreman scl enable rh-ruby23 bash
gem install foreman_fog_proxmox

and after restart:
Gem loading error: Unable to activate fog-1.42.1, because fog-core-2.1.2 conflicts with fog-core (~> 1.45) (RuntimeError)

What I am doing wrong?

@csecsi -- Were you able to install the plugin on CentOS7. I am doing the same steps and facing issues. Could you please list steps you performed for this plugin installation? Any pointers would be really helpfull

@csecsi
Copy link
Author

csecsi commented Jul 30, 2019

Negative. :(
I gave it up after a while.

@hlawatschek
Copy link
Contributor

Which foreman version do you use? We're packaging our own versions of foreman-fog-proxmox and fog-proxmox for orcharhino. I could send you the rpm packages for CentOS7 that should work with foreman-1.21 or 1.22

@brindapabari
Copy link

@csecsi

Following are the steps I followed for installing foreman_fog_proxmox (0.8) plugin in CentOS (7) for the latest foreman version (1.22) and finally had a working version
• $sudo install -y foreman foreman-compute foreman-sqlite3 foreman-asset
• In /usr/share/foreman/bundler.d directory, create a Gemfile.local.rb file and add following content in
it: gem 'foreman_fog_proxmox'

• System ruby version might be different from tfm-ruby version. Foreman uses tfm-ruby, therefore run the shell with following command in order to confirm that tfm version is being used. 
Use only foreman user (not root!) sudo -u foreman … If required give read write access to foreman user to the /usr/share/foreman directory

sudo -u foreman scl enable tfm bash
	○ bash-4.2$ whoami
		foreman
	○ bash-4.2$ set
		Check all the environment variables displayed
	○ bash-4.2$ gem install foreman_fog_proxmox
	○ bash-4.2$ cd  /usr/share/foreman/
	○ Install the gem plugin:
	bash-4.2$ bundle install 
	○ Not sure if Precompilation of plugin assets is required or not. It gave me errors but the plugin was already installed. Therefore I processed with testing the plugin functionalities of computing the proxmox resource
	
• Opening up Foreman website -> Compute Resources throws permission error 

• [root]$ setenforce 0

• After disabling the selinux Foreman website shows the installed plugin in  Administer ->About ->Plugins. Able to open the Compute Resources page.

• Upon saving the Create Resource page / clicking on Test Connection of Proxmox server, it gives the authentication error similar to this open issue: https://github.com/theforeman/foreman_fog_proxmox/issues/86

Resolution provided by pdzionek in issue #86 works for me:
○ Commenting out line 82 from the file:
• $vi /usr/share/foreman/.gem/ruby/gems/fog-proxmox-0.8.0/lib/fog/proxmox.rb

Hope this helps!

@tristanrobert
Copy link
Collaborator

Needs a new PR in theforeman/foreman-packaging to include 0.8.1.

@tristanrobert
Copy link
Collaborator

It is fixed in foreman-packaging PR#4308 and PR#4309. If you want to speed up you can follow these PR and vote for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants