I am learning chef at the moment using OpsWorks , currently I am trying to create a recipe that will install 2 package in one instance. I stored my cookbook on github.. there I have a recipe that is like this - webserver.rb
# Install apache and start the service
httpd_service 'site' do
mpm 'prefork'
action [:create, :start]
end
# Add the site configuration
httpd_config 'site' do
instance 'site'
source 'site.conf.erb'
notifies :restart, 'httpd_service[site]'
end
#create the document root directory
#directory '/var/www/public_html' do
# recursive true
#end
#write the homepage
file '/var/www/index.html' do
content '<html>This is a web</html>'
mode '0644'
owner 'web_admin'
group 'web_admin'
end
# Install apache , config and etc END
# Install the mod_php5 apache module
httpd_module 'php' do
instance 'site'
end
#install php5-mysql
package 'php-mysql' do
action :install
notifies :restart, 'httpd_service[site]'
end
#write the homepage
file '/var/www/index2.php' do
content '<html><?php echo phpinfo(); ?></html>'
mode '0644'
owner 'web_admin'
group 'web_admin'
end
I am following the tutorial in AWS creating a LAMP environment. Unfortunately when I run this to my Instance , opsworks_cookbook_demo::default (it will run some include , including webserver.) am getting error that precondition httpd cookbook not found
, I already added on my metadaba.rb depends 'httpd' '~> ..' ,Can someone guide me what the wrong doing here. Coz I assume whenever you put depends 'httpd' it will extend my cookbook to use that cookbook.
Do I need berkshelf for this case? (Currently I am using AWS OpsWorks and have my recipe in github)