【问题标题】:Installing pear package using puppet使用 puppet 安装 pear 包
【发布时间】:2016-03-18 22:05:21
【问题描述】:

我正在尝试使用 puppet 安装 pear 包“HTTP_Request2”。目标操作系统是 RHEL 7。

我遇到了 2 个我认为应该能够做到这一点的 puppet 模块

  1. https://forge.puppetlabs.com/rafaelfc/pear
  2. https://forge.puppetlabs.com/example42/php

理想情况下,我想使用 refaelfc 模块,因为它似乎更适合此任务。我遇到的问题是,要在目标服务器上获得 Internet 访问权限,您需要通过代理,我似乎在此模块中找不到任何东西来设置它。如果没有这个设置 puppet 在尝试安装模块时会超时。

使用选项 2,我将以下内容添加到我的清单中:

    include php
    php::pear::config { http_proxy: value => "http://xx.xx.xx.xx:xxxx" }
    php::pear::module { 'HTTP_Request2':
            repository  => 'pear.phpunit.de',
            alldeps => 'true',
            require => Php::Pear::Config['http_proxy'],
    }

执行此操作时出现错误:

Error: Execution of '/bin/yum -d 0 -e 0 -y list php-pear-HTTP_Request2' returned 1: Error: No matching Packages to list

它应该调用 yum 似乎不正确?如何让 puppet 安装这个 pear 包?

【问题讨论】:

    标签: puppet pear


    【解决方案1】:

    使用 example42/php 模块和自定义脚本的组合来管理它:

        include php
        php::pear::config { http_proxy:
                 value => "http://xx.xx.xx.xx:xxxx",
        }
        exec { 'HTTP_Request2':
                command => '/usr/bin/pear install HTTP_Request2',
                unless  => '/usr/bin/pear info HTTP_Request2',
                require => Php::Pear::Config['http_proxy'],
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-09
      • 1970-01-01
      • 2012-09-01
      • 2019-07-03
      • 1970-01-01
      • 2013-12-29
      • 2013-11-03
      相关资源
      最近更新 更多