Git Product home page Git Product logo

Comments (12)

neillturner avatar neillturner commented on June 22, 2024

unfortunately on centos 6 puppet will only work on ruby 187 while many of the tools like serverspec etc need ruby 1.9 or above.
using centos 7 puppet using ruby 2.1 i think which is much better.
ubuntu has long stopped using ruby 187 so that is ok.
The easiest way to add a new version of ruby to centos 6 that will co-exist with a version already installed via yum is to Install ruby via SCL
this allows you to install ruby 193 even if ruby 187 is installed
my kitchen_ansible code does this:
see https://github.com/neillturner/kitchen-ansible/blob/master/lib/kitchen/provisioner/ansible_playbook.rb
and more info
http://wiki.centos.org/AdditionalResources/Repositories/SCL

I've also install gitlab (a ruby on rail app) via https://github.com/sbadia/puppet-gitlab
this install rbenv to install a different ruby version for the application so this is a way to do it
if you need it for an application.

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

If you install puppet as a ruby gem, it will use the version of ruby inside that ruby environment that the gem is installed as. One way around this, is to install puppet during test-kitchen provisioning, such that the kitchen-puppet provisioner doesn't install puppet. You can do this with vagrant, by passing in a custom Vagrantfile template that contains an extra inline shell provisioner to install the version of puppet+ruby that you want. Or you can use Docker and add extra RUN statements during the docker image creation with the kitchen-docker driver.

I've used both to install set versions of puppet without relying on the kitchen-puppet provisioner to install puppet.

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

@metmajer were you able to solve this issue with a custom vagrantfile template, and/or a different solution?

from kitchen-puppet.

metmajer avatar metmajer commented on June 22, 2024

I am currently trying to work out a solution that works for me. I'll promise to close the issue when I have come up with something and document it here. Thanks!

from kitchen-puppet.

metmajer avatar metmajer commented on June 22, 2024

@grubernaut I have tried to follow your approach on providing a Docker image that has ruby (v2.2.0) and puppet (v4.2.1) installed as a gem. However, kitchen-puppet does not detect the puppet installation:

  1. The Docker container I prepared contains a symlink to puppet in /usr/bin/puppet:
# ls -la /usr/bin/puppet 
/usr/bin/puppet -> /root/.rbenv/versions/2.2.0/bin/puppet

and also a lookup using which returns a proper result:

# which puppet
/root/.rbenv/shims/puppet
  1. When I run kitchen converge, I do see the following lines in the output:
Installing puppet from yum on centos
which: no puppet in (/usr/local/bin:/bin:/usr/bin)
...
---> Package puppet.noarch 0:3.8.2-1.el6 will be installed
...
--> Processing Dependency: ruby >= 1.8.7 for package: puppet-3.8.2-1.el6.noarch

I am using the latest kitchen-puppet (v1.0.32). The Docker image I have come up with can be inspected here: https://github.com/dynaTrace/Dynatrace-Docker-Testing/tree/master/CentOS-6-Puppet.

Any ideas what I could change? Thanks!

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

In my current org's setup, we install puppet via gem, and the binary is located at /usr/local/bin.

Maybe this would allow kitchen-puppet to see the binary?

from kitchen-puppet.

metmajer avatar metmajer commented on June 22, 2024

Here are some findings:

  • symbolic links don't work, use a ln instead of ln -s
  • link puppet into /usr/bin not /usr/local/bin, as puppet will execute under sudo and sudo won't find any binaries in /usr/local/bin as it is not configured as a sudo `secure_path``

This will allow puppet apply to execute under sudo. Right now, I am getting the following error:

**Error: Could not parse application options: invalid option: --manifestdir=/tmp/kitchen/manifests**
...
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [   sudo -E puppet apply /tmp/kitchen/manifests/server/init.pp --modulepath=/tmp/kitchen/modules --manifestdir=/tmp/kitchen/manifests --fileserverconfig=/tmp/kitchen/fileserver.conf

Seems like --manifestdir is gone for good. This probably requires a change in kitchen-puppet. Any clue which version can safely be used?

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

Ah looks like manifestdir was deprecated in puppet4. We'll have to change the way this is called in kitchen-puppet.

Opening a new issue for this bug

from kitchen-puppet.

metmajer avatar metmajer commented on June 22, 2024

Yup. Please observe that --manifestdir is set even if provisioner.manifests_path is not set in .kitchen.yml. Maybe this could be a quick fix if you only set it if it's explicitly defined.

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

Yup, looks like that is the case
https://github.com/neillturner/kitchen-puppet/blob/master/lib/kitchen/provisioner/puppet_apply.rb#L674

Although I'm unsure why the check is for puppet_environment instead of manifest_dir

from kitchen-puppet.

metmajer avatar metmajer commented on June 22, 2024

Note: if you just omit the provisioner.manifests_path, the test manifests (e.g. in test/integration/do not get copied into the VM. I have commented out https://github.com/neillturner/kitchen-puppet/blob/master/lib/kitchen/provisioner/puppet_apply.rb#L674 and provisioning runs with puppet 4.2.1.

from kitchen-puppet.

grubernaut avatar grubernaut commented on June 22, 2024

Good to know, thanks!

I'm sure someone will work on this issue shortly. If not, I should be able to get to it next week, but am fairly swamped this week

from kitchen-puppet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.