Код я написав
[root@ns1 sysadmin]# cat installstarthttpd.rb
package' httpd'
service 'httpd' do
action [:start, :enable]
end
file '/var/www/html/index.html' do
content ' <html>
<title>
Page from Chef
</title>
<body>
<h1> Welcome Raja</h1>
</body>
</html>
'
end
[root@ns1 sysadmin]#
І я виконав команду нижче і отримав помилку
[root@ns1 sysadmin]# chef-apply installstarthttpd.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* package[ httpd] action install
* No version specified, and no candidate version available for httpd
================================================================================
Error executing action `install` on resource 'package[ httpd]'
================================================================================
Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for httpd
Resource Declaration:
---------------------
# In installstarthttpd.rb
1: package' httpd'
2:
Compiled Resource:
------------------
# Declared in installstarthttpd.rb:1:in `run_chef_recipe'
package(" httpd") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
package_name " httpd"
timeout 900
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end
[2014-10-14T01:10:18-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-10-14T01:10:18-04:00] FATAL: Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
Я теж бачив журнал
[root@ns1 sysadmin]# cat /var/chef/cache/chef-stacktrace.out
Generated at 2014-10-14 01:10:18 -0400
Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:241:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:322:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:135:in `process_resource_requirements'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:111:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:144:in `run_chef_recipe'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:153:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:166:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-apply:25:in `<top (required)>'
/usr/bin/chef-apply:34:in `load'
Допоможіть, будь-ласка, я щось пропускаю?
Дякую.