1
votes

I apply an incremental change to my postgresql install using puppet.

sudo puppet apply --modulepath=/vagrant/puppet/modules -e "include iwd-postgresql"

This result in the following error:

Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class postgresql::globals at /vagrant/puppet/modules/iwd-postgresql/manifests/init.pp:6 on node target.intware.com
Wrapped exception:
Could not find declared class postgresql::globals

I have installed the puppetlabs/postgresql module.

If I do a puppet list I see the following:

[vagrant@target ~]$ puppet module list
    /home/vagrant/.puppet/modules
    ├── puppetlabs-apt (v2.2.0)
    ├── puppetlabs-concat (v1.2.4)
    ├── puppetlabs-postgresql (v4.6.0)
    └── puppetlabs-stdlib (v4.9.0)

/usr/share/puppet/modules (no modules installed)

Any ideas? I am running the appply command on a vagrant virtual machine in vagrant's home folder.

2
What is in /vagrant/puppet/modules?Chris Pitman
@ChrisPitman, I've put the output of a puppet modules list in the question.timmy
Why are you setting the modulepath when you run puppet apply but not when you list modules?Chris Pitman
@ChrisPitman, I was setting the modulepath like that because that is where my dev team has defined their puppet resources. But your comment pointed me in the right direction.timmy

2 Answers

2
votes

@ChrisPitman's comments pointed me in the right direction. I needed to set up the correct modulepath to include both our custom modules along with pre-built ones.

The following worked for me:

sudo puppet apply --modulepath=/vagrant/puppet/modules:/etc/puppet/modules -e "include iwd-postgresql"
0
votes

When you used the command puppet apply you was using this path /home/vagrant/puppet/modules, but your module is installed under /home/vagrant/.puppet/modules, anyway If you are using vagrant, I think is better if you the Vagrantfile for use puppet and customize your vm