首页 > 解决方案 > Error while evaluating a Resource Statement, Unknown resource type: 'vcsrepo'

问题描述

I am deploying my code using puppet. I am trying to clone code from git repo

vcsrepo { "/home/$server_admin/public_html":
        ensure   => latest,
        owner    => "$server_admin",
        group    => "$server_admin",
        provider => git,
        require  => [ Package["git"] ],
        source   => "$server_gitrepo",
        revision => "$server_gitbranch",
    }

when executing script on client machine.

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'vcsrepo' (file: /etc/puppetlabs/code/environments/production/modules/alpha/manifests/source.pp, line: 32, column: 4) on node

Note: git already installed on client machine

标签: gitautomationpuppetdevops

解决方案


在 Puppet 服务器上报告错误。它与客户端是否安装了Git无关。事实上,它与 Git 根本没有太大关系。

Puppet 抱怨——实际上相当清楚——它无法识别vcsrepo您尝试使用的资源类型。这确实不是内置资源类型,因此如果您没有使用该名称编写自定义类型或从模块中获得一个,那么 Puppet 不知道您在说什么。

很可能您正在寻找puppetlabs/vcsrepo模块,它确实提供了该名称的类型,但我们无法确定。


推荐阅读