我应该如何使用Puppet处理Mint实例?

前端之家收集整理的这篇文章主要介绍了我应该如何使用Puppet处理Mint实例?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用Puppet不时设置VM.有时我在这些VM上运行 Linux Mint.我有很多我喜欢使用的Puppet模块,但是当他们检查LSB事实时,他们会从奇怪的Linux Mint版本中退缩.

例如,我正在使用官方的Puppet Labs Java模块来安装JDK等. params.pp文件看起来像这样(我已经删除了很多):

class java::params {

  case $::osfamily {
    'RedHat': {...}
    'Debian': {
      case $::lsbdistcodename {
        default: { fail("unsupported release ${::lsbdistcodename}") }
        'lenny','squeeze','lucid','natty': {
          $java  = {
            'jdk' => {
              'package'          => 'openjdk-6-jdk'...
            },'jre' => {
              'package'          => 'openjdk-6-jre-headless...
            },}
        }
        'wheezy','jessie','precise','quantal','raring','saucy','trusty','utopic': {
             ...I could add 'rebecca' to the above list,and that would probably do it
          $java =  {
            'jdk' => {
              'package'          => 'openjdk-7-jdk'...
            },'jre' => {
              'package'          => 'openjdk-7-jre-headless'
            },'oracle-jre' => {...},'oracle-jdk' => {...},}
        }
      }
    }
...
    default: { fail("unsupported platform ${::osfamily}") }
  }

当我在Mint实例上运行代理时,我最终得到:

Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: unsupported release rebecca at
/etc/puppet/modules/java/manifests/params.pp:50 on node
some.host.com

rebecca是我正在处理的Linux Mint的版本,它对应于Ubuntu Trusty.

但每个Mint版本都基于Ubuntu版本,应该可以正常工作. (至少可以尝试使用.)我真的想告诉facter返回等效的Ubuntu lsb信息,而不是修改模块,以及所有其他模块.虽然这可能是对社区的服务……

有人试图解决这个问题吗?想法?

解决方法

This page似乎暗示您可以通过设置环境变量来覆盖Facter事实:
# show the operating system we are running (retrieved from facter)
$puppet -e 'notify { "We are running on $operatingsystem": }'
notice: We are running on Fedora

# override $operatingsystem for testing purposes
$FACTER_operatingsystem=Debian puppet -e 'notify { "We are running on $operatingsystem": }'
notice: We are running on Debian

在这种情况下,您是否能够使用变量FACTER_lsbdistcodename = trusty构建每个rebecca主机?

我没有对此进行过测试,但事实只是节点报告的事情,因此应该可以轻松覆盖/编辑……

原文链接:https://www.f2er.com/linux/396322.html

猜你在找的Linux相关文章