Puppet报错wrong header line format

今天编写msmtp的模块时,突然报了个错:

Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: wrong header line format
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

网上多说是模板错误,但是使用命令检查后也没有问题啊:

#erb -x -T '-' -P ../../sys_mutt/templates/Muttrc.local.erb |ruby -c
Syntax OK

模块结构如下:

sys_msmtp
├── files
│   ├── mail.rc
│   ├── msmtp-1.4.31.tar.bz2
│   ├── msmtp-install.sh
│   ├── msmtpqueue-0.5.tar.gz
│   └── msmtpqueue-install
├── manifests
│   ├── config.pp
│   ├── init.pp
│   └── install.pp
└── templates
    └── msmtprc.erb

各文件内容如下:

init.pp

class sys_msmtp {
    include sys_msmtp::install, sys_msmtp::config
}

install.pp

class sys_msmtp::install {
    case $operatingsystem {
        'CentOS','RedHat':   {
            file { "/usr/local/src/msmtp-1.4.31.tar.bz2":
                mode        =>  644,
                source      =>  "puppet:///modules/sys_msmtp/msmtp-1.4.31.tar.bz2",
            }

            file { "/usr/local/src/msmtp-install.sh":
                mode        =>  744,
                source      =>  "puppet:///modules/sys_msmtp/msmtp-install.sh",
            }

            exec { "msmtp-install":
                cwd         =>  "/usr/local/src",
                command     =>  '/usr/local/src/msmtp-install.sh',
                require     =>  [ File["/usr/local/src/msmtp-install.sh"], File["/usr/local/src/msmtp-1.4.31.tar.bz2"] ],
                onlyif      =>  "test ! -e /usr/local/msmtp/bin/msmtp";
            }
        }
        default: { fail("目前暂不支持$operatingsystem系统") }
    }
}

config.pp

define config (
    $account_name,
    $passwd,
    $host_address,
    $auth_enabled
) {
    case $operatingsystem {
        'CentOS','RedHat':   {
            file { "/usr/local/msmtp/etc/msmtprc":
                content =>  template("sys_msmtp/msmtprc.erb"),
                require =>  Class["sys_msmtp::install"];
            }

            file { "/etc/mail.rc":
                mode        =>  644,
                source      =>  "puppet:///modules/sys_msmtp/mail.rc",",
            }
        }
        default: { fail("目前暂不支持$operatingsystem系统") }
    }
}

然后,找了N久,终于看到了config中的错误。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值