esengineer
esengineer

Reputation: 9918

How do I install a PECL package on Vagrant box with chef?

I am new to Vagrant as well as Chef. I have the following to install apache and php on Vagrant box using chef. Cookbook contains official opscode cookbooks.

config.vm.provision :chef_solo do |chef|
  chef.cookbooks_path = "cookbooks"
  chef.add_recipe "apt"
  chef.add_recipe "apache2"
  chef.add_recipe "apache2::mod_php5"
  chef.add_recipe "apache2::mod_rewrite"
  chef.add_recipe "php"
end

It correctly installs everything including PDO support. The PHP recipe provides access to PEAR/PECL repos. But I can't find a way to install a PECL package.

How do I install a PECL package using this PHP chef?

Upvotes: 2

Views: 2512

Answers (1)

Draco Ater
Draco Ater

Reputation: 21206

You have to create your own recipe (or modify php) to install PECL package.

I don't know php and what pecl is, but if you need to use pear resource in your recipe, do it like that:

php_pear *package_name* do
  action :install
  version *version*
end

And add depends 'php' into metadata.rb of your recipe. Then you can add your recipe to your vagrant VM run list.

chef.add_recipe "my_recipe"

Upvotes: 5

Related Questions