【发布时间】:2020-08-21 15:18:12
【问题描述】:
我正在使用来自https://supermarket.chef.io/cookbooks/tomcat 的食谱
instance_name = node['tomcat']['name']
# Install the Tomcat Service
tomcat_install instance_name do
version node['tomcat']['version']
dir_mode '0755'
install_path node['tomcat']['install_dir']
tarball_uri node['tomcat']['install_tar']
tomcat_user node['tomcat']['user']
tomcat_group node['tomcat']['group']
end
tomcat_service instance_name do
action [:start, :enable]
env_vars [{ 'CATALINA_PID' => '/opt/tomcat_helloworld/bin/non_standard_location.pid' }, { 'SOMETHING' => 'some_value' }]
sensitive true
end
我应该找到一个名为 SOMETHING 的环境变量,但是当我找到时
echo $SOMETHING
我没有找到,我也没有在 #{derived_install_path}/bin/setenv.sh 中找到 setenv.sh 也有这个变量,但是这个文件不存在。
【问题讨论】:
-
tomcat_service的行为可能因 Linux 发行版而异。您使用的是哪个发行版? -
我使用的是 Centos 7
标签: chef-infra tomcat8 cookbook