blt04 / puppet-rvm

A puppet module for installing and using RVM (Ruby Version Manager)
Other
242 stars 280 forks source link

Invalid parameter false(false) - possible re-introduction of previous error from puppet 2.6 #21

Closed MiiR closed 12 years ago

MiiR commented 12 years ago

Running rvm_gem on puppet 2.7.5 causes the following error -

err: Could not create resource file /var/lib/puppet/state/resources.txt: Invalid parameter false(false) at /etc/puppet/modules/rvm/manifests/classes/passenger-gem.pp:6

When the same puppet scripts are run on 2.7.3 we get no errors.

Commenting out all reference to rvm_gem removes the error in 2.7.5 (but obviously doesn't install our gems!).

I believe the bug #13 - Resource type rvm_gem does not support parameter false has been reintroduced with the latest puppet release.

blt04 commented 12 years ago

I'm unable to reproduce this with Puppet 2.7.5. Could you post your config?

MiiR commented 12 years ago

How much do you need? The parts I seem to have issues with are -

class { 'rvm::passenger::apache': version => '3.0.9', ruby_version => 'ruby-1.9.2-p290', mininstances => '3', maxinstancesperapp => '0', maxpoolsize => '10', spawnmethod => 'conservative'; }

class {
  'rvm::passenger::gem':
    ruby_version => $ruby_version,
    version => $version,
}  

class rvm::passenger::apache( $ruby_version, $version, $rvm_prefix = '/usr/local/', $mininstances = '1', $maxpoolsize = '10', $poolidletime = '300', $maxinstancesperapp = '0', $spawnmethod = 'conservative' ) {

case $operatingsystem {
  Ubuntu: { include rvm::passenger::apache::ubuntu::pre }
}

class {
  'rvm::passenger::gem':
    ruby_version => $ruby_version,
    version => $version,
}

# TODO: How can we get the gempath automatically using the ruby version
# Can we read the output of a command into a variable?
# e.g. $gempath = `usr/local/rvm/bin/rvm ${ruby_version} exec rvm gemdir`
$gempath = "${rvm_prefix}rvm/gems/${ruby_version}/gems"
$binpath = "${rvm_prefix}rvm/bin/"

case $operatingsystem {
  Ubuntu: { include rvm::passenger::apache::ubuntu::post }
}

class rvm::passenger::gem($ruby_version, $version) { rvm_gem { "passenger": ruby_version => $ruby_version, ensure => $version, } }

rvm_gem { 'ruby-1.9.2-p290/bundler': ensure => '1.0.18', require => Rvm_system_ruby['ruby-1.9.2-p290']; }

Something like that anyway.

I just realized the puppetmaster was still running 2.7.3 which may have affected things.

MiiR commented 12 years ago

oops, wrong button.

blt04 commented 12 years ago

Most of what you pasted is the RVM module's code. You do not need to copy that into your own manifest files. Try using this in one of your manifest files:

include rvm::system

if $rvm_installed == "true" {
  rvm_system_ruby {
    'ruby-1.9.2-p180':
      ensure => 'present',
      default_use => true;
  }

  class {
    'rvm::passenger::apache':
      version => '3.0.7',
      ruby_version => 'ruby-1.9.2-p180',
      mininstances => '3',
      maxinstancesperapp => '0',
      maxpoolsize => '30',
      spawnmethod => 'smart-lv2';
  }
}
mtylty commented 12 years ago

I've been experiencing the same problem (puppet 2.7.5).

I've been using the following code:

# manifests/templates.pp
class ruby($version) {
  include rvm::system

  if $rvm_installed == "true" {
    rvm_system_ruby { $version:
        ensure => 'present',
        default_use => true
    }

    rvm_gem { 'bundler':
        name => 'bundler',
        ruby_version => $version,
        ensure => latest,
        require => Rvm_system_ruby[$version]
    }
    rvm_gem { 'puppet':
        name => 'puppet',
        ruby_version => $version,
        ensure => latest,
        require => Rvm_system_ruby[$version]
    }
  }
}

class passenger($version, $ruby_version, $mininstances ='3', $maxinstancesperapp ='0', $maxpoolsize='30', $spawnmethod='smart-lv2') {
  include apache_common # includes common apache configuration

  class { ruby: version => $ruby_version }

  if $rvm_installed == "true" {
    class { 'rvm::passenger::apache':
        version => $version,
        ruby_version => $ruby_version,
        mininstances => $mininstances,
        maxinstancesperapp => $maxinstancesperapp,
        maxpoolsize => $maxpoolsize,
        spawnmethod => $spawnmethod
    }
  }
}
###

# manifests/nodes.pp (inside a node definition)

class { passenger:
    version => '3.0.9',
    ruby_version => 'ree-1.8.7-2011.03'
}
omarqureshi commented 12 years ago

I get this on 2.7.4

mattmcmanus commented 12 years ago

Same problem here with 2.7.5

$ruby_version = 'ruby-1.9.2-p290'

if $rvm_installed == "true" {
  rvm_system_ruby {
    $ruby_version:
      ensure => 'present',
      default_use => true;
  }

rvm_gemset {
  "${ruby_version}@dotherapy":
    ensure => present,
    require => Rvm_system_ruby[$ruby_version];
}

rvm_gem {
  "${ruby_version}@dotherapy/bundler":
    ensure => latest,
    require => Rvm_gemset["${ruby_version}@dotherapy"];
}

class {
  'rvm::passenger::apache':
    version => '3.0.7',
    ruby_version => $ruby_version,
    mininstances => '1',
    maxinstancesperapp => '0',
    maxpoolsize => '5',
    spawnmethod => 'smart-lv2';
  }
}
blt04 commented 12 years ago

I've confirmed this error. It appears to be caused by new functionality added in Puppet 2.7.4. I've filed an upstream bug here: #10109.

In the meantime, this error doesn't appear to prevent gems from being installed.

MiiR commented 12 years ago

Looks like its still there on 2.7.6~rc2

The only issue I really have with it is that on puppet-dashboard all my app servers show as failed!

heffergm commented 12 years ago

Getting this in the released 2.7.6 build as well.

joehillen commented 12 years ago

Looks like it will be fixed in 2.7.10

https://github.com/puppetlabs/puppet/commit/45f0855bd6be36a66acd0a28a8ed83e2d63af239

blt04 commented 12 years ago

2.7.10 was released a few days ago and appears to have fixed this issue.