I'm trying to deploy postgresql 9.4 on CentOS 7
package ['postgresql94-server', 'postgresql94-contrib'] do
action :nothing
end
execute "yum check-update" do
command "yum check-update"
action :nothing
end
package 'Install Postgres Repo' do
package_name 'pgdg-redhat94'
source '/tmp/pgdg-redhat94-9.4-2.noarch.rpm'
notifies :run, 'execute[yum check-update]', :immediately
notifies :install, 'package[postgresql94-server, postgresql94-contrib]', :immediately
action :nothing
end
execute 'Download Postgres repo RPM' do
command 'curl http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-2.noarch.rpm -o /tmp/pgdg-redhat94-9.4-2.noarch.rpm'
notifies :install, 'package[Install Postgres Repo]', :immediately
end
I'm getting the following error:
[root@db01 ~]# chef-client
Starting Chef Client, version 12.6.0
resolving cookbooks for run list: ["postgres94"]
Synchronizing Cookbooks:
- postgres94 (0.1.0)
Compiling Cookbooks...
Converging 4 resources
Running handlers:
[2015-12-30T15:32:16+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-12-30T15:32:16+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2015-12-30T15:32:16+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-12-30T15:32:16+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2015-12-30T15:32:16+00:00] ERROR: resource yum_package[Install Postgres Repo] is configured to notify resource package[postgresql94-server, postgresql94-contrib] with action install, but package[postgresql94-server, postgresql94-contrib] cannot be found in the resource collection. yum_package[Install Postgres Repo] is defined in /var/chef/cache/cookbooks/postgres94/recipes/default.rb:19:in `from_file'
[2015-12-30T15:32:16+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[root@db01 ~]# chef-client
Starting Chef Client, version 12.6.0
resolving cookbooks for run list: ["postgres94"]
Synchronizing Cookbooks:
- postgres94 (0.1.0)
Compiling Cookbooks...
Converging 4 resources
Running handlers:
[2015-12-30T15:32:30+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-12-30T15:32:30+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2015-12-30T15:32:30+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-12-30T15:32:30+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2015-12-30T15:32:30+00:00] ERROR: resource yum_package[Install Postgres Repo] is configured to notify resource package[postgresql94-server, postgresql94-contrib] with action install, but package[postgresql94-server, postgresql94-contrib] cannot be found in the resource collection. yum_package[Install Postgres Repo] is defined in /var/chef/cache/cookbooks/postgres94/recipes/default.rb:19:in `from_file'
[2015-12-30T15:32:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
What am I doing wrong?
chef-shell
. When I define such resource and query the resource collection by callingresources
, I get["package[[\"postgresql94-server\", \"postgresql94-contrib\"]]"]
. I was not able to supply that or any combination of quotes and backslashes toresources()
, i.e. asresources("package[[\"postgresql94-server\", \"postgresql94-contrib\"]]")
. Think that equals your problem.