【问题标题】:Why does puppet module postgresql produce this error not found in the catalog为什么 puppet 模块 postgresql 会产生此错误 not found in the catalog
【发布时间】:2022-07-14 19:40:31
【问题描述】:

我正在使用来自https://forge.puppet.com/modules/puppetlabs/postgresql/7.5.0 的 puppet 模块 postgresql,并且在 hiera 中声明了以下内容

postgresql::server::pg_hba_rules:
  "allow_subnet_1”:
    description: 'Allow subnet 1'
    type: 'host'
    address: ’10.10.56.0/24'
    database: 'foreman'
    user: 'foreman'
    auth_method: 'md5'
    order: '201'

这会产生以下警告,

Warning: /Stage[main]/Postgresql::Server/Postgresql::Server::Pg_hba_rule[allow1]/Concat::Fragment[pg_hba_rule_allow1]/Concat_fragment[pg_hba_rule_allow1]: Target Concat_file with path of /var/lib/pgsql/14/data/pg_hba.conf not found in the catalog

尝试创建 hba 规则但失败并显示“在目录中未找到” - 我能否获得帮助以了解为什么无法按预期工作?

如果需要,我可以提供更多日志。

谢谢

【问题讨论】:

  • Hiera 数据本身不会产生任何东西(包括错误)。涉及的 Puppet DSL 代码是什么?是否涉及任何其他 Hiera 数据?作为minimal reproducible example,请。
  • 清单中唯一的 Puppet 代码是包含 postgresql::server 在 hiera 我包含了这个并且文件资源已更新 postgresql::globals: manage_pg_hba_conf: 'true' pg_hba_conf_path: '/var/lib/ pgsql/14/data/pg_hba.conf'
  • @ssaini 你能告诉我如何解决这个问题吗?我也有同样的问题。
  • @Maryam 在下面看到我刚刚添加的答案

标签: postgresql puppet


【解决方案1】:

这行得通。

添加规则:

postgresql::globals:
  manage_pg_hba_conf: 'true'

postgresql::server::pg_hba_conf_path: "/nfs/pgsql/data/%{hiera('postgresql::globals::version')}/pg_hba.conf"
#postgresql::server::manage_pg_hba_conf: true

postgresql::server::pg_hba_rules:
  "Allow xxx":
    description: 'Allow trusted connection for the xxx server.'
    type: 'host'
    database: 'all'
    user: 'postgres'
    address: '10.10.10.1/32'
    auth_method: 'trust'
  "Allow xxx1":
    description: 'Allow trusted connections from the monitoring host (xxx1).'
    type: 'host'
    database: 'postgres'
    user: 'nagios'
    address: '10.10.11.1/32'
    auth_method: 'trust'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-13
    • 1970-01-01
    • 1970-01-01
    • 2020-05-17
    • 2014-02-05
    • 2015-02-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多