环境:CentOS 6.5,厨师,Vagrant,Berkshelf
cookbook "postgresql"
Berksfile
$ berks install
跟随berks upload
将我的食谱上传到托管的Enterprise Chef服务器。将我的postgresql属性添加到我的食谱my_cookbook/attributes/default.rb
default['postgresql']['version'] = '9.2'
default['postgresql']['client']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-devel"]
default['postgresql']['server']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-server"]
default['postgresql']['contrib']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-contrib"]
default['postgresql']['dir'] = "/var/lib/pgsql/#{node['postgresql']['version']}/data"
default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}"
在我的default.rb
食谱中:
include_recipe 'postgresql::yum_pgdg_postgresql'
include_recipe 'postgresql::server'
错误:
Recipe: postgresql::client
* package[postgresql92-devel] action install
* No version specified, and no candidate version available for postgresql92-devel
================================================================================
Error executing action `install` on resource 'package[postgresql92-devel]'
================================================================================
答案 0 :(得分:1)
我通过在attributes/default.rb
default['postgresql']['enable_pgdg_yum'] = true <==== ADDED THIS
default['postgresql']['version'] = '9.2'
default['postgresql']['client']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-devel"]
default['postgresql']['server']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-server"]
default['postgresql']['contrib']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-contrib"]
default['postgresql']['dir'] = "/var/lib/pgsql/#{node['postgresql']['version']}/data"
default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}"