人偶 Postgresql 错误

Puppet Postgresql Error

我使用 puppet 对我的 postgresql 安装应用增量更改。

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

这会导致以下错误:

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

我已经安装了 puppetlabs/postgresql 模块。

如果我做一个人偶列表,我会看到以下内容:

[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(未安装模块)

有什么想法吗?我是 运行 vagrant 主文件夹中 vagrant 虚拟机上的 appply 命令。

@ChrisPitman 的评论为我指明了正确的方向。我需要设置正确的模块路径以包含我们的自定义模块和预构建模块。

以下对我有用:

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

当你使用命令puppet apply时你使用的是这个路径/home/vagrant/puppet/modules,但是你的模块安装在/home/vagrant/.puppet/modules下,反正如果你使用vagrant,我如果你 Vagrantfile 使用 puppet 并自定义你的 vm

认为更好