Error in ruby code when running puppet agent run - puppet

When I run puppet agent -t on my server I get an error:
The logs from the puppet-master look like this:

Unfortunately, this is an error caused by using Ruby 1.8.7, a long EOL version of Ruby. Puppet uses Ruby to compile catalogs, and CentOS 6's upstream uses 1.8.7 Ruby, which has been EOL for 3 years.
The easiest way to fix this problem is to use Puppet 4 onwards, which packages it's own Ruby as part of the all-in-one package (to avoid errors like this on systems that support older Ruby versions)

Related

I cannot create a project in Linux

Two months taught Elixir in Windows. There was no problem. He created projects using the "mix new name_project" command. I decided to try Elixir on Linux. Linux Mint Cinnamon 19 Is Installed. Erlang and Elixir are installed and the Elixir software environment is running. And the project cannot be created. It seems, swears on syntax.
On the picture of the window you can see that the program shell starts, reacts to simple actions. And project create not is obtained. Is there a problem?
https://yapx.ru/v/FW5YF
You are using elixir 1.3.3, which does not support OTP 20, this seems like a likely cause for the issues. I suggest upgrading elixir as 1.3 is pretty old and no longer getting fixes.
https://github.com/elixir-lang/elixir/blob/master/lib/elixir/pages/Compatibility%20and%20Deprecations.md
#Vlad, as #{Kalvin Hom} mentioned, you have quite old version of elixir that is not compatible with erlang OTP.
remove elixir and OTP from your OS.
install asdf to manage elixir and erlang version
add elixir-plugin and erlang-plugin:
$> asdf plugin-add erlang
$> asdf plugin-add elixir
then install elixir and erlang via asdf
$> asdf install erlang 22.1.1
$> asdf install elixir 1.9.1
Now you have newest elixir and erlang on your machine. Take a look to asdf manual to know how to manage version via .tool-versions file

Pupperserver with Adopt-OpenJDK

We are in transition from Puppetmaster 3.8 to Puppet server(OpenSource) 5.3.
As a prerequisite for Puppetserver 5.3 installation requires Java 8 runtime packages. Can we install Adopt-OpenJDK with Pupperserver 5.3?
Puppetserver runs just fine on OpenJDK, but I strongly recommend that you run the server on an officially-supported platform (RHEL, CentOS, Debian, Ubuntu, or SLES), and use one of Puppet, Inc.'s official packages for that system. These each express a dependency on an appropriate Java 8 package, and they will configure Puppet properly to work in conjunction with that implementation. On the platforms for which I have knowledge of the details, it is the distro's OpenJDK build that is used.
It should be possible to [re]configure Puppetserver to use an Adopt-OpenJDK implementation of the Java 8 runtime, but this is swimming upstream.
Thanks John.Adding one more point here puppetserver has a dependency on openjdk-8-jre-headless:amd64.But adopt open jdk is not providing headless package.So we suspect this may cause issue as puppetserver will look for the headless package.

Ruby error when deploying a module with Puppet on CentOS 6

I have installed both Puppet master and agent on machines running CentOS 6
Everything went well, until the moment I have tried to deploy a simple sample module: I got an error, explained on the picture.
Trying to edit the file didn't help and the file was actually updated each time from repository
I tried running a different module which resulted in the same error
The error is because the formatting for Ruby code will not work with older Ruby. The CentOS 6 upstream Ruby package is 1.8.7, which is a super old Ruby version, and has been EOL for 3 years since 2014.
To fix this problem, Puppet started packaging Ruby and other dependancies as part of an all-in-one package since Puppet 4. This means there's no dependancy hell when it comes to EOL Ruby, OpenSSL and any other dependancies: they're all bundled and supported as a single RPM, without affecting the system packages.
It also means that you don't break any applications that require a different system Ruby, and generally makes using Puppet a lot easier.
Adding to this, the version of Puppet in CentOS is 3.X, which is also EOL. You should upgrade to Puppet 4. Here's a handy script that will install the Puppet 4 agent package on CentOS 6: https://github.com/petems/puppet-install-shell
If you are limited to using Puppet 3 for whatever reason, there are a few less preferable solutions:
Download a new Ruby RPM for CentOS 6, (such as from this Github repo) or a CloudPackage.io repo (such as this one I made for CentOS 6 Ruby packages https://packagecloud.io/petems/ruby2/install)
Disadvantage: Those RPMs are not supported officially and might have unintentional issues
Fork the module to change the Ruby code
Disadvantage: This is a big maintenance cost, and you'll have to do this every time an update happens to the module upstream.

Mercurial unbundle error: abort: ... unknown bundle version 20

I'm on linux ubuntu 14.04 lts and I use Mercurial Distributed SCM (version 3.3.2). I try to unbundle a mercurial hg bundle made on Mac osx with command line:
hg unbundle XXX.hg
abort: XXX.hg: unknown bundle version 20
Does anyone have a clue what is going on? Google research has not been providing much informations about that.
I had to add type='bzip2-v1' to the bundle call
from mercurial.commands import bundle
bundle(ui, repo, tmpfile.name, dest=None, base=(parentc.rev(),), rev=(c.rev(),), type='bzip2-v1')
It looks like mercurial introduced a new version of their bundle module somewhere around 3.2, according to:
https://hglabhq.com/blog/2014/4/29/what-s-new-in-mercurial-3-0
Your version should have support for bundle2, but there may be some problems unbundling from newer versions of mercurial.

Using cucumber with jruby

I'm working on my company's intranet with
cucumber 0.8.5
gherkin 2.1.5
And I'm trying to switch from using ruby 1.8.7 to jruby 1.5.1
However, whenever I try to run cucumber from jruby, I get an error:
% jruby -S cucumber
/usr/local/src/jruby-1.5.1/lib/ruby/site_rub/1.8/rubygems/custom_require.rb:31:in `require': no such file to load -- gherkin (LoadError)
I think this is b/c gherkin 2.1.5 is a native extension, and jruby can't handle it:
% jgem install gherkin-2.1.5.gem
...
ERROR: Error installing gherkin-2.1.5.gem:
ERROR: Failed to build gem native extension.
Now, I'd love to just try updating versions, but since this is on a protected intranet, importing new software is a PITA, and takes some time.
Does anyone have any suggestions of how I can make the software I have work? Am I missing a proper configuration setting or some such?
You need to install the JRuby version of gherkin. If you simply do
jgem install gherkin
you will get the correct version automatically. Otherwise, you have to figure out the URI to the JRuby version of the gherkin gem yourself and download it by hand.
But really, there is only one sensible thing you can do if you are working for a company that asks you to do a job and then ties your hands behind your back: run, as fast as you can, as far away as you can.

Resources