puppet-mongodb icon indicating copy to clipboard operation
puppet-mongodb copied to clipboard

running puppet service does not find mongo client

Open jponds opened this issue 7 years ago • 0 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.9
  • Ruby: ruby 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: RHEL7 (u4)
  • Module version: puppet-mongodb (v2.1.0)

How to reproduce (e.g Puppet code you use)

class {'::mongodb::globals': manage_package_repo => true, manage_package => true, server_package_name => 'rh-mongodb32-mongodb-server', client_package_name => 'rh-mongodb32-mongodb', service_name => 'rh-mongodb32-mongod', user => 'mongodb', group => 'mongodb', require => Repos::Yum['rhel-server-rhscl-7-rpms'], } -> class {'::mongodb::server': config => '/etc/opt/rh/rh-mongodb32/mongod.conf', dbpath => '/var/opt/rh/rh-mongodb32/lib/mongodb', ipv6 => false, logappend => true, logpath => '/var/opt/rh/rh-mongodb32/log/mongodb/mongod.log', pidfilepath => '/var/opt/rh/rh-mongodb32/run/mongodb/mongod.pid', port => 27017, system_logrotate => 'reopen', } -> class{'::mongodb::client': require => File['/etc/mongodb.conf'], }

Create profile file withthe following content. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rh/rh-mongodb32/root/lib64 export PATH=$PATH:/opt/rh/rh-mongodb32/root/usr/bin

What are you seeing

When using the puppet service, this error occurs: Failed to apply catalog: Could not evaluate MongoDB shell command: printjson(db.getMongo().getDBs())

When running "puppet agent -t" from the command line, the run succeeds, because when running from the commandline it uses the environment variables.

What behaviour did you expect instead

Output log

Failed to apply catalog: Could not evaluate MongoDB shell command: printjson(db.getMongo().getDBs())

Any additional information you'd like to impart

jponds avatar Apr 23 '18 11:04 jponds