Foreman installation on amazon ec2 instance

amazon ec2foremaninstallationpuppetruby

Hi there and thank you for reading,

I am currently in the process of setting up a puppet service for our ec2 instances and decided to give foreman a try (node certificate management and automatic passenger setup seems nice).

Unfortunately I'm running into difficulties with the installation. I'm on fresh a 'Amazon Linux AMI x86_64 PV':

[root@hostname ~]# uname -a
Linux hostname 3.10.35-43.137.amzn1.x86_64 #1 SMP Wed Apr 2 09:36:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

and tried the following:

sudo yum -y update
sudo yum -y install http://yum.theforeman.org/releases/1.1/el6/x86_64/foreman-release.rpm
sudo yum -y install foreman-installer

which results in this:

Error: Package: rubygem-foreman_api-0.1.11-1.el6.noarch (foreman)
       Requires: rubygem(rest-client) >= 1.6.1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

The suggestions seem useless (–skip-broken installs all dependencies but foreman/puppet).
I ended up here
and tried installing the repository (after removing the old one)

sudo yum -y remove epel-release
sudo yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

now again, what I tried:

sudo -y update
sudo -y install foreman-installer

results in the same error.
Installation without previous update is possible (though yum will complain about Public keys) and results in the following error:

[ec2-user@hostname ~]$ foreman-installer
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- highline/import (LoadError)
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/sbin/foreman-installer:3:in `<main>'

I had similar problems while trying to set up passenger and eventually surrendered. I assume this happens due to conflicting ruby version, so:

[root@hostname puppet]# ruby --version
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
[root@hostname puppet]# gem --version
2.0.14
[root@hostname puppet]# ls /usr/bin | grep ruby
ruby
ruby1.8
ruby2.0
[root@hostname puppet]# ls /usr/bin | grep gem
gem
gem2.0

Did someone run into the same issues? How do I resolve this?

Thanks in advance and thank you for reading through all this!

Best Answer

Packages for Red Hat Enterprise Linux and its clones are not compatible with Amazon Linux. You will need to find either a different way to install Foreman, or preferably a different Linux distribution (Amazon Linux has many issues which make it generally unsuitable for just about anything).