试图构造一个string。 我可以: "Blah blah ${::osfamily} blah blah" "Blah blah ${$::osfamily} blah blah" 但是什么语法调用一个variables作为参数,并有string插值的工作? 以下任何一项工作: "Blah blah ${downcase($::osfamily)} blah blah" "Blah blah ${downcase($osfamily)} blah blah" "Blah blah ${downcase(::osfamily)} blah blah" "Blah blah ${$downcase(osfamily)} blah blah" "Blah blah ${$downcase($osfamily)} blah blah" 。 我得到的是: Error 400 on SERVER: Syntax error at '('; expected ')' 这是甚至可能在木偶语言?
我目前正试图移动我们的木偶设置,以进一步使用Hiera。 关于这一点,我想用Hiera创build用户,但是在层次结构中移动时如何做到这一点,存在一些问题。 这个场景是我想要一个包含在每个安装中的基本用户。 另外,我有时需要为一些不同的节点子集添加一些特定的用户,可能是某些数据中心或某些节点特有的。 所以我想了下面的设置: hiera.yaml: :hierarchy: – "nodes/%{::trusted.certname}" – "datacenter/${::datacenter}" – "common" users.pp: class profile::users { $user_accounts = hiera('user_accounts') create_resources(user, $user_accounts) } 和common.yaml: user_accounts: bob: comment: "Bob" managehome: true 然后上升到层次结构。 我看到的主要问题是: 我如何为每个用户实现默认属性? 例如,在这个例子中,我想为所有用户设置managehome: true ,而不是每次都明确地写入。 不过,我可能想要禁用它。 如果在层次结构中有更多的user_accounts ,它会覆盖来自common.yaml的user_accounts散列,所以我需要复制条目。 我偶然发现了Hiera的深度合并 ,但不知道这是实际使用还是最佳实践。 此外,它不会解决第一个问题,我需要在merge_behavior中设置merge_behavior,我想避免。 我怎么能在这里为每个用户插入ssh密钥? 最好的解决scheme是将ssh密钥作为属性添加到用户帐户。 那么,有没有人有一个洞察用户pipe理是如何很好地完成与木偶? 谢谢 :)
我试图根据“学习木偶4”的手册使用jorhett / puppet-mcollective模块设置MCollective。 运行“mco ping”,“mco inventory node_name”等后出现以下错误 警告2016/08/11 07:21:19:activemq.rb:346:在`救援ssl_parameters'无法设置完整的SSLvalidation模式,回落到未validation:RuntimeError:证书,密钥和CA必须提供validationSSL模式 这里是我的configuration: Hiera hostname / puppetserver.yaml # hostname/puppetserver.yaml classes: – mcollective::middleware – mcollective::client # Middleware configuration mcollective::client_password: 'VpOS62qqpH3NEVEtP8rQsS2tpq6xwgOJEXsABjYDvoI=' mcollective::middleware::keystore_password: 'k7Dj+On3xGmQPX7CuCxgXaOFwHZFdKICeQQFpWlzg6E=' mcollective::middleware::truststore_password: 'k7Dj+On3xGmQPX7CuCxgXaOFwHZFdKICeQQFpWlzg6E=' Hiera common.yaml — puppet::status: 'running' puppet::enabled: true # every node installs the server classes: – mcollective::server # The Puppet Server will host the middleware mcollective::hosts: […]
我试图在运行Centos 7的两台完全相同的Linux机器上安装和configurationpuppet 5.3.2(其中一台是主设备,另一台是代理)。 我已经设法从官方存储库安装木偶,并添加以下内容。 /etc/hosts主节点 127.0.0.1 <master hostname> <master node ipaddress> puppet, <master node hostname> <agent node ipaddress> <agent node hostname> /etc/hosts代理节点 127.0.0.1 <agent hostname> <master node ipaddress> puppet, <master node hostname> <agent node ipaddress> <agent node hostname> /etc/puppetlabs/puppet/puppet.conf主节点 [master] vardir = /opt/puppetlabs/server/data/puppetserver logdir = /var/log/puppetlabs/puppetserver rundir = /var/run/puppetlabs/puppetserver pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid codedir = /etc/puppetlabs/code […]
我在puppet中定义了以下的sensu检查 sensu::check { 'check_kubernetes_kubelet': interval => 60, timeout => 30, command => 'check_http -H :::name::: -p 10248 -u /healthz -e "200 OK"', subscribers => ['kubernetes_minion'], contacts => ['sensu_high'], } 我想添加命令重试到这个检查。 只有在连续N次命令执行返回错误之后,此检查才会开始向其联系人发出警报。 在这个例子中,假设N是2.假设在check_X之后发生故障。 然后60秒后check_X + 1将返回错误。 再过60秒后check_X + 2也会失败。 我希望警报在check_X + 2的错误之后启动。 我认为sensu filter可能是有用的。 看起来我需要像这样创build一个filter。 但是,我怎么把这个filter和这个检查联系起来呢? 我是否也需要定义自定义处理程序?
我们有几个服务器,我想开始与Puppetpipe理。 我们有: 我在加州办公室的Linux服务器,我通过VPN访问 我通过SSH访问俄克拉何马州数据中心的Linux服务器 亚马逊弹性计算云(北维吉尼亚州)中的Linux服务器 我看到了两个选项: 三个木偶服务器,每个环境本地 由公共DNS公开的一个木偶服务器 有没有人有这些configuration之一的经验? 你会怎么做?
我使用Puppet来pipe理我的服务器,我正在做的一件事是从Gem安装Mongrel: package { mongrel: provider => gem, ensure => latest, require => Package[rubygems], } 但似乎有一些问题,因为木偶不断试图在每次运行安装Mongrel。 我从木偶中得到了很多这样的东西: notice: /Stage[main]/Passenger/Package[mongrel]/ensure: ensure changed '1.1.5' to '1.1.5 ruby java x86-mingw32 x86-mswin32-60' 难道我做错了什么? 这是一个错误? 任何解决方法?
我试图创build一个基于模板的文件,但我得到一个错误,无法find模板。 我的目录设置是/ etc / puppet / modules // templates / 在模板下,如果每个主机都有一个目录,再加上一个通用模板。 在主机目录下,我有一个特定于该主机的模板。 /server/puppet/modules//manifests/init.pp class { file { "/tmp/<file>": ensure => present, content => template('<module>/${hostname}/default.erb', '<module>/common.erb'), audit => content, notify => File["/tmp/<file2>"], } file { "/tmp/<file2>": ensure => present, source => "/tmp/file", audit => content, } } 当我运行木偶代理时,出现第一个文件语句的内容选项的错误。 我不知道模板函数是否需要直接在模板目录下的模板,或者是否不正确地解释主机名variables。
我试图从modules/apt_config/files使用一个已定义的资源和要安装的一组文件来填充一些configuration文件。 define aptfile($file) { file { $file: source => "puppet:///modules/${module_name}/etc/apt/${file}", } } aptfile{ [ 'apt.conf', 'sources.list', ]: } 根据这个错误报告 , $ module_name应该是可用的。 那部分不是让我悲伤。 什么似乎被打破是这样的, $文件没有被填充时,我打电话给资源; 相反,我得到以下错误: 必须将文件传递给节点vagrant.home上的/tmp/vagrant-puppet/modules-0/apt_config/manifests/init.pp:10上的Apt_config :: Aptfile [apt.conf] 请注意,第10行是包含define aptfile定义的行。 语法有点神秘。 所以,以防万一我反向指定文件path,我也试过这个: define aptfile($file) { file { "/etc/apt/${file}": source => "puppet:///modules/${module_name}/${file}", } } aptfile{ [ 'apt.conf', 'sources.list', ]: } 具有相同的结果。 我知道我可以单独指定每个文件,但是我需要做些什么来使这个循环正常工作?
我正在使用Vagrant的Puppet(版本2.7.19)为项目设置开发框。 我有我需要的所有依赖关系的Puppet类,但是对于我的Vagrant框,我需要首先运行apt-get更新。 我把这个逻辑包装在一个名为“vagrant :: bootstrap”的类中。 因为我想让我的其他类尽可能地保持“中性”,所以我在site.pp中写了下面的节点定义,这样我的Vagrant特定的需求就不会污染其他机器的configuration。 node default { require vagrant::bootstrap include base, puppet::agent, php::php54, apache2 } class apache2 { include apache2::install, apache2::service } class apache2::install { package { [ "apache2", "apache2-doc", "apache2-mpm-worker", "apache2-utils", "libapache2-mod-fcgid" ]: ensure => present } } 所有的模块被正确加载据我可以告诉,但是我看到木偶试图apt-get更新运行完成之前安装apache2 err: /Stage[main]/Apache2::Install/Package[apache2-utils]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y […]