AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 608027
Accepted
Kai
Kai
Asked: 2014-06-26 23:23:29 +0800 CST2014-06-26 23:23:29 +0800 CST 2014-06-26 23:23:29 +0800 CST

puppetlabs/firewall - “找不到资源类型‘防火墙’”

  • 772

我对木偶很陌生,所以这可能只是我没有看到明显的东西。

我想使用 puppetlabs-firewall 模块并自己编写了一个小模块。init.pp 看起来像这样:

class cmmfirewall {
  resources { 'firewall':
    purge => true,
  }
  Firewall {
    before  => Class['cmmfirewall::postv4', 'cmmfirewall::postv6'],
    require => Class['cmmfirewall::prev4', 'cmmfirewall::prev6'],
  }
  class { ['cmmfirewall::prev4', 'cmmfirewall::postv4']: }
  class { ['cmmfirewall::prev6', 'cmmfirewall::postv6']: }
}

当我将此类应用于节点时,我收到以下消息:

err: Failed to apply catalog: Parameter name failed on Resources[firewall]: Could not find resource type 'firewall' at /etc/puppet/environments/testing/modules/cmmfirewall/manifests/init.pp:42

我在代理上的 puppet.conf 如下所示:

# File managed by Puppet

[main]
    vardir = /var/lib/puppet
    ssldir = $vardir/ssl
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    modulepath = /etc/puppet/modules:/opt/puppet/share/puppet/modules
    user  = puppet
    group = puppet
    archive_files = true
    archive_file_server = handsoff.dc0.mynetwork.de

[agent]
    certname = test3.dc0.mynetwork.de
    server = handsoff.dc0.mynetwork.de
    report = true
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig
    graph = true
    pluginsync = true
    runinterval = 300

如您所见,pluginsync 应该被激活,但是模块路径中的两个文件夹/etc/puppet/modules:/opt/puppet/share/puppet/modules都是空的。所以我的猜测是问题出在某个地方,并且 pluginsync 没有像我预期的那样工作。

有人可以指出我在哪里寻找错误的正确方向吗?

puppet
  • 1 1 个回答
  • 1868 Views

1 个回答

  • Voted
  1. Best Answer
    Kai
    2014-06-28T02:50:33+08:002014-06-28T02:50:33+08:00

    好的,实际上,当我将 puppetlabs-firewall 模块复制到我的公共文件夹(该文件夹包含在环境、测试和生产中)时,它就起作用了。

    现在我真的很想现在为什么。这是 puppetmaster 配置文件。也许有人可以告诉我为什么它的行为方式如此。

    ### File managed with puppet ###
    ## Module:           'puppet'
    
    [main]
        # The Puppet log directory.
        # The default value is '$vardir/log'.
        logdir = /var/log/puppet
    
        # Where Puppet PID files are kept.
        # The default value is '$vardir/run'.
        rundir = /var/run/puppet
    
        # Where SSL certificates are kept.
        # The default value is '$confdir/ssl'.
        ssldir = $vardir/ssl
    
        # Allow services in the 'puppet' group to access key (Foreman + proxy)
        privatekeydir = $ssldir/private_keys { group = service }
        hostprivkey = $privatekeydir/$certname.pem { mode = 640 }
    
        # Puppet 3.0.x requires this in both [main] and [master] - harmless on agents
        autosign       = $confdir/autosign.conf { mode = 664 }
    
        show_diff     = false
    
    ### Next part of the file is managed by a different template ###
    ## Module:           'puppet'
    
    [agent]
        # The file in which puppetd stores a list of the classes
        # associated with the retrieved configuratiion.  Can be loaded in
        # the separate ``puppet`` executable using the ``--loadclasses``
        # option.
        # The default value is '$statedir/classes.txt'.
        classfile = $vardir/classes.txt
    
        # Where puppetd caches the local configuration.  An
        # extension indicating the cache format is added automatically.
        # The default value is '$confdir/localconfig'.
        localconfig = $vardir/localconfig
    
        # Disable the default schedules as they cause continual skipped
        # resources to be displayed in Foreman - only for Puppet >= 3.4
        default_schedules = false
    
        report        = true
        pluginsync    = true
        masterport    = 8140
        environment   = production
        certname      = handsoff.dc0.mynetwork.de
        server        = handsoff.dc0.mynetwork.de
        listen        = false
        splay         = false
        runinterval   = 300
        noop          = false
        configtimeout = 120
    
    ### Next part of the file is managed by a different template ###
    ## Module:           'puppet'
    
    [master]
        autosign       = $confdir/autosign.conf { mode = 664 }
        reports        = foreman
        external_nodes = /etc/puppet/node.rb
        node_terminus  = exec
        ca             = true
        ssldir         = /var/lib/puppet/ssl
        certname       = handsoff.dc0.mynetwork.de
        strict_variables = false
    
    [production]
        modulepath     = /etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
        config_version = 
    [testing]
        modulepath     = /etc/puppet/environments/testing/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
        config_version = 
    
    • 0

相关问题

  • 如何修复 Puppet 完全限定的参数路径错误?

  • puppet:修改配置文件后强制重启服务

  • 木偶模块资源

  • 傀儡主机名问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve