Skip to content

Commit 232ef18

Browse files
committed
(FM-5050) Configure the base of includedir
Without this change installing mysql fails with the following errors on Debian and Ubuntu: Error: Cannot create /etc/mysql/conf.d; parent directory /etc/mysql does not exist Error: /Stage[main]/Mysql::Server::Config/File[/etc/mysql/conf.d]/ensure: change from absent to directory failed: Cannot create /etc/mysql/conf.d; parent directory /etc/mysql does not exist Error: Could not set 'file' on ensure: No such file or directory @ dir_s_rmdir - /etc/mysql/my.cnf20160413-2395-1uo3ffj.lock at 39:/etc/puppetlabs/code/modules/mysql/manifests/server/config.pp Error: Could not set 'file' on ensure: No such file or directory @ dir_s_rmdir - /etc/mysql/my.cnf20160413-2395-1uo3ffj.lock at 39:/etc/puppetlabs/code/modules/mysql/manifests/server/config.pp Wrapped exception: No such file or directory @ dir_s_rmdir - /etc/mysql/my.cnf20160413-2395-1uo3ffj.lock Error: /Stage[main]/Mysql::Server::Config/File[mysql-config-file]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory @ dir_s_rmdir - /etc/mysql/my.cnf20160413-2395-1uo3ffj.lock at 39:/etc/puppetlabs/code/modules/mysql/manifests/server/config.pp
1 parent 696aff6 commit 232ef18

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

manifests/server/config.pp

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
recurse => $mysql::server::purge_conf_dir,
1818
purge => $mysql::server::purge_conf_dir,
1919
}
20+
21+
# on some systems this is /etc/my.cnf.d, while Debian has /etc/mysql/conf.d and FreeBSD something in /usr/local. For the latter systems,
22+
# managing this basedir is also required, to have it available before the package is installed.
23+
$includeparentdir = mysql_dirname($includedir)
24+
if $includeparentdir != '/' and $includeparentdir != '/etc' {
25+
file { $includeparentdir:
26+
ensure => directory,
27+
mode => '0755',
28+
}
29+
}
2030
}
2131

2232
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)

0 commit comments

Comments
 (0)