3

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!

1
  • I ran into this same problem - I refuse to believe that there is 'no' solution, there must be a a way, I'll have to ask the foreman guys if they have a solution Jul 16, 2014 at 15:24

4 Answers 4

1

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).

1
  • Wow alright, I never even thought of that.. at least I know what to look for in the future. I think I'll cry a little now. Thanks for the impossibly fast answer!
    – afriemann
    Jun 12, 2014 at 16:47
1

Since I spent a lot of time with puppet on amazon recently I wanted to update this.

Since the puppet version on amazon linux apparently is not compatible with the default ruby2.0 installation you will have to install missing ruby1.8 stuff and link to the correct files. This should do the trick:

preparing for the installation:

if ! yum repolist | grep -q puppetlabs;
then
    echo "..enabling puppet repository.."
    # https://tickets.puppetlabs.com/browse/PUP-2132
    echo -e "[main]\nenabled = 0" > /etc/yum/pluginconf.d/priorities.conf
    rpm --quiet -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-10.noarch.rpm
fi

echo "..updating.."
yum -y --quiet clean all
yum -y --quiet update

if readlink /etc/alternatives/ruby | grep -q "ruby2\.0"
then
    echo "..making ruby1.8 default.."
    ln -sf /usr/bin/ruby1.8 /etc/alternatives/ruby
fi

if readlink /etc/alternatives/gem | grep -q "gem2\.0"
then
    echo "..making gem1.8 default.."
    ln -sf /usr/bin/gem1.8 /etc/alternatives/gem
fi

and to install puppet with apache:

PACKAGE="puppet"
#PACKAGE="puppet-server"

echo "..installing "$PACKAGE" and requirements.."
yum -y --quiet install "$PACKAGE" rubygem18-json

and finally passenger:

echo "..installing passenger and requirements.."
yum -y install httpd httpd-devel mod_ssl ruby18-devel rubygems gcc gcc-c++ curl-devel openssl-devel zlib-devel
gem install rack passenger

passenger-install-apache2-module --auto

Don't forget to do the usual stuff (config.ru and the vhost config for apache) and then everything should work. I did not try this with foreman since we chose to not use it, however it could be possible and if so should work fairly similar.

1

I was able to install foreman on Amazon Linux, using the foreman-installer which also installs the foreman-proxy.

Becaause puppet and foreman uses ruby1.8 and amazon linux by default uses 2.0

  • echo -e "[main]\nenabled = 0" > /etc/yum/pluginconf.d/priorities.conf
  • yum install ruby18
  • yum install rubygems18
  • alternatives --config ruby => choose ruby1.8

Next, the scl-utils package (version 20120229) that is in epel for doesn't have this file /usr/bin/scl_source. You need this version 20120927. I found it here:

Next you need the package ipmitool. I used yum downloader on a centos box, and installed

  • yum localinstall ipmitool-1.8.15-2.el6.x86_64.rpm.

After that foreman-installer -i finished successfully.

0

I had the same error on a CentOS 6 system. It turns out that I needed to install an additional repository as described in the installation guide for the foreman:

http://theforeman.org/manuals/1.5/index.html#3.3.1RPMPackages

All RHEL and derivatives require Red Hat Software Collections (RHSCL) 1.0 or rebuild, e.g. Software Collections for CentOS. RHSCL is available to RHEL customers as a separate repository or child channel. More information on Software Collections for CentOS is available here and for Scientific Linux it is available here.

I assume your should do something similar in your AWS instance.

1
  • Unfortunately that did not help (I already tried that prior to asking my question). As Michael suggested, the Amazon Linux distribution seems incompatible. We switched to a RHEL AMI and got it working eventually (even though we trashed foreman and simply went for passenger+puppet, which works like a charm). Thanks anyway!
    – afriemann
    Jun 26, 2014 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .