1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
Description: Fix toplevel facts non-existent
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2025-05-13
Index: puppet-module-michaeltchapman-galera/manifests/init.pp
===================================================================
--- puppet-module-michaeltchapman-galera.orig/manifests/init.pp
+++ puppet-module-michaeltchapman-galera/manifests/init.pp
@@ -178,10 +178,10 @@
# Defaults to undef
#
class galera(
- $galera_servers = [$::ipaddress_eth1],
- $galera_master = $::fqdn,
- $local_ip = $::ipaddress_eth1,
- $bind_address = $::ipaddress_eth1,
+ $galera_servers = undef,
+ $galera_master = $facts['networking']['fqdn'],
+ $local_ip = undef,
+ $bind_address = undef,
$mysql_port = 3306,
$wsrep_group_comm_port = 4567,
$wsrep_state_transfer_port = 4444,
@@ -229,7 +229,7 @@ class galera(
}
# Debian machines need some help
- if ($::osfamily == 'Debian') {
+ if ($facts['os']['family'] == 'Debian') {
include galera::debian
}
@@ -246,7 +246,7 @@ class galera(
$options = deep_merge($galera::params::default_options, $override_options)
if ($create_root_user == undef) {
- if ($galera_master == $::fqdn) {
+ if ($galera_master == $facts['networking']['fqdn']) {
# manage root user on the galera master
$create_root_user_real = true
} else {
@@ -315,7 +315,7 @@ class galera(
}
- if $::fqdn == $galera_master {
+ if $facts['networking']['fqdn'] == $galera_master {
# If there are no other servers up and we are the master, the cluster
# needs to be bootstrapped. This happens before the service is managed
$server_list = join($galera_servers, ' ')
Index: puppet-module-michaeltchapman-galera/manifests/debian.pp
===================================================================
--- puppet-module-michaeltchapman-galera.orig/manifests/debian.pp
+++ puppet-module-michaeltchapman-galera/manifests/debian.pp
@@ -3,7 +3,7 @@
# Fixes Debian specific compatibility issues
#
class galera::debian {
- if ($::osfamily != 'Debian') {
+ if ($facts['os']['family'] != 'Debian') {
warn('the galera::debian class has been included on a non-debian host')
}
@@ -49,7 +49,7 @@ class galera::debian {
# Required for Puppet 4
$deb_sysmaint_password = $galera::deb_sysmaint_password
- if ($::fqdn == $galera::galera_master) {
+ if ($facts['networking']['fqdn'] == $galera::galera_master) {
# Debian sysmaint pw will be set on the master,
# and needs to be consistent across the cluster.
Index: puppet-module-michaeltchapman-galera/manifests/params.pp
===================================================================
--- puppet-module-michaeltchapman-galera.orig/manifests/params.pp
+++ puppet-module-michaeltchapman-galera/manifests/params.pp
@@ -8,12 +8,12 @@ class galera::params {
if $galera::vendor_type == 'percona' {
$bootstrap_command = '/etc/init.d/mysql bootstrap-pxc'
} elsif ($galera::vendor_type == 'mariadb' or $galera::vendor_type == 'codership') {
- if ($::osfamily == 'RedHat' and versioncmp($::operatingsystemrelease, '7') >= 0 and
+ if ($facts['os']['family'] == 'RedHat' and versioncmp($::operatingsystemrelease, '7') >= 0 and
$galera::vendor_version and versioncmp($galera::vendor_version, '10.0') == 1
) {
# We have systemd and we should use the binary
$bootstrap_command = '/usr/bin/galera_new_cluster'
- } elsif ($::osfamily == 'Debian') {
+ } elsif ($facts['os']['family'] == 'Debian') {
$bootstrap_command = '/usr/bin/galera_new_cluster'
} else {
$bootstrap_command = 'service mysql start --wsrep_cluster_address=gcomm://'
@@ -24,7 +24,7 @@ class galera::params {
$bootstrap_command = 'touch /var/log/mysqld.log ; chown mysql:mysql /var/log/mysqld.log ; systemctl start mysqld'
}
- if ($::osfamily == 'RedHat') {
+ if ($facts['os']['family'] == 'RedHat') {
if $galera::vendor_type == 'percona' {
if $galera::vendor_version == '5.6' {
$mysql_package_name_internal = 'Percona-XtraDB-Cluster-server-56'
@@ -86,7 +86,7 @@ class galera::params {
$rundir = '/var/run/mysqld'
}
- elsif ($::osfamily == 'Debian'){
+ elsif ($facts['os']['family'] == 'Debian'){
if $facts['os']['lsb'] != undef{
$mycodename = $facts['os']['lsb']['distcodename']
}else{
Index: puppet-module-michaeltchapman-galera/manifests/repo.pp
===================================================================
--- puppet-module-michaeltchapman-galera.orig/manifests/repo.pp
+++ puppet-module-michaeltchapman-galera/manifests/repo.pp
@@ -67,7 +67,7 @@ class galera::repo(
$real_yum_mariadb_baseurl = $yum_mariadb_baseurl
}
- case $::osfamily {
+ case $facts['os']['family'] {
'Debian': {
if ($::operatingsystem == 'Ubuntu') or ($::operatingsystem == 'Debian') {
if ($repo_vendor == 'percona') {
|