Resource is marked as updated, although it should not be


#1

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.


#2

I don’t really understand – the Chef run output states that 'mysql’
wasn’t installed and that it went and installed it. Showing ‘zypper
search’ output after the run doesn’t tell you anything useful; what
about before?

  • Julian

On Fri, Jun 27, 2014 at 4:26 AM, iceweasel.iceweasel@web.de wrote:

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.


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]