[chef] Re: "Cannot find a provider for script[wait for pgsql startup] on centos version 5.5 (ArgumentError)"


Chronological Thread 
  • From: Charles Duffy < >
  • To: chef-users < >
  • Subject: [chef] Re: "Cannot find a provider for script[wait for pgsql startup] on centos version 5.5 (ArgumentError)"
  • Date: Sun, 6 Feb 2011 02:40:05 -0600

...to follow up a bit, explicitly specifying "provider Chef::Resource::Script::Bash" results in the following:

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource.rb:84:in `method_missing': undefined method `load_current_resource' for Chef::Resource::Bash (NoMethodError)

On Sun, Feb 6, 2011 at 2:27 AM, Charles Duffy < "> > wrote:
Per subject, using Chef 0.9.8. I'm a bit miffed.

script "wait for pgsql startup" do
  interpreter "bash"
  user "postgres"
  group "postgres"
  path ["#{node[:postgresql90][:pgbin]}", "/bin", "/usr/bin"]
  code <<-EOH
  retries=0
  while (( $retries < 10 )); do
    if psql -U postgres template1 </dev/null ; then
      exit 0
    fi
    retries=$(( retries + 1 ))
    sleep 1
  done
  exit 1
  EOH
  action :nothing
end

service "postgresql-9.0" do
  action [ :enable, :start ]
  notifies :run, "script[wait for pgsql startup]", :immediate
end

# ... other things happening below here need the database to be actually available




Archive powered by MHonArc 2.6.16.

§