mysql puppetlabs not use correct datadir

asked 2018-07-24 09:27:51 -0500

yotles gravatar image

Hello. I have use module mysql from puppetlabs and ot can't in correct way override parameter datadir.

    'bind-address': ''
    'datadir': '/opt/database'

And at first run I see that it use overrides variable:

Notice: /Stage[main]/Mysql::Server::Installdb/Notify[The value is: /opt/database]/message: defined 'message' as 'The value is: /opt/database'                                
Debug: /Stage[main]/Mysql::Server::Installdb/Notify[The value is: /opt/database]: The container Class[Mysql::Server::Installdb] will propagate my refresh event              
Debug: Executing: '/usr/sbin/mysqld -V'                                                                                                                                      
Debug: Mysql_datadir[/opt/database](provider=mysql): Initializing MySQL data directory >= 5.7.6 with mysqld: --defaults-extra-file=/etc/my.cnf --basedir=/usr --datadir=/opt/
database --user=mysql --log-error=/var/log/mysql/error.log --initialize-insecure                                                                                             
Debug: Executing: '/usr/sbin/mysqld --defaults-extra-file=/etc/my.cnf --basedir=/usr --datadir=/opt/database --user=mysql --log-error=/var/log/mysql/error.log --initialize-i

And get such result at the end:

 mysql -e "select @@datadir;"
| @@datadir       |
| /var/lib/mysql/ |
cat /etc/my.cnf| grep datadir
datadir = /opt/database

As result it still use default " /var/lib/mysql/" during initialization.

edit retag flag offensive close merge delete