dqenv99518 2016-09-14 18:05
浏览 82

我可以使用puppet在aws ec2上将php升级到php56而不登录并使用yum吗?

Apparently if you use puppet to require "php" and you have version 5.3 installed, then even if your yum repos have 5.6 php packages, requiring "php56" will not perform an upgrade. All the docs I read say to log into the node and use sudo and yum to remove the existing php packages and replace them with 5.6. These nodes are in production and I would like to use puppet to upgrade my php. Anyone have experience in this?

  • 写回答

1条回答 默认 最新

  • dqwh1119 2016-09-25 23:33
    关注

    Generally speaking, Puppet will only upgrade packages if you use a resource such as the following:

    # always update to the latest version
    package { 'php':
      ensure => 'latest',
    }
    
    # update (or revert) to a specific version
    package { 'php':
      ensure => '5.6',
    }
    

    Note that in the latter case, the given version must exactly match the label on the package, e.g. 5.6.24+dfsg-0+deb8u1 on Debian 8.

    Since you're probably using a Forge module to manage PHP (you should), you need to check that module's capabilities to override the appropriate ensure value(s).

    If none, you can resort to a minor hack using a resource collector:

    Package<| title == "php" |> { ensure => 'latest' }
    

    This has same caveats, but might just suffice for your use case.

    Whatever you do, test the code carefully before throwing it at your entire production environment.

    评论

报告相同问题?

悬赏问题

  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题
  • ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档
  • ¥50 C++五子棋AI程序编写
  • ¥30 求安卓设备利用一个typeC接口,同时实现向pc一边投屏一边上传数据的解决方案。