Closed blanchma closed 12 years ago
I solve all the errors installing LSB packages and changing to ruby 1.8.7 but I still have the error about rvm class.
I follow the instructions about using: import "rvm".
My file is like this:
import "rvm" class installrvm { include rvm rvm::system_user { deployer: ; }
if $rvm_installed == "true" { rvm_system_ruby { 'ruby-1.9.3-p0': ensure => 'present'; } } }
I'm getting:
Could not parse for environment production: No file(s) found for import of 'rvm' at /home/ubuntu/puppet/manifests/init.pp:26 on ...
I'm working with @blanchma in the same project.
After some investigation, we get rid of the No file(s) found forcing the modulepath:
sudo puppet apply --modulepath=$HOME/puppet/modules --verbose manifest/init.pp
But now we get:
Could not find dependent Stage[rvm-install] for Stage[req-install] at /home/ubuntu/puppet/manifests/init.pp:11
Where do you specify the req-install
stage? It looks like there is a problem with that stage and the default rvm-install
stage.
We added this as the first line of our manifest/init.pp:
Exec { path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" }
stage { 'first': before => Stage['main'] } stage { 'req-install': before => Stage['first'] }
And now we get a new error msg:
ubuntu@ip-xx-xx-xx-xx:~/puppet$ sudo puppet apply --modulepath=/home/ubuntu/puppet/modules --verbose manifests/init.pp
info: Loading facts in /home/ubuntu/puppet/modules/rvm/lib/facter/rvm_installed.rb
info: /User[deployer]: Provider useradd does not support features manages_passwords; not managing attribute password
info: Applying configuration version '1338396444'
notice: /Stage[req-install]/Requirements/Exec[apt-update]/returns: executed successfully
notice: /Stage[req-install]/Requirements/Exec[essentials]/returns: executed successfully
err: /Stage[main]/Webapp/Package[bundler]/ensure: change from absent to present failed: Execution of '/usr/local/bin/gem install --include-dependencies --no-rdoc --no-ri bundler' returned 1: ERROR: Error installing bundler:
bundler requires RubyGems version >= 1.3.6
INFO: gem install -y
is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
err: Removing mount files: /etc/puppet/files does not exist or is not a directory notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Pre/Package[libcurl4-openssl-dev]/ensure: ensure changed 'purged' to 'present' notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Pre/Package[apache2-prefork-dev]/ensure: ensure changed 'purged' to 'present' notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]: Dependency Rvm_gem[passenger] has failures: true warning: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]: Skipping because of failed dependencies notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-available/passenger.conf]: Dependency Rvm_gem[passenger] has failures: true warning: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-available/passenger.conf]: Skipping because of failed dependencies notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-enabled/passenger.conf]: Dependency Rvm_gem[passenger] has failures: true warning: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-enabled/passenger.conf]: Skipping because of failed dependencies notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-available/passenger.load]: Dependency Rvm_gem[passenger] has failures: true warning: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-available/passenger.load]: Skipping because of failed dependencies notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-enabled/passenger.load]: Dependency Rvm_gem[passenger] has failures: true warning: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/File[/etc/apache2/mods-enabled/passenger.load]: Skipping because of failed dependencies err: Could not find a suitable provider for rvm_gem notice: Finished catalog run in 14.04 seconds
Try posting more portions of your puppet manifest files. How are you installing bundler? How are you installing passenger?
Here is our manifest/init.pp file:
$app_name = "appname"
$db_name = "dbname"
$db_user = "dbuser"
Exec {
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
}
stage { 'first': before => Stage['main'] }
stage { 'req-install': before => Stage['first'] }
class requirements {
group { "puppet": ensure => "present" }
exec { "apt-update":
command => "apt-get -y update"
}
exec {"essentials":
command => "apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev \
git-core curl libyaml-dev libcurl4-dev libsqlite3-dev apache2-dev libshadow-ruby1.8 -y"
}
}
class installrvm {
import "rvm"
rvm::system_user { deployer: ; ubuntu: ;}
if $rvm_installed == "true" {
rvm_system_ruby {
'ruby-1.9.3-p0':
ensure => 'present';
}
}
}
class installpassenger {
class{'rvm::passenger::apache':
version => '3.0.11',
ruby_version => 'ruby-1.9.3-p0',
mininstances => '3',
maxinstancesperapp => '0',
maxpoolsize => '30',
spawnmethod => 'smart-lv2';
}
class {'apache2':
app_name => $app_name;
}
}
class setupwebapp {
class {'webapp':
app_name => $app_name,
db_name => $db_name,
db_user => $db_user;}
}
class deployer {
user { 'deployer':
managehome => false,
ensure => 'present',
password => 'deployer',
comment => 'Deployer'
}
}
class doinstall {
class { deployer:, stage => "first" }
class { requirements:, stage => "req-install" }
include installrvm
include installpassenger
class { 'mysql':
db_name => $db_name,
db_user => $db_user;
}
include setupwebapp
}
include doinstall
Instead of stage { 'req-install': before => Stage['first'] } is
stage { 'req-install': before => Stage['rvm-install'] }
The error when we use that is Could not find dependent Stage[rvm-install] for Stage[req-install] at /home/ubuntu/puppet/manifests/init.pp:10
and when we change the Stage to ['first'] is the posted by @gianu
Well, finally, we could.
I wrote a long response to this bug, but it seems to have been swallowed by Github. The gist of it was:
Use include rvm
instead of import rvm
Anyway, it looks like you fixed your issue.
Anyway, thanks.
The same recipe works in a Vagrant with lucid32 but fail in an amazon instance with ubuntu 10.04.
The error I get is:
No LSB modules are available. Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem Could not find class rvm for ip-10-99-86-66.ec2.internal at /home/ubuntu/puppet/manifests/init.pp:27 on node ip-10-99-86-66.ec2.internal
In line 27 of manifest I have the include rvm.