Search code examples
rubypuppetrpmaws-code-deploy

Installing Code Deploy Agent on Centos 6


There is a Centos 6.6 host running puppet 3.7.5

To make puppet 3.7.5 work I have ruby-1.8.7 installed

When I try and install the Code Deploy Agent it says

Error in PREIN scriptlet in rpm package codedeploy-agent-1.0-1.751.noarch

 ==========================================================================================
  AWS CodeDeploy needs Ruby version 2.0.x to be installed for root under /usr/bin/ruby.

  If you have Ruby version 2.0.x installed for other users, please create a symlink
  to /usr/bin/ruby2.0.

  Otherwise please install Ruby 2.0.x for root user.
 ==========================================================================================

There doesn't seem to be a package in the Centos repos for ruby-2.0.x I'm not sure about installing a ruby-2.0 as perhaps it might break puppet?

I've used rvm to manage ruby versions on test machines but it seems to require lots of tools that I don't want to install on a production system Here's what I added the the user data script to make ruby-2.0 work with rvm on a 6.6 system

  gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A170311380
4BB82D39DC0E3
  curl -L get.rvm.io | bash -s stable --ruby
  source /usr/local/rvm/scripts/rvm
  ln -s `which ruby` /usr/bin/ruby2.0
  /usr/local/aws/bin/aws s3 cp 's3://aws-codedeploy-eu-west-1/latest/install' .
  chmod 0775 install
  ./install auto

I realise that this question is on the face of it more suited to "server fault" but perhaps "Code Deploy" isn't suitable for production servers?

Any suggestions? Is it easy to convert an rvm ruby into an rpm for instance?


Solution

  • According to:

    http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent.html

    Code Deploy Agent is only for RHEL7. If you are using RHEL/CentOS6 then you are in un-supported realm. While it is technically doable [1], if you have to ask here, then it signalize that it is beyond your capability. Probably easier is to migrate your application to RHEL7.

    [1] Hint: Software Collection ruby200 for Centos6: https://www.softwarecollections.org/en/scls/rhscl/ruby200/