|
39 | 39 |
|
40 | 40 | case $facts['os']['family'] {
|
41 | 41 | 'RedHat': {
|
42 |
| - case $::operatingsystem { |
| 42 | + case $facts['os']['name'] { |
43 | 43 | 'Fedora': {
|
44 | 44 | if versioncmp($::operatingsystemrelease, '19') >= 0 or $::operatingsystemrelease == 'Rawhide' {
|
45 | 45 | $provider = 'mariadb'
|
|
119 | 119 | }
|
120 | 120 |
|
121 | 121 | 'Suse': {
|
122 |
| - case $::operatingsystem { |
| 122 | + case $facts['os']['name'] { |
123 | 123 | 'OpenSuSE': {
|
124 | 124 | $socket = '/var/run/mysql/mysql.sock'
|
125 | 125 | $log_error = '/var/log/mysql/mysqld.log'
|
|
141 | 141 | $basedir = undef
|
142 | 142 | }
|
143 | 143 | default: {
|
144 |
| - fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${::operatingsystem}.") |
| 144 | + fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${facts['os']['name']}.") |
145 | 145 | }
|
146 | 146 | }
|
147 | 147 | $config_file = '/etc/my.cnf'
|
|
207 | 207 | $managed_dirs = ['tmpdir','basedir','datadir','innodb_data_home_dir','innodb_log_group_home_dir','innodb_undo_directory','innodb_tmpdir']
|
208 | 208 |
|
209 | 209 | # mysql::bindings
|
210 |
| - if ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '10') >= 0) or |
211 |
| - ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) { |
| 210 | + if ($facts['os']['name'] == 'Debian' and versioncmp($::operatingsystemrelease, '10') >= 0) or |
| 211 | + ($facts['os']['name'] == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) { |
212 | 212 | $java_package_name = 'libmariadb-java'
|
213 | 213 | } else {
|
214 | 214 | $java_package_name = 'libmysql-java'
|
215 | 215 | }
|
216 | 216 | $perl_package_name = 'libdbd-mysql-perl'
|
217 |
| - if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') >= 0) or |
218 |
| - ($::operatingsystem == 'Debian') { |
| 217 | + if ($facts['os']['name'] == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') >= 0) or |
| 218 | + ($facts['os']['name'] == 'Debian') { |
219 | 219 | $php_package_name = 'php-mysql'
|
220 | 220 | } else {
|
221 | 221 | $php_package_name = 'php5-mysql'
|
222 | 222 | }
|
223 |
| - if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') < 0) or |
224 |
| - ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) or |
225 |
| - ($::operatingsystem == 'Debian') { |
| 223 | + if ($facts['os']['name'] == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') < 0) or |
| 224 | + ($facts['os']['name'] == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) or |
| 225 | + ($facts['os']['name'] == 'Debian') { |
226 | 226 | $xtrabackup_package_name = 'percona-xtrabackup-24'
|
227 | 227 | }
|
228 |
| - if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) or |
229 |
| - ($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '11') >= 0) { |
| 228 | + if ($facts['os']['name'] == 'Ubuntu' and versioncmp($::operatingsystemrelease, '20.04') >= 0) or |
| 229 | + ($facts['os']['name'] == 'Debian' and versioncmp($::operatingsystemrelease, '11') >= 0) { |
230 | 230 | $python_package_name = 'python3-mysqldb'
|
231 | 231 | } else {
|
232 | 232 | $python_package_name = 'python-mysqldb'
|
|
365 | 365 | }
|
366 | 366 |
|
367 | 367 | default: {
|
368 |
| - case $::operatingsystem { |
| 368 | + case $facts['os']['name'] { |
369 | 369 | 'Alpine': {
|
370 | 370 | $client_package_name = 'mariadb-client'
|
371 | 371 | $server_package_name = 'mariadb'
|
|
425 | 425 | }
|
426 | 426 |
|
427 | 427 | default: {
|
428 |
| - fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${facts['os']['family']} or ${::operatingsystem}.") |
| 428 | + fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${facts['os']['family']} or ${facts['os']['name']}.") |
429 | 429 | }
|
430 | 430 | }
|
431 | 431 | }
|
432 | 432 | }
|
433 | 433 |
|
434 |
| - case $::operatingsystem { |
| 434 | + case $facts['os']['name'] { |
435 | 435 | 'Ubuntu': {
|
436 | 436 | $server_service_provider = 'systemd'
|
437 | 437 | }
|
|
516 | 516 | }
|
517 | 517 |
|
518 | 518 | ## Additional graceful failures
|
519 |
| - if $facts['os']['family'] == 'RedHat' and $::operatingsystemmajrelease == '4' and $::operatingsystem != 'Amazon' { |
| 519 | + if $facts['os']['family'] == 'RedHat' and $::operatingsystemmajrelease == '4' and $facts['os']['name'] != 'Amazon' { |
520 | 520 | fail("Unsupported platform: puppetlabs-${module_name} only supports RedHat 6.0 and beyond.")
|
521 | 521 | }
|
522 | 522 | }
|
0 commit comments