File tree 3 files changed +25
-4
lines changed
3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 7
7
mysql_ver . match ( %r{\d +\. \d +\. \d +} ) [ 0 ] if mysql_ver
8
8
end
9
9
end
10
+
11
+ Facter . add ( 'mysql_version' ) do
12
+ confine { Facter ::Core ::Execution . which ( 'mariadb' ) }
13
+ setcode do
14
+ mysql_ver = Facter ::Core ::Execution . execute ( 'mariadb --version' )
15
+ mysql_ver . match ( %r{\d +\. \d +\. \d +} ) [ 0 ] if mysql_ver
16
+ end
17
+ end
Original file line number Diff line number Diff line change 7
7
Facter ::Core ::Execution . execute ( 'env PATH=$PATH:/usr/libexec mysqld --no-defaults -V 2>/dev/null' )
8
8
end
9
9
end
10
+
11
+ Facter . add ( 'mysqld_version' ) do
12
+ confine { Facter ::Core ::Execution . which ( 'mariadbd' ) }
13
+ setcode do
14
+ Facter ::Core ::Execution . execute ( 'mariadbd --no-defaults -V 2>/dev/null' )
15
+ end
16
+ end
Original file line number Diff line number Diff line change @@ -47,17 +47,23 @@ class Puppet::Provider::Mysql < Puppet::Provider
47
47
# rubocop:enable Style/HashSyntax
48
48
49
49
def self . mysql_raw ( *args )
50
- mysqld_version_string . scan ( %r{mariadb}i ) { return mariadb_client ( *args ) }
50
+ if self . newer_than ( 'mariadb' => '11.0.0' ) and mysqld_version_string . scan ( %r{mariadb}i )
51
+ return mariadb_client ( *args )
52
+ end
51
53
mysql_client ( *args )
52
54
end
53
55
54
56
def self . mysqld ( *args )
55
- mysqld_version_string . scan ( %r{mariadb}i ) { return mariadbd_service ( *args ) }
57
+ if self . newer_than ( 'mariadb' => '11.0.0' ) and mysqld_version_string . scan ( %r{mariadb}i )
58
+ return mariadb_client ( *args )
59
+ end
56
60
mysqld_service ( *args )
57
61
end
58
62
59
63
def self . mysqladmin ( *args )
60
- mysqld_version_string . scan ( %r{mariadb}i ) { return mariadb_admin ( *args ) }
64
+ if self . newer_than ( 'mariadb' => '11.0.0' ) and mysqld_version_string . scan ( %r{mariadb}i )
65
+ return mariadb_client ( *args )
66
+ end
61
67
mysql_admin ( *args )
62
68
end
63
69
@@ -81,7 +87,7 @@ def self.mysqld_version_string
81
87
# As the possibility of the mysqld being remote we need to allow the version string to be overridden,
82
88
# this can be done by facter.value as seen below. In the case that it has not been set and the facter
83
89
# value is nil we use the mysql -v command to ensure we report the correct version of mysql for later use cases.
84
- @mysqld_version_string ||= Facter . value ( :mysqld_version ) || mysqld ( '-V' )
90
+ @mysqld_version_string ||= Facter . value ( :mysqld_version ) || ""
85
91
end
86
92
87
93
def mysqld_version_string
You can’t perform that action at this time.
0 commit comments