Articles of 傀儡

木偶清单使用哈希

我正在努力使这个工作,不明白我要去哪里错了,有人请指导我如何纠正? 基本上我想在我的nodes.pp中获得一个数组,然后我的模板文件通过循环遍历它并写入每个元素的一行: nodes.pp: node test{ net::addr { 'routing': $routes = { route1 => { address => '172.29.54.70', netmask => '255.255.255.0', gateway => '172.29.54.65', dev => 'eth0', }, route2 => { address => '192.168.1.3', netmask => '255.255.255.0', gateway => '192.168.1.1', dev => 'eth3', }, } } } 当我运行木偶客户端时,我不断收到以下内容: err:无法从远程服务器检索目录:SERVER上的错误400:无法parsing环境生成:“=”处出现语法错误; 在节点test.myincorp.net上的/ etc / puppet / manifests / […]

如何在使用git时将puppet模块添加到Gepetto?

我遵循了Puppet 2.7 Cookbook的一些“最佳实践”,并使用git cvs创build了agent-puppet master框架。 不幸的是,这本书不包括Gepetto,所以我不得不即兴创作这部分。 我有一个主要的git仓库,其中包含manifests和modules文件夹。 我想在模块中添加一个自定义模块,但是这样做的时候遇到了问题。 首先,我找不到像“主configuration”项目types,默认情况下将包含manifests和modules文件夹。 所以我创build了一个裸“Puppet项目”项目,并手动创build文件夹。 因为 – 据我了解 – 在这个configuration中,Gepetto并不真正知道,这个项目实际上将保存所有的模块,它没有提供一个选项来创build“Puppet模块项目” 子项目 ,它将嵌套在“木偶项目“的modules文件夹。 当我手动嵌套它(通过在New Puppet Module Project向导中指定一个自定义位置),我得到一个'Auto share git projects' has encountered a problem错误: 无法忽略资源尝试beginRule:F / puppet @ puppetmaster / modules / unnamed,不符合外部作用域规则:MultiRule [P / mymodule] 当所有的东西都被封装了所有configuration的“master project”所覆盖的时候,你们有没有人设法让Gepetto使用模块?

木偶,hiera和erb – erb不会识别数组

