Unkown function mysql::password

45 views
Skip to first unread message

Arnau

unread,
Jun 4, 2020, 2:10:18 PM6/4/20
to puppet...@googlegroups.com
Dear all,

I recently upgraded the Mysql module from version 5 to 10 : https://forge.puppet.com/puppetlabs/mysql

I'm testing if my "old" code is still compatible with this new version but I'm facing and issue.
My code looks like:
  
  mysql_user { 'nagios@localhost':
      ensure        => 'present',
      password_hash => mysql_password($nagios_passwd),
    }

and the first ran said:

Unknown function: 'mysql_password'

Looking into the code (/opt/puppetlabs/puppet/cache/lib/puppet/functions/mysql_password.rb) it says :

"This method has been deprecated, please use the namespaced version 'mysql::password' instead."

So I update my code accordingly but now it says:

Unknown function: 'mysql::password'

I see the function in here: /opt/puppetlabs/puppet/cache/lib/puppet/functions/mysql/password.rb and also tried  mysql::mysql_password (https://github.com/puppetlabs/puppetlabs-mysql/blob/master/REFERENCE.md#mysqlmysql_password) I don't manage to make it work.

What am I not seeing?

TIA,
Arnau

Arnau

unread,
Jun 5, 2020, 7:32:26 AM6/5/20
to puppet...@googlegroups.com
HI,

I've foudn that the problem is where the functions are saved:
/opt/puppetlabs/puppet/cache/lib/puppet/parser/functions/ vs /opt/puppetlabs/puppet/cache/lib/puppet/functions/

If I put the functions in the first path , it works. Otherwise I see the error mentioned in the first post.

I see functions in both paths, so I wonder why the functions from the second are not collected.

# puppet agent --configprint libdir
/opt/puppetlabs/puppet/cache/lib
# rpm -qa|grep puppet
puppet-agent-5.5.17-1.el7.x86_64

Any idea?

TIA,
Arnau

Reply all
Reply to author
Forward
0 new messages