1

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.

timmy
  • 1,752
  • 6
  • 23
  • 35

2 Answers2

2

@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"
timmy
  • 1,752
  • 6
  • 23
  • 35
0

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

c4f4t0r
  • 1,563
  • 15
  • 24