错误的木偶“哈希”; 预期的')'在/tmp/modules/apt/manifests/init.pp:6默认

我正在使用puppet收回一个项目来安装服务器。 我们有我们的process.pp文件正常工作

当我跑步

puppet parser validate manifests/ikuwprocess.pp 

没有错误是如此之多

但是在这个过程中,我们调用了apt,并得到这个错误:

 Error: Syntax error at 'Hash'; expected ')' at /tmp/modules/apt/manifests/init.pp:6 on node ourserver.40qyqnbkn0mu3edhynn2jlebec.ax.internal.toto.net 

init.pp似乎是从puppet未触及的文件,可以在这里find: https : //github.com/puppetlabs/puppetlabs-apt/blob/master/manifests/init.pp

但是当我运行parsing器时,我得到了错误

 puppet parser validate /tmp/modules/apt/manifests/init.pp Error: Could not parse for environment production: Syntax error at 'Hash'; expected ')' at /tmp/modules/apt/manifests/init.pp:6 

我不知道该怎么办…在这里我的操作系统版本:

 DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS" NAME="Ubuntu" VERSION="14.04.5 LTS, Trusty Tahr" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 14.04.5 LTS" VERSION_ID="14.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" 

还有我使用的木偶版本

 puppet --version 3.8.7 

我在做什么错我失踪了?

如果你需要更多的信息,请告诉我,我会尽快提供

[编辑]后,我已经尝试过这个build议,但仍然不工作:

 puppet module install puppetlabs-stdlib --version 4.21.0 Notice: Preparing to install into /home/myaccount/.puppet/modules ... Notice: Created target directory /home/myaccount/.puppet/modules Notice: Downloading from https://forgeapi.puppetlabs.com ... Notice: Installing -- do not interrupt ... /home/myaccount/.puppet/modules └── puppetlabs-stdlib (v4.21.0) 

[编辑]试图迁移到最新版本的木偶

 wget -O - https://raw.githubusercontent.com/petems/puppet-install-shell/master/install_puppet_agent.sh | sudo sh Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: puppet-agent 0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded. Need to get 0 B/16.8 MB of archives. After this operation, 91.3 MB of additional disk space will be used. Selecting previously unselected package puppet-agent. (Reading database ... 30718 files and directories currently installed.) Preparing to unpack .../puppet-agent_5.3.3-1trusty_amd64.deb ... Unpacking puppet-agent (5.3.3-1trusty) ... Processing triggers for ureadahead (0.100.0-16) ... Setting up puppet-agent (5.3.3-1trusty) ... 

但是当我试图叫傀儡

 puppet --version -bash: /usr/bin/puppet: No such file or directory 

而且在/usr/bin/

错误是由于您使用的旧版本的Puppet(3.X)是EOL截至2016年12月 ,而较新版本的Apt模块使用的是仅Puppet 4+的新Puppet数据types 。

最简单的修复方法是升级到最新版本的Puppet。 由于Ubuntu 14.04上游版本较旧,我build议转移到Puppet apt repos。 你可以用我写的脚本轻松做到这一点:

wget -O – https://raw.githubusercontent.com/petems/puppet-install-shell/master/install_puppet_agent.sh | sudo sh

或者,您可以手动设置升级的回购站点,其中包含以下文档: https : //puppet.com/docs/puppet/5.3/puppet_platform.html#apt-based-systems

您的模块puppetlabs / apt需要依赖于puppetlabs / stdlib (另请参阅https://forge.puppet.com/puppetlabs/apt/dependencies )。

添加stdlib (即与puppet module install puppetlabs-stdlib --version 4.21.0 )到您的系统模块path。