Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit 9204f57

Browse files
committed
Added mysql::queryfile define
1 parent 25c32d1 commit 9204f57

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

manifests/queryfile.pp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
define mysql::queryfile (
2+
$mysql_db,
3+
$mysql_file,
4+
$mysql_user = 'root',
5+
$mysql_password = '',
6+
$mysql_host = 'localhost',
7+
$mysql_query_filepath = '/root/puppet-mysql'
8+
) {
9+
10+
exec { "mysqlqueryfile-${name}":
11+
command => "mysql ${mysql_db} < ${mysql_file} && touch ${mysql_query_filepath}/mysqlqueryfile-${name}.run",
12+
path => [ '/usr/bin' , '/usr/sbin' , '/bin' , '/sbin' ],
13+
creates => "${mysql_query_filepath}/mysqlqueryfile-${name}.run",
14+
unless => "ls ${mysql_query_filepath}/mysqlqueryfile-${name}.run",
15+
}
16+
17+
}

0 commit comments

Comments
 (0)