我想包围我的头如何我可以从我在我的大site.pp文件中进行过渡到我可以在hiera中使用的结构。 从阅读傀儡文档来看,我不清楚这些文档究竟是如何评估以及何时适合这些图片的。 我最近从puppet 2.7.x升级到3.3.x. 这包括hiera作为标准包的一部分,所以我想最后看看使用这个,因为它应该使我的设置更容易阅读/理解。 我正在使用支持系统几个外部组织。 这包括configuration每个组织独有的系统。 在我的网站顶部,我有一个像下面的结构。 我使用哪个设置事实为每个组织基于一个正则expression式匹配的clientcert事实configuration和发布的方式,他们将可靠地识别每个组织。 # match organization case $::clientcert { /.*example1.org/ : { $snmp_ro_community='…' $snmp_location='Example Org 1' … } /.*example2.org/ : { $snmp_ro_community='…' $snmp_location='Example Org 2' … } /.*example3.org/ : { $snmp_ro_community='…' $snmp_location='Example Org 3' … } /.*example4.org/ : { $snmp_ro_community='…' $snmp_location='Example Org 4' … } } 我浏览示例我没有看到任何方式在我的hiera.yaml文件中做任何forms的匹配。 我怀疑我一定是错过了一些明显的东西。 我不想依赖于这个自定义的事实。 […]
是否有可能自动安装或包含傀儡模块在你的木偶configuration? 运行puppet apply之前,我不得不手动运行puppet module install 。
假设我在/etc/syslog.conf文件中有以下内容: # Log all kernel messages to the console. # Logging much else clutters up the screen. #kern.* /dev/console 我想将其更改为kern.* /var/log/kern.log以获取内核日志的可读时间戳。 木偶可以做到这一点: class syslog::config { file { "/etc/syslog.conf": ensure => present, source => "puppet:///modules/syslog/syslog.conf", require => Class["syslog::install"], notify => Class["syslog::service"], } } 或者我也可以使用sed -i 。 通过Augeas ,我可以在文件末尾追加这一行: class syslog::config { augeas { "syslogkern": context => […]
我正在为我的服务器的不同angular色编写特定的模块。 所以我有一个木偶和一个木偶仪表板模块 。 傀儡模块确保木偶安装正确。 傀儡仪表板在傀儡仪表板上也是如此。 这两个模块需要puppetlabs apt源(btw。我使用https://github.com/puppetlabs/puppet-apt )。 所以我在puppet- pupil -dashboard -module中有以下定义的资源: apt::source { "puppetlabs": location => "http://apt.puppetlabs.com", release => "squeeze", repos => "main", required_packages => true, include_src => false, key => "4BD6EC30", key_server => "pgp.mit.edu", } 现在我的代理程序出现以下错误: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Apt::Source[puppetlabs] is already […]
我遇到了以下Puppet清单的问题,这是为了启用RHEL-6系统上的passwdqc pam模块(这是使用Puppet 0.25.5和augeas 0.7.2): augeas { 'authconfig': context => '/files/etc/sysconfig/authconfig', changes => [ 'set USEPASSWDQC yes', 'set USECRACKLIB no', ], notify => Exec['authconfig-all'], } exec { 'authconfig-all': command => '/usr/sbin/authconfig –updateall', refreshonly => true, } 如果我运行这个清单,它似乎成功完成: info: Applying configuration version '1311189237' notice: //Augeas[authconfig]/returns: executed successfully info: //Augeas[authconfig]: Scheduling refresh of Exec[authconfig-all] notice: //Exec[authconfig-all]: Triggering 'refresh' […]
我尝试创build两个不同的文件与一个模板,因为他们只差一行。 file { "/tmp/bootstrap-raid.sh": content => template("pxe/bootstrap.sh.erb"), } file { "/tmp/bootstrap-noraid.sh": content => template("pxe/bootstrap.sh.erb"), } bootstrap.sh.erb: <% if ??? == "???" %> -r yes \ <% else %> -r no \ <% end %> 我不能通过定义两次$raid=yes file{} $raid=no file{}来传递variables,所以我试图在每个file{}定义variables,而不费力气。 那么我想在模板内使用targetfilename,如<% if filename == "/tmp/bootstrap-raid.sh" %>这也是不可能的。 如何使用不同的“参数”来调用两次模板 我的目标是不在清单文件中定义和调用额外的函数,或者创build两个模板。 有任何想法吗? 在模板中是否有任何预定义的默认variables,如目标文件的文件名,templatename,…? 编辑:另一个例子是有两个php.ini文件在debian中,一个用于命令行,另一个用于web服务器。 我只想交换内存限制。 但每个服务器都需要php.ini文件。 我正在寻找一种方法来传递一个硬编码的参数到模板文件或一种方式, if/then/else基于目标文件名。 当然,我知道我可以创build一个新的定义,我可以调用两次。 但我正在寻找一个更简单的方法。
查看我的节点的configuration: $property_name = { "unit_1" => { host => [ "dns_name1/192.168.0.1/25" ,"dns_name2/192.168.0.2/25" ] }, "unit_2" => { host => [ "dns_name3/192.168.0.3/25", "dns_name4/192.168.0.4/25" ] }, } include class::property 在模板中,我用了一些循环 "<% property_name.each do |key,value| -%>", "<%= value['host'][id_host].split("/")[0] %>", <%= value['host'][id_host].split("/")[1] %>, …写configuration文件。 但是,当我有很多“单位”(unit_3,unit_4等)时,每次Puppet的守护进程运行时,模板的内容都会改变。 它没有任何影响,因为configuration文件是正确的,但我想知道如果模板的循环可以生成这样的顺序的configuration文件:unit_1然后unit_2,然后unit_3,…没有采取一些单位随机。 我用这个教程: http : //www.krzywanski.net/archives/703
在与hiera捆绑在一起试图debugging我的木偶无数次的过程中,有时我怀疑是否正在执行正确的hiera查找。 我主要使用CentOS和Puppet 3。 有没有什么工具可以用来找出我正在使用的节点当前正在使用的hiera数据文件,而不是根据我的服务器configuration来猜测?
我想知道云计算pipe理工具和服务器configuration软件之间的区别,因为它们之间似乎有重叠。 我想从使用这两种软件的客户那里得到一些反馈。
我有两个改变ip route & sysctl ,禁用TCP慢启动。 这是我怎么做的 ip route show 记下从默认开始的行。 从默认线路中取出IP并运行 sudo ip route change default via $ip_address dev eth0 initcwnd 12 sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0 我怎样才能创build一个木偶剧本呢? 一个可以部署到许多相同types的机器 – CentOS 6 编辑:添加赏金来获得一个工作的例子 sudo ip route change default via $ip_address dev eth0 initcwnd 12