thekad / puppet-module-mysql

Puppet module for mysql-related resources
MIT License
4 stars 0 forks source link

mysql/mysqladmin paths #1

Closed wgregorian closed 5 years ago

wgregorian commented 12 years ago

Please make sure that you specify the fully qualified paths for mysql and mysqladmin. For example: database.pp line 11: $mysql_cmd = 'mysql -A -uroot -hlocalhost' - it would probably make sense to do $mysql_cmd = '/usr/bin/mysql -A -uroot -hlocalhost' instead.

thekad commented 12 years ago

I actually thought about it but then, how can you ensure mysql is always gonna be in the same path in all platforms supported by puppet? or, how can you ensure you want to use a different mysql/mysqladmin version from 2 installed versions? I somehow rely on the path set prior to executing mysql. If I just hardcode the path in the call or munge it before (like Exec[ path=> [blah]] inside mysql.pp) then I am basically preventing you from using the binaries you want... Just to give you an example, I have:

$ which mysql /usr/local/bin/mysql

Thoughts?

wgregorian commented 12 years ago

Good point! I suppose if the module is going to cater to multiple platforms, then you could write something like?

$mysql_path = $operatingsystem ? {
    redhat|centos  => "/usr/bin/mysql",
    default => "/usr/local/bin/mysql",
}