我有一个非常恼人的错误,我急于解决。 我有一个木偶模块,在yaml文件(hiera)中保存某些东西,以便人们可以快速编辑该部分。 该结构是嵌套的。 这样的模板: <%= @platforms[@platform]['users_allowed'][@host].class %> 呈现给: Array 但是当我尝试迭代它时: <% @platforms[@platform]['users_allowed'][@host].each do | pubkey | %> <%= pubkey %> <% end %> 木偶说: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template somemodule/templates/authorized_keys.erb: Filepath: /etc/puppet/modules/somemodule/templates/authorized_keys.erb Line: 1 Detail: undefined method `each' for nil:NilClass 它是如何突然成为零,我如何在这里迭代? 恐怕我被困在这里,甚至不知道在哪个方向上我应该寻找解决scheme。 没有hiera或没有嵌套结构的重写模块在这种情况下不是一个选项。

Hiera连接从yaml查找

我正在尝试通过Hieraconfigurationpuppet-logstash模块。 当我打电话给hiera('profiles::logstash::config') ,返回值是一个串联的string。 它告诉我,它不能把一个string转换成一个散列。 shipper.pp class profiles::logstash::shipper() { $shipper_config = hiera('profiles::logstash::config') notice("${shipper_config}") class { 'logstash': ensure => 'present', version => '1.4.1-1_bd507eb', status => 'enabled', } profiles::logstash::config { $shipper_config: } include logstash } hostname.yaml classes: – os::repo – profiles::logstash::shipper profiles::logstash::config: – {content: this is a test, order: 10} 与notice()一起使用时的输出: order10contentthis is a test 我命令我的YAML错了吗?

木偶 – 自动configurationVagrant虚拟机

我有三个使用Vagrant创build的虚拟机。 这个虚拟机具有ubuntu / trusty64的框。 我创build了与单个项目相同的Vagrantfile中的所有虚拟机。 configuration它,我使用了Puppet。 目前,三个虚拟文件使用不同的清单。 我想在清单变化时自动化这个过程。 所以,如果我添加一个包到一个清单,我希望在没有我的干预的情况下,stream浪汉根据清单文件中的新变化检测并重新configuration虚拟机。 我是stream浪汉的新手,更多是木偶,因此我的问题是: 那可能吗? 这是我正在开发的项目: https : //github.com/jngd/puppet-tfg

使用hiera在example42 / apache中包含模块

我正在尝试为工作(开源版本)设置一个puppetconfiguration,我的目标是创build一个标准类,我们的大多数服务器可以在清单中使用一个简单的hiera_include。 我正在尝试一些apache puppet模块,puppetlabs似乎支持很多东西,但是使用hiera并不是很好,而且生成的configuration与我们习惯的有些过分。 另一方面来自example42的那个让你使用自己的模板,这非常棒。 但我仍然无法弄清楚如何启用模块。 医生说 apache::module { 'proxy': templatefile => 'site/apache/module/proxy.conf.erb', } 我如何转换为hiera? 这甚至有可能吗? 虽然不需要模板文件,只是在yaml文件中寻找“启用这些模块”的方法。 谢谢

vcsrepo木偶模块不使用用户参数为mercurial

我有一个服务器,依靠puppet vcsrepo来更新本地mercurial仓库中的代码基于标签。 当我更改所需的标签时,使用vcsrepo“revision”参数,vcsrepo应该在repo上执行hg pull和hg update。 这一切工作正常。 不过,我已经创build了这个服务器的一个克隆来testing其他的东西,现在当我运行木偶更新时,我得到一个错误: Not trusting file /var/hg/repo/.hg/hgrc from untrusted user *user*, group *group* 发生这种情况是因为puppet以root身份运行,而hgrc文件则由用户拥有 vcsrepo中的用户参数应该是这样处理的: vcsrepo { '/var/hg/repo': ensure => present, provider => hg, source => 'ssh://****', user => 'user', owner => 'user', group => 'group', revision => '1.12' } 即 hg命令应该以用户身份运行,以便满足mercurial中的Trust要求。 但它不工作。 克隆服务器有点复制原来的位。

更新最后清单的Puppet代理自动更改

我在CentOS 6.6上有10个代理的Puppet服务器。 要更新最后清单更改的代理,我在代理上使用此命令: puppet agent –no-daemonize –onetime –verbose 所以当我在puppet服务器上进行更改时,我需要访问所有代理并运行此命令。 我想知道是否有一个命令,我可以在Puppet服务器中运行,以更新所有代理与最后的清单更改。 谢谢

在CentOS系统上使用puppet安装apt-dater-host

我想使用puppet和foreman在基于Debian 和 CentOS的系统上安装apt-dater-host。 在Debian上,软件包在标准仓库中可用 – 但是在CentOs上,情况并非如此 – 我使用了RPMsearch并获得了以下结果 。 我如何使用yum安装包?

无法从puppet查找hiera-file的值

我正在升级一个旧的木偶2.7安装到木偶3.8,我也一直在洗牌hiera的一些数据的位置。 我不确定这里有什么责任。 puppet agent –test ,运行在同一个系统运行puppetserver是给我一个错误: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item nagios::htpasswd.users in any Hiera data file and no default supplied at /etc/puppet/modules/nagios/manifests/master.pp:77 on node xxx.example.com 这个特定的hiera密钥来自一个文件,通过hiera-file后端。 引用的puppetconfiguration行在一个文件资源中指定: content => hiera('nagios::htpasswd.users') 但是,我可以成功运行以下内容: puppet apply -e 'notice hiera("nagios::htpasswd.users")' 所以,我认为所有的数据都在正确的位置,但puppetserver是由于某种原因没有按预期使用hiera-file,尽pipe它在/etc/puppet/hiera.yaml中configuration 任何人都可以提出这里发生了什么?