[chef] Resource is marked as updated, although it should not be


Chronological Thread 
  • From: < >
  • To:
  • Subject: [chef] Resource is marked as updated, although it should not be
  • Date: Fri, 27 Jun 2014 01:26:45 -0700 (PDT)

Hello,

we define in the recipe:
package "mysql" do
  action :install
end

Chef log for the suse 11 machine says:
[2014-06-26T11:32:41+00:00] INFO: Processing package[mysql] action install
(cbook::appl line 17)
[2014-06-26T11:32:41+00:00] DEBUG: package[mysql] checking zypper
[2014-06-26T11:32:42+00:00] DEBUG: package[mysql] version 5.0.96-0.4.1
[2014-06-26T11:32:42+00:00] DEBUG: package[mysql] is not installed
[2014-06-26T11:32:42+00:00] WARN: Chef::Config[:zypper_check_gpg] was not set.
All packages will be installed without gpg signature checks. This is a 
security
hazard.
..
Running SimpleReport Handler
[2014-06-26T11:32:54+00:00] INFO: Resources updated this run:
[2014-06-26T11:32:54+00:00] INFO: 1.) - package[mysql] from 
recipe[cbook::appl]
action '[:install]'

A look on the machine after the run:
# zypper search -i mysql
Loading repository data...
Reading installed packages...

S | Name                         | Summary                                    
 
       | Type
--+------------------------------+-----------------------------------------------------+--------
i | MySQL-client                 | MySQL - Client                             
 
       | package
i | MySQL-server                 | MySQL: a very fast and reliable SQL 
database
server | package
i | libmysqlclient15             | MySQL Shared Libraries                     
 
       | package
i | libmysqlclient_r15           | A True Multiuser, Multithreaded SQL 
Database
Server | package
i | libqt4-sql-mysql             | Qt 4 MySQL support                         
 
       | package
i | slessp1-bytefx-data-mysql    | Security update for Mono                   
 
       | patch
i | slessp1-libmysqlclient-devel | Security update for MySQL

I guess these packages were installed before chef, and chef does not install
the mysql package.
How can I avoid, that the ressource is marked as updated, although it does not
install the package?
I already tried:
package "mysql" do
  action :install
  not_if "mysql -u#{mysql_root_user} -e'show databases;'" 
end
but that changed nothing.

Regards.



Archive powered by MHonArc 2.6.16.

§