我正在收回一个使用 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 中未受影响的文件,可以在这里找到:https://github.com/puppetlabs/puppetlabs-apt/blob/master/manifests/init.pp
但是当我运行解析器时出现错误
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 版本
puppet --version
3.8.7
我做错了什么?我错过了什么?
如果你需要更多信息,请告诉我,我会尽快提供
[编辑] 经过推荐我尝试了这个但仍然不起作用:
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)
[编辑] 尝试迁移到最新版本的 Puppet
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 时:
puppet --version
-bash: /usr/bin/puppet: No such file or directory
没有什么叫做傀儡/usr/bin/
答案1
错误是由于你使用的是旧版本的 Puppet (3.X)2016 年 12 月停产,新版本的 Apt 模块使用了新的Puppet 数据类型仅适用于 Puppet 4+。
最简单的解决方法是升级到最新版本的 Puppet。由于上游的 Ubuntu 14.04 是旧版本,我建议迁移到 Puppet apt 存储库。您可以使用以下命令轻松完成此操作我写的脚本:
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
答案2
你的模块puppetlabs/apt需要依赖puppetlabs/stdlib(也可以看看https://forge.puppet.com/puppetlabs/apt/dependencies)。
添加标准库(即puppet module install puppetlabs-stdlib --version 4.21.0
)添加到您的系统模块路径。