我试图从操作码配方安装postgresql 9.3与厨师独奏,但我收到以下错误:
Chef::Exceptions::Package: No version specified, and no candidate version available for postgresql93-devel
这是我在attributes/default.rb中的代码,但它只是安装9.1并且无法找到9.3-devel的包.
default['postgresql']['version'] = '9.3' 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']}"
如果我用这个代码,而不是安装9.2它是成功的,但MINITEST抱怨说,9.3版未安装.
default['postgresql']['version'] = '9.2' default['postgresql']['enable_pgdg_apt'] = true default['postgresql']['dir'] = "/etc/postgresql/9.2/main" default['postgresql']['config']['data_directory'] = "/var/lib/postgresql/9.2/main" default['postgresql']['config']['hba_file'] = "/etc/postgresql/9.2/main/pg_hba.conf" default['postgresql']['config']['ident_file'] = "/etc/postgresql/9.2/main/pg_ident.conf" default['postgresql']['config']['external_pid_file'] = "/var/run/postgresql/9.2-main.pid" default['postgresql']['config']['ssl_key_file'] = "/etc/ssl/private/ssl-cert-snakeoil.key" default['postgresql']['config']['ssl_cert_file'] = "/etc/ssl/certs/ssl-cert-snakeoil.pem" default['postgresql']['client']['packages'] = ["postgresql-client-9.2"] default['postgresql']['server']['packages'] = ["postgresql-9.2"] default['postgresql']['contrib']['packages'] = ["postgresql-contrib-9.2"]
我现在在属性中使用本/ default.rb
default['postgresql']['password']['postgres'] = 'xxx' default['sportdata-server']['database']['dbname'] = 'myapp_production' default['postgresql']['pgdg']['release_apt_codename'] = 'precise' default['postgresql']['version'] = '9.3' default['postgresql']['config']['ssl'] = false default['postgresql']['config']['listen_addresses'] = '*'
James Mason.. 6
我刚刚用CentOS完成了这个,但我从未尝试过Ubuntu.我注意到一些事情:
您没有为9.3启用pgdg repo
您正在指定一些无效的包名称.我认为食谱中的默认值应该足够了.
试试这个
default['postgresql']['version'] = '9.3' default['postgresql']['enable_pgdg_apt'] = true
您可能还需要确保您的VM没有安装已安装的默认postgresql版本.我在CentOS遇到了这个问题.
我刚刚用CentOS完成了这个,但我从未尝试过Ubuntu.我注意到一些事情:
您没有为9.3启用pgdg repo
您正在指定一些无效的包名称.我认为食谱中的默认值应该足够了.
试试这个
default['postgresql']['version'] = '9.3' default['postgresql']['enable_pgdg_apt'] = true
您可能还需要确保您的VM没有安装已安装的默认postgresql版本.我在CentOS遇到了这个问题.