Articles of 傀儡

为什么variables不可用?

背景 我想申请这个想法有一个common类,其中包括所有关于我的设置的具体信息。 所以我创build了/etc/puppet/modules/common/manifests/init.pp class common { include common::data } class common::data { $ntpServerList = [ 'ntp51.ex.com','ntp3.ex.com' ] } 并安装了这个 ntp模块,并创build了一个像这样的节点 node testip { include myconfig::ntpp } 问题 /etc/puppet/modules/myconfig/manifests/init.pp包含 class myconfig::ntpp { include common class {'ntp': server_list => $ntpServerList # server_list => ['ntp.ex.com'] # this works } } 而且我会期望$ntpServerList将可用,但事实并非如此。 错误是 Error: Could not retrieve catalog from […]

为什么我的命名空间和类名冲突?

我有一个名为ntp的puppet模块。 我要定义一个节点 node testip { include myconfig::ntpp } 并在/etc/puppet/modules/myconfig/manifests/init.pp有我 class myconfig::ntpp { include common class {'ntp': server_list => $common::data::ntpServerList } } 这完美的作品。 但是,如果我用myconfig::ntp取代myconfig::ntp Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Myconfig::Ntp] is already declared; cannot redeclare on node testip 题 是否有可能让我的节点看起来像? node testip { include myconfig::ntp }

用puppet来pipe理incrontab

木偶有pipe理crontab的cron资源,但有没有类似的方式pipe理incrontab ? 我无法find任何有关这方面的文章,公平地说,我对傀儡(软件开发者帮助过度劳累的系统pipe理员)是一个非常陌生的人。

删除旧的木偶回购configuration

我想巩固我的存储库到一个新的存储库结构,我有这个工作在Puppet。 但是,旧的yum存储库信息仍然保留在节点上。 木偶能否强制拆除旧的百胜资料库? 你怎么做呢?

木偶:维护apt.list

我使用木偶来维护越来越多的debian机器。 这些将从初始化开始维护。 这意味着一步将设置apt'sources.list'文件,然后更新它。 还有其他模块依赖于这个列表是最新的,如果apt-get update没有被调用,将会失败。 我想知道的是,我应该引入某种sorting过程(使用阶段或类似)来确保在尝试安装应用程序之前更新包列表,或者假设在第一次运行时可能会失败,但在后续运行一旦清单更新? 傀儡的精神似乎宣告了一个“最后的状态”,而不是一个过程。 这使我相信,让错误发生可能是要走的路。

木偶或厨师来configurationweb应用程序

我正在寻找一个基于java的webapps部署到QA / preprod环境的部署工具。 应用程序是典型的Web应用程序,通过.properties文件编译为war / ear。 在部署期间(Jboss,tomcat或webshpere),war / ear中的一些属性需要configuration不同的名称(如不同的数据库主机/端口/模式)。 通过谷歌看看有什么可以帮助。 发现Puppet / Chef在开源中被主动使用,但是找不到任何有关将它用作“战争/耳朵”部署工具的信息,或者我完全错了。

我怎样才能通过木偶configuration智能主机的exim4?

我试图通过傀儡自动化的设置。 我遵循这里描述的方法,这为我几个包工作,但为了进出口我有一个问题:一个select没有正确应用在一个新的系统。 在设置exim或运行dpkg-reconfigure exim4-config ,我select了如下面截图所示的smarthost选项 将select导出到文件导致以下(剥去一些部分) $ debconf-get-selections | grep exim exim4-config exim4/dc_other_hostnames string my.other.hostname exim4-config exim4/dc_eximconfig_configtype select mail sent by smarthost; received via SMTP or fetchmail exim4-config exim4/no_config boolean true exim4-config exim4/hide_mailname boolean true exim4-config exim4/dc_postmaster string exim4-config exim4/dc_smarthost string my.smarthost.com::port exim4-config exim4/dc_relay_domains string exim4-config exim4/dc_relay_nets string exim4-base exim4/purge_spool boolean false exim4-config exim4/mailname string […]

傀儡排除模块

我为puppet中的所有服务器创build了一个基类, class centos_base { include chkconfig include hosts include inittab include nscd include nsswitch include ntp include puppet include syslog::base include ssh # include curp include security include sysctl include sudo include users include vim include yum include rpmforge # include vmware-tools import 'resolver' resolv_conf { default_resolver: domainname => "domain.com", searchpath => ['domain.com'], nameservers => […]

使用hiera访问另一个节点的事实

我们要做的是为iptables生成防火墙规则(puppetlabs /防火墙)。 我们的节点如此概念分组: — site1 —- shared1 —— specific1 —— specific2 —- shared2 —— specific3 —— specific4 节点“specific4”将始终需要访问“shared2”上的端口8080和“site1”上的端口10000。 “specific1”同样需要访问“shared1”上的8080。 每个节点的规则总是相同的,但他们将依赖于他们分开的组。 我正在努力寻找一种方法来代表这个没有重复的地域。 是否有可能从一个完全独立的节点获得事实? 我想我想能够做到这样(简化): — hosts: host specific4: rules: rule: port: 8080 ip: get_ip(get_my_shared()) 但显然,你不能从yaml文件中调用函数。 最好的办法是使用自定义事实吗? 我还没有真正使用hiera,所以我不确定最佳实践,不知道什么。 任何温柔的推动正确的方向将是最感激的。 编辑: 这是我走了的解决scheme,但如果我可以使用导出的资源,我可以删除对puppetdb查询的依赖。 # helper for creating rules from an array define firewall_rules($port, $service_type) { $source = $name firewall […]

木偶系统的木偶sshkey集合

在我的系统上,我使用导出的资源和资源集合来pipe理系统的/ etc / ssh / known_hosts引用 。 这对我所有通过木偶pipe理的SSH主机都很有效。 但是我也有系统不是由木偶(交换机,路由器等)pipe理,我没有任何立即计划开始pipe理它们。 有没有什么优雅的方式来获得这些非托pipe系统的主机密钥到puppet? 现在我只把他们全部放在一个丑陋的class级里,但是一定有更好的办法。 我曾经想过要把这些主机的密钥移到hiera或其他东西上,但是我还没有find一个不难看的解决scheme。 有没有人有一个很好的方法/模式,我可以在这里遵循?