Articles of 木偶

让木偶运行,而不用在RVM安装中覆盖我的gem

我有一个木偶设置包含一个木偶大师和几个节点 – 这是按预期工作。 但是 – 在我正在工作的最新节点上,我需要安装rvm / ruby​​ + nginx / passenger。 这是使用这些傀儡模块完成的 maestrodev-rvm(v1.13.1)puppet-nginx(v0.6.0) 所有这一切都安装和工作 – 我可以做捆绑安装,并确认这是安装到正确的gemset,如果我去一个不同的文件夹,我可以确认gem列表不拾取这个gem的gem。 访问我的应用程序也可以工作,并产生预期的结果。 到目前为止这么好..问题开始下一次木偶运行 – 这导致所有我的gem与原生扩展打破。 我收到错误: Message from application: incompatible library version – /usr/local/rvm/gems/ruby-2.3.1@robot/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.so (LoadError) 在比较puppet运行前/后的文件内容(使用md5sum)时,我得到不同的校验和。 这似乎是我运行时得到一些意想不到的输出 /opt/puppetlabs/puppet/bin/gem env RubyGems Environment: – RUBYGEMS VERSION: 2.2.5 – RUBY VERSION: 2.1.9 (2016-03-30 patchlevel 490) [x86_64-linux] – INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.3.1 – RUBY […]

傀儡variables覆盖失败

