Articles of 木偶

在具有不同variables值的不同点处重新应用模板

我似乎不明白如何在Puppet清单的应用程序中改变文件资源的内容。 我用Vagrant来设置开发环境。 我想安装oh-my-zshell ,为.zshrc 文件提供一个模板 。 哦,myzshell有插件的概念,所以我select我想要的插件,将它们添加到模板,并使其成为傀儡清单的模板: class oh_my_zshell { include git include zsh $oh_my_zshell_dir = "${vagrant_home_dir}/.oh-my-zsh" $plugins = "command-not-found common-aliases sudo" $theme = "ys" $zshrc = "${vagrant_home_dir}/.zshrc" $backup = "${zshrc}.orig" @file { "zshrc": path => $zshrc, ensure => file, content => template("oh_my_zshell/zshrc.erb"), } realize( File["zshrc"],Package["zsh"] ) 喀嚓! 并在模板中: # Which plugins would you like […]

如何在RHEL版本7上安装可选通道?

要在RedHat Linux版本7上安装Puppet Master,您需要安装一个可选通道。 有人可以提供指导如何做到这一点? 我想安装木偶大师。 我试图安装没有可选通道的Puppet Master。 最主要的是我不能启动傀儡大师。 我运行这个:/etc/init.d/puppetmaster restart 但是我得到这个:-bash:/etc/init.d/puppetmaster:没有这样的文件或目录 Puppet Labs网站有一个用于安装可选频道的链接。 其他地方一定有方向。

如何解决错误:找不到类apache :: base?

我使用camptocamp / puppet-nagios中的以下示例清单: node 'central_monitoring_server' { import "nagios" $nagiosadmin_password = "XXXX" … include apache::base include nagios::base include nagios::nsca::daemon include nagios::webinterface } 不过我有这样的警告: 错误:找不到debian-77-wheezy-64的类apache::base 我不清楚我该怎么做。 我可以只使用: include apache 这应该等同于include apache::base ? 这是正确的做法吗? 我使用puppet(v3.7.4),camptocamp-nagios(v1.0.4)和puppetlabs-apache(v1.2.0)。

puppet:类实例的执行顺序

我知道我可以如何使用Puppet中的资源sorting来订购内置types(用户,组,cron …)或类,但是我不知道如何才能将它用于类的特定实例。 例如,我使用puppetlabs / apt模块和apt :: source定义的types来推送wheezy / updates / … apt源代码。 我的代码看起来像 apt::source { 'debian_wheezy': location => 'http://ftp.debian.org/debian/', release => 'wheezy', repos => 'main contrib non-free', include_src => false, } apt::source { 'debian_wheezy_updates': location => 'http://ftp.debian.org/debian/', release => 'wheezy-updates', repos => 'main contrib non-free', include_src => false, } 我想使用另一个模块来configurationHAProxy,但是我需要定义另一个apt :: source来configurationwheezy backports,因为haproxy在标准wheezy仓库中不可用。 所以我想指出我的haproxy类依赖于我的apt :: […]

如何计算木偶erb文件中的值

我有我的应用程序my_app.pp值下面的值: akka_application_cluster_seed_nodes => '"akka.tcp://ActorSystem@host1:2551","akka.tcp://ActorSystem@host2:2551","akka.tcp://ActorSystem@host3:2551"' 现在在我的erb文件min-nr-of-members值应该通过计算akka_application_cluster_seed_nodes数组的大小除以2加1 $min-nr-of-members = $akka_application_cluster_seed_nodes.size/2 +1 例如: auto-down-unreachable-after = <%= get_param('akka_cluster_auto_down_unreachable_after')%> and something like this: <% $cluster= get_param('akka_cluster_auto_down_unreachable_after') %> <% $minNumOfNodes = ($cluster.size / 2)+1 %> min-nr-of-members = <% $minNumOfNodes %>

runinterval不适用于Puppet Agents

我在窗户上运行木偶代理。 我试图改变与服务器的木偶代理签入的时间间隔。 在puppet master上,我修改了puppet.conf文件,在代理部分添加了runinterval = 5m 。 然后我重新开始了pe-puppet服务。 然后,我去了代理,并重新启动Puppet Agent服务。 这不起作用,我的代理仍然没有运行在5分钟的时间间隔。 我检查了Agent上的puppet.conf文件,我没有看到runinterval被填充在那里。 我错过了什么吗?

木偶EXEC:只有在执行另一部分代码后才执行部分代码

我有以下的傀儡代码: exec { 'set mysql root password': user => root, path => "/usr/bin:/usr/sbin:/bin", command => "/usr/bin/mysqladmin -u root password \'${root_pwd}\'", onlyif => 'grep /etc/mysql_root_password_setup.cf -nrw -e \'0\'', } exec { 'set mysql hostname password': user => root, path => "/usr/bin:/usr/sbin:/bin", command => "/usr/bin/mysqladmin -u root -h ${::fqdn} password \'${root_pwd}\'", onlyif => 'grep /etc/mysql_root_password_setup.cf -nrw -e […]

木偶无法评估:无法从环境中获取信息

木偶可以在节点上执行exec,但不能从模块中传输文件。 Ubuntu 14.04服务器Puppet 3.8.4 已经尝试: 使文件世界可读 禁用FW 在模块目录中创buildfacter.d 主人: /etc/puppet/puppet.conf [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet modulepath = /etc/puppet/modules factpath=$vardir/lib/facter /etc/puppet/manifests/site.pp node 'gitlab.domain' { include ssh } /etc/puppet/modules/ssh/manifests/init.pp class ssh { exec { 'apt-update': command => 'apt-get update', path => ['/usr/bin', '/bin', '/sbin'], logoutput => on_failure, } # ensure openssh installed package { 'openssh-server': ensure => […]

迁移木偶代码到木偶4:问题与类

我们正在将我们的木偶代码从3.5.7迁移到4.5.2 在申请清单时,我收到以下错误 Error: Failed to apply catalog: Parameter unless failed on Exec[sh /home/agile/svncheckout.sh]: 'test -f /home/agile/subversion.done' is not qualified and no path was specified. Please qualify the command or specify a path. at /apps/wps/puppetlabs/code/environments/production/manifests/classes/subversion.pp:17 主要代码如下: node 'Node-002' { include user_default include standard include subversion # include java include sybase # include eclipse # include oxygen […]

如何为File {}提供一个名称,以便在Puppet上执行“require”的后续步骤?

给一个文件的别名似乎工作。 例如,名称为“tomcat_dir”的文件可用于“require => File [”tomcat_dir“]”的下一步: file {"tomcat_dir": ensure => directory, path => "/usr/local/tomcat", mode => "755", owner => "tomcat", group => "65534", recurse => true, require => [ Exec["tomcat_unzip"] ], } 但是,如果我这样做: file { [ "/usr/local/tomcat", "/usr/local/tomcat/dir1", "/usr/local/tomcat/dir2", "/usr/local/tomcat/dir3", "/usr/local/tomcat/dir4"]: ensure => directory, mode => "755", owner => "tomcat", group => "65534", require => [ […]