Chef如何添加,启用和安装在一个代码块中

问题描述 投票:1回答:1

我在centos中安装特定版本的php时有此过程

yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --enable remi-php72
yum install php

如何将所有这些过程包含在Chef的一个代码块中?谢谢

chef chef-solo
1个回答
1
投票

这可以通过多种方式实现:

  1. 将命令存储在Shell脚本中,并使用executeexecutebash资源执行它
  2. 将命令转换为“纯”厨师资源,例如bash scriptscript资源
© www.soinside.com 2019 - 2024. All rights reserved.