我是一个傀儡的新手,遇到了一些问题作为主题,search了一段时间,但失败了一个匹配的答案。 Mys的问题是: 我在/etc/puppet/manifests/site.pp中定义了全局variables$ puppetserver,如下所示: case $domain { /domain2/:{ $puppetserver = "puppetserver2" include migrate } default:{ $puppetserver = "puppetserver3" } } 在manifeststs / labs / domain2 / nodes.pp中的domain2中的服务器的节点定义中 node 'server1.domain2.com' { $puppetserver = "puppetserver3" } 迁移模块用于傀儡迁移,从网上获取如下: 在modules / migrate / manifests / config.pp中 class migrate::config { if $puppetserver == undef { fail('You must define the targeted […]

获得一系列的木偶虚拟资源

有没有办法获得木偶虚拟资源列表? 我有我的用户设置为虚拟资源: @accounts::user_virtual { 'dscott': uid => 600, ssh_key => 'AAAAAAAAAA…', } … other users here 我有一个hiera值,其中包含启用的用户列表: 'dscott,user1,user2,…' 因此,在每个节点上,我想要添加列表中的用户,并确保已从列表中删除的用户从服务器中删除。 所以,我需要从我的hiera值列表中减去所有用户的列表。 我如何获得“所有用户”的列表? 理想情况下,我想获得所有accounts::user_virtual资源的列表。

有什么办法告诉Puppet augeas资源使用哪种编码?

我是新来的augeas,我得到了很多错误,如: Could not evaluate: invalid byte sequence in UTF-8 在特殊的我希望augeas兑现XML文件中的编码声明 <?xml version="1.0" encoding="ISO-8859-1"?> 但在镜头的源代码,我不明白,这是考虑到,但我可能是错的感觉,我不明白的镜头格式很多: https : //github.com/hercules-team/augeas/blob /master/lenses/xml.aug 或者Java-Properties-File总是被视为ISO-8859-1 ,并且镜头源代码中没有任何编码的痕迹: https : //github.com/hercules-team/augeas/blob/master/镜头/ properties.aug 我的第一个问题是:augeas推断正确的编码为XML和属性 – 文件? 我的第二个问题是:有没有办法告诉augeas使用哪种编码? 放弃 假设系统默认的编码是UTF-8: vi testUTF.properties # Käse abc=test # tèté persona=niño 一切都很好: puppet-test:~ # augtool –noautoload augtool> set /augeas/load/Properties/lens Properties.lns augtool> set /augeas/load/Properties/incl "/root/testUTF.properties" augtool> load augtool> print […]

木偶资源依赖

大家好, 当我做傀儡申请时,我得到的错误: Warning: Scope(Mod::Cl[title]): Can't load '/tmp/file.yaml' File does not exist! Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Operator '[]' is not applicable to an Undef Value. 我指定loadyaml是stdlib模块的一个function 但是,我想在定义资源之前执行文件资源 有人可以帮助我吗? class mod :: princ( 文件{'/tmp/file.yaml': 确保=>文件, owner =>'root', group =>'root', mode =>'0644', source =>“puppet:///modules/othermod/file.yaml”, before => Mod :: Cl [“title”], } […]

数据源在新节点上失败的Hiera查找

我试图用puppetbuild立一个新的节点,但是它失败了,导致我认为hiera没有find正确的数据源: Server Error: Evaluation Error: Error while evaluating a Function Call, undefined method `empty?' for nil:NilClass at ${line 4 in some selfwritten class} 我也有这个错误,但我不记得我改变了什么(如果有的话),导致它: Server Error: Evaluation Error: Error while evaluating a Function Call, Unknown alias: 3B4007E7596ADF847ECA510D57069DBF2B3DB006 at ${line 4 in the same selfwritten class} 木偶抱怨的class级线路是这样的: $network = hiera("network") 这是class上的第一行。 相同的查找在不同的节点上工作。 我的/etc/puppetlabs/puppet/hiera.yaml看起来像这样 — :backends: – […]

dynamic列表在木偶?

我正在使用puppet(版本4.x,其中2 <= x <= 8)来configuration系统。 我有许多由Hiera提供的variables,每个variables都包含一个组列表。 input数据如下所示: project1_groups: – group1 – group2 project2_groups: – group2 – group3 project3_groups: – group2 – group4 从这里,我需要build立一个我可以传递给user资源的单一列表。 从概念上讲,我想要: $groups = project1_groups + project2_groups + project3_groups user { 'someuser': groups => $groups } 换句话说,从上面的input数据我想要得到一个可能看起来像这样的组列表: [group1, group2, group2, group3, group2, group4] 傻瓜是好的,名单不一定是唯一的。 但是有一个并发症! 诀窍是我不知道可用的project*_groupsvariables。 我有一个variables$projects ,在上面的例子中将包含列表[project1, project2, project3] 。 我想出了一个基于inline_template的解决scheme,虽然工作起来,但看起来inline_template 。 […]

将r10k与单独的模块存储库一起使用

我有一个工作设置的木偶与主和代理。 现在我正在尝试使用r10k来pipe理Puppet代码。 我的目标是在代码更改的每个git push上,Puppet Master上的/etc/puppetlabs/code/environments下面的Puppet代码会自动更新。 虽然这似乎适用于包含所有模块的单片控制库,但如果自定义模块位于单独的Git存储库中,则无法正常工作。 我的设置如下: /etc/puppetlabs/r10k/r10k.yaml中的r10kconfiguration : sources: operations: remote: '/srv/git/puppet.git' basedir: '/etc/puppetlabs/code/environments' 中央控制库 /srv/git/puppet.git包含分支机构的production和testing ,每个都有: 具有节点configuration的manifests/site.pp ,例如node default { contain mymodule } 一个带有外部模块引用的Puppetfile 用于testing的Puppetfile看起来像例如 mod 'mymodule', :git => 'file:///srv/git/mymodule.git', :ref => 'HEAD' 而为了production它看起来像例如 mod 'mymodule', :git => 'file:///srv/git/mymodule.git', :ref => 'stable' (直到这个工作,我只有分支production和参考头。) 每个自定义模块的另一个Git仓库 ,例如/srv/git/mymodule.git 每次执行git push时, Git挂钩运行r10k: /srv/git/puppet.git/hooks/post-receive 与内容r10k deploy environment -pv […]

无法通过Puppet和Git系统推送新脚本

我们有一个configuration了Git的puppet(版本0.24.5)服务器,运行在Debian Lenny x64上。 这是一个当前正在运行的环境,根据需要推动木偶更新,除了一个障碍。 我最近定义了一个调用python脚本的自定义检查命令。 我把这个脚本放在/ etc / puppet / files / nagios / plugins /这是其他(之前已经被压入的)脚本所在的puppet框上的分发目录。 我定义了哪些主机将使用新的检查命令等 当我在puppet服务器上提交更改时,Git会看到新文件并提交。 在客户端,我可以重新启动木偶客户端,daemon.log将显示find的新文件,但它永远不会被推送到任何客户端。 然而,Nagios并没有得到更新,当然,检查失败了,因为它找不到要运行的脚本。 对于我的生活,我无法弄清楚为什么会发生这种情况。 在puppet服务器上,我已经对插件目录中的其他脚本对新的python脚本进行了三重检查,并且无法弄清楚我缺less的东西。 谢谢!!

将所有Puppet客户端的条形文件复制到主Puppet服务器的自定义事实

我知道Facter并不打算这样做,但是我很乐意知道如何编写一个自定义的事实来将文件从Puppet客户端复制到主要的Puppet服务器。 谢谢。