Я написал рецепт шеф-повара, чтобы установить httpd, включить и запустить то же самое.но получаю ошибку ниже.
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* apt_package[httpd] action install
================================================================================
Error executing action `install` on resource 'apt_package[httpd]'
================================================================================
Chef::Exceptions::Package
-------------------------
httpd is a virtual package provided by multiple packages, you must explicitly select one
Resource Declaration:
---------------------
# In server.rb
6: package 'httpd' do
7: action :install
8: end
9:
Compiled Resource:
------------------
# Declared in server.rb:6:in `run_chef_recipe'
apt_package("httpd") do
package_name "httpd"
action [:install]
default_guard_interpreter :default
declared_type :package
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end
System Info:
------------
chef_version=14.8.12
platform=ubuntu
platform_version=18.04
ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
program_name=/usr/bin/chef-apply
executable=/opt/chefdk/bin/chef-apply
[2019-01-29T10:14:30+00:00] FATAL: Stacktrace dumped to /home/devopsdevops95/.chef/cache/chef-stacktrace.out
[2019-01-29T10:14:30+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-01-29T10:14:30+00:00] FATAL: Chef::Exceptions::Package: apt_package[httpd] ((chef-apply cookbook)::(chef-apply recipe) line 6) had an error: Chef::Exceptions::Package: httpd is a virtual package provided by multiple packages, you must explicitly select one
Я пробовал много решений, таких как apt-get update перед запуском рецепта, но безрезультатно.
chef -v
Chef Development Kit Version: 3.6.57
chef-client version: 14.8.12
delivery version: master (5fb4908da53579c9dcf4894d4acf94d2d9ee6475)
berks version: 7.0.7
kitchen version: 1.24.0
inspec version: 3.2.6
OS -
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
package 'httpd' do
action :install
end
file '/var/www/html/index.html' do
content '<h1>Hello, world!</h1>'
end
service 'httpd' do
Я ожидаю, что он установит httpd без каких-либо проблем.