我正在尝试使用操作码食谱中的厨师独奏安装 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"]
我现在在 attributes/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'] = '*'