Chef infra 如何启用软件集合软件
我是Chef的新手,我正在尝试编写一个Chef菜谱,该菜谱将从软件集合中安装PHP5.6 安装步骤如下所示:Chef infra 如何启用软件集合软件,chef-infra,chef-recipe,Chef Infra,Chef Recipe,我是Chef的新手,我正在尝试编写一个Chef菜谱,该菜谱将从软件集合中安装PHP5.6 安装步骤如下所示: // Step:1 sudo yum install centos-release-scl //id Centos sudo yum-config-manager --enable rhel-server-rhscl-7-rpms //if RHEL // Step:2 sudo yum install rh-php56 // Step: 3 scl enable rh-php56 ba
// Step:1
sudo yum install centos-release-scl //id Centos
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms //if RHEL
// Step:2
sudo yum install rh-php56
// Step: 3
scl enable rh-php56 bash
到目前为止我所做的:
case node['platform']
when 'centos'
yum_package 'centos-release-scl'
when 'rhel'
bash 'enable RHSCL' do
code 'sudo yum-config-manager --enable rhel-server-rhscl-7-rpms'
end
end
package 'rh-php56'
execute 'software-collection' do
command 'scl enable rh-php56 bash'
end
我不知道为什么启用rh-php56
的最后一部分不起作用。
我尝试了bash资源,但仍然没有结果
干杯。问题是,
scl enable
只启用您在那里发出的特定命令的集合(bash
)。这不是一个全球性的设置。您必须在每个PHP命令前面加上scl enable
。我没有PHP的烹饪书,但请查看poise ruby和poise python如何处理SCL,以获得在Chef中更全局地处理SCL的示例