我尝试通过Chef-solo无法成功安装apache2。当我在本地模式下运行Chef-client时,相同的配方有效。
package 'apache2' do
action [:$pstall]
end
and
package 'apache2'
两者均失败,但以下情况除外:
* apt_update[Update the apt cache daily] action periodic (up to date)
* apt_package[apache2] action install
================================================================================
Error executing action `install` on resource 'apt_package[apache2]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of ["apt-get", "-q", "-y", "install", "apache2=2.4.29-1ubuntu4.4"] ----
STDOUT:
STDERR: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
---- End output of ["apt-get", "-q", "-y", "install", "apache2=2.4.29-1ubuntu4.4"] ----
Ran ["apt-get", "-q", "-y", "install", "apache2=2.4.29-1ubuntu4.4"] returned 100
chef-solo能够执行配方中的第一行,这意味着配置应该很好。我不确定我缺少什么。请,任何指针都表示赞赏。
最好
爱丽丝